Game Text

Voyhkah

Undead
Joined
Apr 25, 2009
Messages
1,444
Location
Earth
How do I make text that... It's hard to explain.

I want text that says somthing like

*+3 :culture: with Paganism

Or really:

*+(-)(int value) (Commerce Symbol) with (Civic)

I already have the values, but how do I make them into game text?

Right now, I have some code in setBuildingHelpActual that looks like this:

Code:
//Voyhkah Tweak START//
	for (iI = 0; iI < GC.getNumCivicInfos(); iI++)
	{
		for (int iJ = 0; iJ < NUM_COMMERCE_TYPES; iJ++)
		{
			if (kBuilding.getCivicCommerceChange(iI, iJ) != 0)
			{
				szBuffer.append(NEWLINE);
				szBuffer.append(gDLL->getText("TXT_KEY_PEDIA_CIVIC_CULTURE_CHANGE", kBuilding.getCivicCommerceChange(iI, iJ), GC.getCommerceInfo((CommerceTypes)iJ).getDescription(), GC.getCivicInfo((CivicTypes)iI).getDescription()));
			}
		}
	}

//Tweak END//

And in the Text folder, this:

Code:
<TEXT>
		<Tag>TXT_KEY_PEDIA_CIVIC_CULTURE_CHANGE</Tag>
		<English>+%i1 [ICON_%s1] with %s2</English>
		<French>+%i1 [ICON_%s1] with %s2</French>
		<German>+%i1 [ICON_%s1] with %s2</German>
		<Italian>+%i1 [ICON_%s1] with %s2</Italian>
		<Spanish>+%i1 [ICON_%s1] with %s2</Spanish>
		<Finnish>+%i1 [ICON_%s1] with %s2</Finnish>
	</TEXT>
 
For the symbol, instead of trying to build a tag just pass the symbol character. For the text it would be something like
Code:
<English>%D1%F2 with %s3</English>
and in the call to gDLL->getText pass they actual symbol instead of the name of the symbol, which you can get via
Code:
GC.getCommerceInfo((CommerceTypes)iJ).getChar()

Each of the symbols in the game font files is inserted into the font it uses as an actual unicode character. Why "%F" is the formatting code the game uses for it, I do not know (the F code is normally for a floating point value).
 
Back
Top Bottom