There are no string variables, yet text appears on screen - because four different things are all called strings.
| py_str | A compile-time string: the quoted text you type in the source. It does not exist in the game. |
|---|---|
| TrgString | A map string. It occupies the map's STR section and is what a trigger action points at. There is a limit on how many. |
| Db | String data: bytes written straight into memory, which you can change at runtime. |
| TBL | A string in stat_txt.tbl - the game's own words, addressed by number. |
Map strings are a finite resource. Make every line you want to print a TrgString and the STR section fills up and the map stops compiling. Text that changes during a game belongs in a StringBuffer.
Objects are reference types too. You either make one statically, as StringBuffer(), and keep using it, or you alloc and free as needed. Static is almost always right: one buffer serves the whole game.
Building a UI out of text