raystuttgart
Civ4Col Modder
Hi guys,
I am currently trying to figure out something in XML.
(Related to text.)
Since I it might be useful for many mods, why not figure it out together.
Example:
(Simplified)
Where %d1 is the amount and %s2:2 is referring to the plural case of entries for Units like this:
This piece of XML will always generate text (e.g.) in Colopedia that says:
* Provides 4 Master Carpenters (if 4 units given)
or
* Provides 1 Master Carpenters (if only 1 unit given)
or
...
So obviously it always uses plural.
Which is not a big deal, but it simply looks a bit stupid if there is only 1 unit provided.
Well, it would not be that hard to code into DLL that in case of singular it should use a different text key, than in case of singular.
So we could have:
TXT_KEY_FATHER_FREE_UNITS_SINGULAR
TXT_KEY_FATHER_FREE_UNITS_PLURAL
But there must be a better solution than that.
(I don't want to duplicate every text, where I could have singular and plural case.)
Also, there does exist the NUM modifier in such Text-XML.
(It simply does not work here.)
Example:
But if I try to write something like this, it seems to get confused because of the many ":" ...
This engine simply too stupid to understand something like this:
[NUM1:%s2:1:%s2:2]
Meaning to translate into something like this:
1 -> Master Carpenter
>1 -> Master Carpenters
----------
Any ideas to get singular and plural into such a simple text as this one without messing with DLL ?
(Meaning, if "%d1" == 1, then use "%s2:1" instead of "%s2:2".)
I am currently trying to figure out something in XML.
(Related to text.)
Since I it might be useful for many mods, why not figure it out together.

Example:
(Simplified)
Code:
<TEXT>
<Tag>TXT_KEY_FATHER_FREE_UNITS</Tag>
<English>Provides %d1 %s2:2</English>
...
</TEXT>
Where %d1 is the amount and %s2:2 is referring to the plural case of entries for Units like this:
Code:
<Text>Master Carpenter:Master Carpenters</Text>
This piece of XML will always generate text (e.g.) in Colopedia that says:
* Provides 4 Master Carpenters (if 4 units given)
or
* Provides 1 Master Carpenters (if only 1 unit given)
or
...
So obviously it always uses plural.
Which is not a big deal, but it simply looks a bit stupid if there is only 1 unit provided.
Well, it would not be that hard to code into DLL that in case of singular it should use a different text key, than in case of singular.
So we could have:
TXT_KEY_FATHER_FREE_UNITS_SINGULAR
TXT_KEY_FATHER_FREE_UNITS_PLURAL
But there must be a better solution than that.

(I don't want to duplicate every text, where I could have singular and plural case.)
Also, there does exist the NUM modifier in such Text-XML.
(It simply does not work here.)
Example:
Code:
<English>Growing (%d1 [NUM1:Turn:Turns])</English>
But if I try to write something like this, it seems to get confused because of the many ":" ...
Code:
<TEXT>
<Tag>TXT_KEY_FATHER_FREE_UNITS</Tag>
<English>Provides %d1 [NUM1:%s2[COLOR="Red"]:[/COLOR]1:%s2[COLOR="Red"]:[/COLOR]2]</English>
...
</TEXT>
This engine simply too stupid to understand something like this:
[NUM1:%s2:1:%s2:2]
Meaning to translate into something like this:
1 -> Master Carpenter
>1 -> Master Carpenters
----------
Any ideas to get singular and plural into such a simple text as this one without messing with DLL ?

(Meaning, if "%d1" == 1, then use "%s2:1" instead of "%s2:2".)
Code:
<TEXT>
<Tag>TXT_KEY_FATHER_FREE_UNITS</Tag>
<English>[ICON_BULLET]Provides %d1 %s2:2</English>
...
</TEXT>