Staredit Network > Forums > SC1 UMS Mapmaking Assistance > Topic: StarCraft Text Formatting
StarCraft Text Formatting
Mar 11 2018, 7:27 am
By: DarkenedFantasies  

Mar 11 2018, 7:27 am DarkenedFantasies Post #1

Roy's Secret Service

Here is a list I have created of all the control characters and color tags, for those who want an up-to-date reference. People still occasionally ask for such a list, and existing lists are outdated/misleading. So I thought I'd make a public version of my own ref sheet, with descriptions of the control characters and matching colors.

CONTROL CHARACTERS
         <01> : Mimic
              Duplicates the second-last used color on current line/string. Otherwise, duplicates last color on previous line/string.
         <0C> : Page break
              Invisible in briefing room, line break in-game. Can be used for compact formatting when using many line breaks in the string
              editor, as it isn't displayed as a new line in it.

         <0D> : Carriage return
              Used in conjunction with <0A> to denote a line break, which produces the same result as simply pressing the enter key.
              Treated as a zero-width character in the map editor and in the game, but otherwise does nothing; makes it a compact option
              for increasing the on-screen time of display texts (see footnote).

         <12> : Right align
              Aligns all subsequent text to the right side of the screen, and overrides subsequent center align tags, until new line.
         <13> : Center align
              Aligns all subsequent text to the center of the screen until new line.
         <14> : Invisible
              Renders text as such. Overrides all subsequent color tags on the string in the briefing room, or until new line in-game.
IN-GAME TEXT COLORS
         <02> : Periwinkle (Default text color.)
         <03> : Yellow
         <04> : White
         <05> : Grey (Overrides all subsequent color tags until new line.)
         <06> : Red
         <07> : Lime
         <08> : Red (Player 1)
         <0E> : Blue (Player 2)
         <0F> : Teal (Player 3)
         <10> : Purple (Player 4)
         <11> : Orange (Player 5)
         <15> : Brown (Player 6)
         <16> : White (Player 7)
         <17> : Yellow (Player 8)
         <18> : Green (Player 9)
         <19> : Lemon (Player 10)
         <1B> : Peach (Player 11)
         <1C> : Royal Blue (Player 12)
         <1D> : Asparagus (Player 13)
         <1E> : Deep Periwinkle (Player 14)
         <1F> : Cyan (Player 15)
BRIEFING ROOM TEXT COLORS
         <02> : Periwinkle (Default text color.)
         <03> : Lime-Green
         <04> : Yellow-Green
         <05> : Grey (Overrides all subsequent color tags on the string.)
         <06> : White
         <07> : Red
         (Other colors yield unpredictable results.)
USELESS/REDUNDANT
         <00> : End string
              Null character; automatically changes to <01>.
         <09> : Tab
              Can also be inserted by pressing CTRL+Tab or CTRL+I.
         <0A> : Newline
              Marks a line break. Treated as a zero-width character in the map editor text area, but displays a new line in the game.
              Same as simply pressing the enter key.

         <0B> : Invisible
              Identical to <14>.
         <1A> : End of file
              Treated as a zero-width character in the game, but otherwise does nothing.
         <20> : Space
              Same as simply pressing the spacebar.
         <7F> : Delete character
              Displays a character with various appearances in briefing & in-game, as well as between SD and HD graphics.
              Can also be inserted by pressing CTRL+Backspace.
         Display text messages 80 characters or shorter remain 4 seconds on screen, +50 milliseconds per additional character when longer.

:facts:

Post has been edited 5 time(s), last time on Apr 30 2018, 11:43 pm by DarkenedFantasies.




Mar 11 2018, 11:05 am Lanthanide Post #2



Thanks, this is very useful. A while ago I was trying to do mission briefing text colours and scmdraft just doesn't have a reference for that. Had to hunt around on the net for quite a while before I found something that actually stated the colour codes for briefings.

I have some relevant information from my recent experiments in playing with text in SCR. In both SD and HD graphics, unicode characters are now supported Unicode characters let you do things like Korean text, but also they offer a bunch of new whitespace alignment options. Heinermann has a posthere http://www.staredit.net/368329/, which links to a pastebin and a imgur showing the different lengths of the characters in pixels, with screenshtos: One annoying quirk is that many of these whitespace characters are different pixel size depending if you're in SD or HD graphics, there are a couple that appear to be the same size in both resolutions though.

If your map has any EUDs present (even if they're in a Never condition and not executed), then the extended whitespace characters above won't be available to you, and they'll just be replaced with standard spaces instead. The presence of EUDs don't break Korean characters though so I'm not sure what the precise limitations are when you have EUDs present.

More gotchas:
- When aligning your text on the screen in SCR, unfortunately the character sizes are very different between SD and HD graphics, so if you want to get perfect alignment in both graphics systems, expect to spend a lot of time flipping back and forth. This is further complication by all of the possible combinations: Starting a game in HD and swapping to SD, will present you different alignment than if you started the game in SD to begin with! Also HD can be letterboxed, if the player selects Pillarbox or Window mode, so the width of the screen isn't even consistent in HD itself.
- You can enter unicode characters using UTF-8 byte codes. Many tools (scmdraft, chkdraft, Farty's stat_txt editor) don't support unicode and when you paste it into them, they replace it with ? characters, but they do support UTF-8 hex codes although it can be a real hassle translating the characters 1 by 1 (I couldn't find any online tools that would translate unicode and leave english alone). I found a fast workaround however - TrigEditPlus plugin for scmdraft will allow you to paste unicode characters into trigger comment strings, and upon compiling, if you then view the text trigger in regular TrigEdit the unicode will now be in a different representation (ANSI?) that you can freely copy and paste into any tool that was initially confused by the unicode.



None.

Mar 11 2018, 12:53 pm Suicidal Insanity Post #3

I see you !

Main reason I don't have a reference for briefing colors is I haven't tracked down the palette I need to render the preview.


As I told you in the shoutbox, EUDs disable UTF-8 support, instead the game assumes the map uses Korean encoding.




Mar 11 2018, 5:25 pm DarkenedFantasies Post #4

Roy's Secret Service

Quote from Lanthanide
- When aligning your text on the screen in SCR, unfortunately the character sizes are very different between SD and HD graphics, so if you want to get perfect alignment in both graphics systems, expect to spend a lot of time flipping back and forth. This is further complication by all of the possible combinations: Starting a game in HD and swapping to SD, will present you different alignment than if you started the game in SD to begin with! Also HD can be letterboxed, if the player selects Pillarbox or Window mode, so the width of the screen isn't even consistent in HD itself.
One solution to circumvent the issue of inconsistent screen sizes is to align the text using Center Align; the center of the screen is always at the center. :P Tabs seem fairly consistent to me between SD and HD when they're used on either end of the string/line.
Main reason I don't have a reference for briefing colors is I haven't tracked down the palette I need to render the preview.
I believe the palette is stored inside glue\palcs\tfont.pcx. At least that's the only thing I can find that contains all of the briefing text colors.




Mar 11 2018, 9:34 pm Suicidal Insanity Post #5

I see you !

That file is on the game CDs, not just the default install. It also has to be in stardat.mpq somewhere :/

E: Found a bunch in stardat glue folder
palmm, palnl - no idea
palrp, palrt, palrz - r protoss, r terran, r zerg?

palpd, palpv - protoss defeat and victory?
palpt, paltv - terran defeat and victory?
palzd, palzv - zerg defeat and victory?

I very vaguely remember it being in the briefing room UI settings somewhere? I'll try to figure it out tommarow, maybe I just need to load the palette from the background image and then use the corresponding font remapping.


E: I think its working, so I guess the string for the briefing rooms can see the light of day after all - its been unused in the code for who knows how many years :D

Post has been edited 8 time(s), last time on Mar 11 2018, 10:20 pm by Suicidal Insanity.




Mar 12 2018, 12:32 am Lanthanide Post #6



One solution to circumvent the issue of inconsistent screen sizes is to align the text using Center Align; the center of the screen is always at the center. :P Tabs seem fairly consistent to me between SD and HD when they're used on either end of the string/line.
I haven't tried to use tabs for alignment much, but perhaps doing them in isolation (not around other text) at the start/end of a line may work better.

Anyway, as my post said, the actual width of the screen changes: SD is always 4:3, and HD can be 16:9 or 4:3 depending what mode they have it in. The text rendering size of space characters also differs if you start the game in HD and swap to SD, compared to starting it in SD to start with. So centering the text and working outwards from the center of the screen is the best available solution, but even that won't work in all cases, when limited to only ASCII characters. I can speak from experience (I spent about 4 hours fiddling with this and came up with a "best acceptable" solution, that wasn't as good as my 1.16.1 alignment).



None.

Options
  Back to forum
Please log in to reply to this topic or to report it.
Members in this topic: None.
[01:28 pm]
Vrael -- "HIRED"
[01:27 pm]
Vrael -- Also, in case I forgot to mention it, I'd do some analytics on the Big Data in our analytics Data Lake where we'll analyze some Nano Data from the analytics database into some analytics which we'll analyze with analytics. Analytics.
[01:26 pm]
Vrael -- jjf28
jjf28 shouted: but how will you handle the backward overflow from the resulting upward revenue stream dynamics?
Oh that's a great question - here's what I'd do. As per Hamlet, the upward dynamics could be handled by an Othellan repertoire demanding on-change systematization of the vertical integration. Instead, we'll take the backward overflow into a horizontal integration using market analytics, resulting in efficiency increases.
[12:32 pm]
jjf28 -- he himself said he was hired, I admire his confidence but the interview isn't over :O
[05:45 am]
NudeRaider -- jjf28
jjf28 shouted: but how will you handle the backward overflow from the resulting upward revenue stream dynamics?
he's already HIRED. No need for further questions :P
[05:43 am]
NudeRaider -- Vrael
Vrael shouted: Mini Moose 2707 well, the jobs I'm thinking of generally go to people with physics/math/engineering degrees, dunno if CS would quite qualify, unless maybe they had a minor in one of the other areas
Our secretary / greeting lady gets 2 days of home office too.
[05:40 am]
NudeRaider -- MasterJohnny
MasterJohnny shouted: How do I get one of these work from home jobs...
you don't have, if you just move so close to your work that you're there in 3 minutes. ;)
[02:20 am]
jjf28 -- but how will you handle the backward overflow from the resulting upward revenue stream dynamics?
[02:12 am]
Vrael -- "HIRED"
[02:12 am]
Vrael -- jjf28
jjf28 shouted: Vrael how will you apply your experience in Medieval Shakespearean Poetry here at SENCo?
"Well first, I'd begin by adapting my knowledge of rhyme and meter to make my Big Data operations more efficient by synergizing with adjacent market technologies."
Please log in to shout.


Members Online: Roy, sitskoroszytmoke1, UEDCommander, Vrael