Nightinggale
Deity
- Joined
- Feb 2, 2009
- Messages
- 5,378
Text in the game works like this:
0 to 255 (0xFF) are regular characters.
Sometimes wide characters are used (like CvWString), in which case each character use 16 bit. GameFonts are added in the 16 bit area. The first one is at 8483 and then you just count the offset. Don't ask why it's that number. It just is according to the exe.
In python you can access them using code like this:
Size 2 or smaller will use the small GameFont file while size 3+ will use the big one.
Some info classes have functions like getChar(). Functions like that returns an int and can be used instead of iID. Writing the number directly will allow access to all, even those not accessible by class functions.
Do note that the exe sometimes skip empty icons, meaning you can't be 100% sure of the number by just counting. It might require a bit of trial and error to get the number right.
I wrote a python screen to get the ID of all gamefont icons. However the way I wrote it makes it tricky to move from Colonization to BTS. Still it should be fairly trivial to loop the ints and print int and icon to get them all.
0 to 255 (0xFF) are regular characters.
Sometimes wide characters are used (like CvWString), in which case each character use 16 bit. GameFonts are added in the 16 bit area. The first one is at 8483 and then you just count the offset. Don't ask why it's that number. It just is according to the exe.
In python you can access them using code like this:
PHP:
iID= 8483
string = u"<font=4u>" + (u" %c" % (iID)) + u"</font>"
Some info classes have functions like getChar(). Functions like that returns an int and can be used instead of iID. Writing the number directly will allow access to all, even those not accessible by class functions.
Do note that the exe sometimes skip empty icons, meaning you can't be 100% sure of the number by just counting. It might require a bit of trial and error to get the number right.
I wrote a python screen to get the ID of all gamefont icons. However the way I wrote it makes it tricky to move from Colonization to BTS. Still it should be fairly trivial to loop the ints and print int and icon to get them all.
Last edited: