SCRMaps
/
Sign in

There are four kinds of string

Compile-time, map, string data and TBL strings. Mix them up and it either will not compile or prints the wrong thing.

6 min read

There are no string variables, yet text appears on screen - because four different things are all called strings.

The four kinds
py_strA compile-time string: the quoted text you type in the source. It does not exist in the game.
TrgStringA map string. It occupies the map's STR section and is what a trigger action points at. There is a limit on how many.
DbString data: bytes written straight into memory, which you can change at runtime.
TBLA 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
Sign in to track your progress