Jump to content
The Dark Mod Forums

Add text to your signs, signposts, walls, etc.


Fidcal

Recommended Posts

Inspired by rich_is_bored's post I've made some general purpose text decal prefabs. These can be used on signs, signposts, walls, anywhere you want to add text into your FM. Just select the font you want in the prefabls and enter your text. They can be resized by rescaling the texture or resizing the patch. These will be in update 1.03 but you can easily make your own if you want them now. For details see http://wiki.thedarkmod.com/index.php?title=Text_Decals_for_Signs_etc.

 

post-400-127531162596_thumb.jpg

  • Like 1
Link to comment
Share on other sites

Inspired by rich_is_bored's post I've made some general purpose text decal prefabs. These can be used on signs, signposts, walls, anywhere you want to add text into your FM. Just select the font you want in the prefabls and enter your text. They can be resized by rescaling the texture or resizing the patch. These will be in update 1.03 but you can easily make your own if you want them now. For details see http://modetwo.net/d..._for_Signs_etc.

 

post-400-127531162596_thumb.jpg

 

Well, how timely is this?

 

I was just about to dress my map with a whole mess of signs.

 

Thanks!

Link to comment
Share on other sites

Thanks for this.

 

I'm having a problem groking how this thing formats text. As a result, it takes me a long time fiddling with the patch size and font size to get anything reasonable. If I want a single line of text, I have to make the font size small enough to not cause line wrap. Once I have the text all on one line, I make the patch taller, thinking the text will scale accordingly. But it remains the same size. Then I double the patch width and double the font scale, thinking this will make things better, and it ends up wrapping to 2 lines. So I end up going back and forth between font scale and patch size, trying to spiral in on a reasonable sign.

 

Are there any rules as to how it line-wraps?

 

I'd like to simply make a patch the right size, and adjust the font scaling so the text fits on it. No more than 2 steps. But there seems to be some odd relationship between patch size, line-wrapping, and font scale that I can't figure out.

 

Is there a simple process for making the right-size sign with proper line-wrap that I'm missing?

 

Thanks.

Link to comment
Share on other sites

I think I figured out how text is painted on the Entity_Gui patch.

 

1. The font size is scaled according to the scale in the gui definition.

 

2. Using this scaled font size, the text is painted on a 64x64 canvas. (64x64 is the size of the Entity_Gui texture.) Word wrap is determined by how many words at this font size will fit on a "line" of 64 units.

 

3. With the text painted, the canvas is stretched to fit the patch size and horiz and vert scales assigned to the Entity_Gui texture.

 

 

So, the easiest way to create the proper-size sign with the word-wrap that you want, is to:

 

1. Create a square patch whose dimensions are the same as the longest dimension in your sign. So for a 16x128 sign, create a 128x128 patch.

 

2. Give the patch the Entity_Gui texture, with horiz and vert scales of 1.0. Do all the func_static stuff mentioned on the wiki referenced in Fidcal's note above.

 

3. Set the font scale in your gui file to 1.0.

 

4. Take a look at the result. The horizontal and vertical sizes of the letters are in proportion (not stretched or shrunk in one dimension or the other). If the words in your text are word-wrapped the way you want, then the patch is done. Adjust the patch's position to fit on whatever the backing is for your sign (board, wall, whatever).

 

If the word-wrap isn't what you want, adjust the font scale in the gui file. DO NOT adjust the patch size. (For example, if you're trying to fit "Belcher Handlers Incorporated Avenue" on one line for a streetsign, adjust the font scale to something less than 1.0.)

 

Once you've found the font scale that wraps the words the way you want, then you're done and you can place the patch on its backing.

 

It's important NOT to fiddle with the patch size because when you do that, the engine just stretches or shrinks the painted text that's already been word-wrapped.

Edited by grayman
Link to comment
Share on other sites

mmmm... interesting - though I had no problem just resizing the patch (apart from not being able to see the result in DR.) Points to note: changing the gui textscale means you must always include the gui with your FM (after the next update you won't need to) although that is not too severe because they are small in file size. But also needs separate guis for every sign with a different size. Also, setting the patch to be square means you can't have tall or wide text but only the same proportions as the original.

 

Maybe the default textscale wants to be smaller, say 0.5, so more can go on one line. But that would mean typical signs of two or three words might need a very large patch. Maybe not - perhaps just rescaling the texture would be easier there.

 

I'm wondering whether to make two more sets of guis say 0.5 and 1.0 in textscale. Ideally the average mapper shouldn't have to fiddle with the gui.

 

I'll have to do some more experiments to appreciate the problem I think.

Link to comment
Share on other sites

Another complication is that the original fonts vary in size so having the same text scale means they will vary from each other. I tried to approximate so whichever font you chose it would be roughly of the same order of size as each other. So I have different text scales in each gui.

Link to comment
Share on other sites

Also, setting the patch to be square means you can't have tall or wide text but only the same proportions as the original.

 

Starting with a square allows you to get the word wrap the way you want it.

 

After that's sorted out, resizing the patch lets you have tall or wide text. If you know you want text twice as wide as it is tall, and your backing is 16x128, start with a patch that's 64x64. After you find the right font scale to give you the word wrap you want, stretch the patch out to the backing's width of 128. The font will stretch with the patch. Similar technique for tall text.

 

Suggestion: add a keyword to the func_static sign patch that is a scaling factor for text. That times the gui's font scale would give you the final text scale. Then you can adjust on a per-sign basis, instead of having to duplicate gui files for each font you want at a different font scale. Then you can set the gui files all at fontscale 1, and mappers wouldn't have to tinker with them.

 

Or, just add the key word to the func_static and forget the gui scaling. Default it to 1. Gives the mapper easy control over the text size.

 

 

 

Link to comment
Share on other sites

Yes, I've just asked that earlier in the team forum if it is possible to pass the textscale. But I have another idea about using a small textscale and using texture scaling for large because mostly large text would be short so wordwrapping is not so significant, eg, a sign with a street name on one line.

Link to comment
Share on other sites

Texture scaling up is less helpful than resizing the patch so I'll forget that.

 

I think your idea is the best compromise but I'd prefer not to set them all to 1. Currently they vary from 2 to 3. This is because some fonts are smaller, eg, bamberg and summertime are set at 3 to approximate the same size as others at 2. So I'd be inclined to divide them all by 2 roughly so they would be 1 to 1.5

 

Even without the mapper changing the gui the advantage of a smaller textscale is that more goes on a line. The mapper can always force a wordwrap by spacing out. For example:

High_____Street. But you can't do it the other way. If the textscale is large (as now) then you cannot extend the line length to....

 

WARNING! Do not pass

this point. There is danger

of subsidence and falling

rocks.

 

I suggest that a message such as above is about as wide as one would want in a visible sign, about 25 to 30 characters on a line? If we go to a smaller texture scale you can get..

 

WARNING! Do not pass this point.

There is danger of subsidence.

 

But at that scale it is very close to a normal readable anyway (more later) so you might as well frob it and read it so 1 seems a good default. From there the mapper can stretch the patch to get it bigger. Unfortunately this means the patch gets rather large - my signpost patch becomes something like 10 times the area. So that again raises the possibility of 3 different guis for each font - small, medium, and large and then only slightly resize the patch. I don't like the idea of mappers generally changing guis. With a lot of signs with different sizes they might need quite a few guis and where shared, if the mapper decides one gui to be changed it affects the others. Entering text in the entity and then drag sizing it is much more intuitive. This still leaves your idea open to change the gui textscale for advanced users.

 

Now, on the topic of a normal readable I was wondering if we should have a no art background readable as well. These guis would be a smaller textscale, say 0.5 but would be frobbed to read. The text would pop up like any readable but floating white text in the middle of the screen without any background and single page. Thief 2 had this. My only doubt is that without any art background, can the text highlight to be frobbed? The advantage of this over a normal readable is that you don't need to make a special gui for say a pagan message on rag, or a message on some old rotten parchment. Maybe the background entity (rag, rotten parchment) can be made to highlight and link to trigger the readable.

Link to comment
Share on other sites

Inspired by rich_is_bored's post I've made some general purpose text decal prefabs. These can be used on signs, signposts, walls, anywhere you want to add text into your FM. Just select the font you want in the prefabls and enter your text. They can be resized by rescaling the texture or resizing the patch. These will be in update 1.03 but you can easily make your own if you want them now. For details see http://wiki.thedarkmod.com/index.php?title=Text_Decals_for_Signs_etc.

 

post-400-127531162596_thumb.jpg

 

That's really cool. Would you be willing to share preabs for the signposts etc, too?

"The reasonable man adapts himself to the world; the unreasonable one persists in trying to adapt the world to himself. Therefore, all progress depends on the unreasonable man." -- George Bernard Shaw (1856 - 1950)

 

"Remember: If the game lets you do it, it's not cheating." -- Xarax

Link to comment
Share on other sites

Well I think there is a signpost model. The ones in the image are so simple it is hardly worth including considering the mapper might want any type of sign. The above signposts consists only of one upright brush for the post and one horizontal. The ones on the wall and door are single brushes.

Link to comment
Share on other sites

Well I think there is a signpost model. The ones in the image are so simple it is hardly worth including considering the mapper might want any type of sign. The above signposts consists only of one upright brush for the post and one horizontal. The ones on the wall and door are single brushes.

 

Yeah, but if you cut them a bit with the cutter (so they don't appear a simple boxes), they would make ideal starting points. No point in every mapper reinventing the wheel :)

"The reasonable man adapts himself to the world; the unreasonable one persists in trying to adapt the world to himself. Therefore, all progress depends on the unreasonable man." -- George Bernard Shaw (1856 - 1950)

 

"Remember: If the game lets you do it, it's not cheating." -- Xarax

Link to comment
Share on other sites

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

  • Recent Status Updates

    • Petike the Taffer  »  DeTeEff

      I've updated the articles for your FMs and your author category at the wiki. Your newer nickname (DeTeEff) now comes first, and the one in parentheses is your older nickname (Fieldmedic). Just to avoid confusing people who played your FMs years ago and remember your older nickname. I've added a wiki article for your latest FM, Who Watches the Watcher?, as part of my current updating efforts. Unless I overlooked something, you have five different FMs so far.
      · 0 replies
    • Petike the Taffer

      I've finally managed to log in to The Dark Mod Wiki. I'm back in the saddle and before the holidays start in full, I'll be adding a few new FM articles and doing other updates. Written in Stone is already done.
      · 4 replies
    • nbohr1more

      TDM 15th Anniversary Contest is now active! Please declare your participation: https://forums.thedarkmod.com/index.php?/topic/22413-the-dark-mod-15th-anniversary-contest-entry-thread/
       
      · 0 replies
    • JackFarmer

      @TheUnbeholden
      You cannot receive PMs. Could you please be so kind and check your mailbox if it is full (or maybe you switched off the function)?
      · 1 reply
    • OrbWeaver

      I like the new frob highlight but it would nice if it was less "flickery" while moving over objects (especially barred metal doors).
      · 4 replies
×
×
  • Create New...