View Full Version : Guide to the GameText special characters?


Afforess
Oct 01, 2009, 07:01 PM
I've seen these %D1%% and $D2_MOD%% before in the Gametexts, along with others things, but can never seem to tell what they mean, or how to decide on which to use. Is there a guide anywhere to setting these up?

xienwolf
Oct 02, 2009, 12:09 AM
The bit after the underscore is a comment. %% gives you a plain % sign, otherwise using % indicates placement of an item, and the letter after that dictates what type of item you attempt to place. The number indicates which of the variables provided to you will be used.

Letter choices are pretty standard across many languages (http://en.wikipedia.org/wiki/Sprintf#printf_format_placeholders), though I haven't attempted the fancier format methods for Civ so far (like forcing the length of a string/number)

Afforess
Oct 02, 2009, 05:38 PM
Funny thing I just learned about these in class today. Anyways, I'm having an issue where in the civilopedia, it is printing "Cities Require +10% Less Food to Grow" when it should be Printing "Cities Require 10% less Food to Grow" How do I remove that + sign in the front?

(My TXT_KEY looks like this:)
<English>[ICON_BULLET]Cities Require %D1%% Less [ICON_FOOD] to Grow</English>

xienwolf
Oct 03, 2009, 01:08 PM
%D includes +/- all the time. %d includes only the - if negative.

Afforess
Oct 03, 2009, 01:24 PM
%D includes +/- all the time. %d includes only the - if negative.

Okay, thanks. I changed the CvGameTextMgr to show the modifier as an absolute value, so I can use %d.