Can you specify whether a unit can be referred to in the plural or in the singular?

zulu9812

The Newbie Nightmare
Joined
Jan 29, 2002
Messages
6,388
Location
Athens of the North
It's always annoyed me that military units are referred to in the singular, especially later in the game when one imagines that each unit is comprised of hundreds if not thousands of men.

For example:

"Your Axeman has defeated a Barbarian Archer"

to me would sound better as:

"Your Axemen have defeated the Barbarian Archers"

This becomes more crucial when your dealing with custom unit names, for example:

"Your 1st Westpoint Cadets has defeated a 14th Republican Guard"

That just sounds weird, it'd be much better as:

"Your 1st Westpoint Cadets have defeated the 14th Republican Guard"

Now, it is perfectly possible to change what the combat messages say and also editing the unit descriptions to be pluralised, but there are some that you want to stay singular, e.g.

"Your ICBM have been destroyed" - you'd want some way to distinguish this so that it always said "Your ICBM has been destroyed"

Does anyone know how this could be achieved? Please ask if you're not sure what I'm getting at.
 
You'd probably have to create a new text entry for the plural and then add some new code in the SDK which makes the game decide which to display (the singular or plural), based on the unit.
 
Should be easy enough. Just add some bool tags for singular and plural in UnitInfos, some new Text tags... Oh my god, how on EARTH do you add a text tag?
 
It's all possible but requires a lot of simple but tedious DLL work.
- add a boolean for plural to CvInfos.cpp/h, unit XML & related schema
- possible also add this boolean for CvUnit.cpp/h so that it can be changed in-game (custom names)
- find all the combat text keys by searching for game strings in text XMLs; note the key names
- make copies of them and modify for plurals
- find all the text keys in CvGameCoreDLL (most / all are in CvUnit.cpp)
- based on bPlural in CvInfo/CvUnit make a boolean that chooses the proper key

There are also translator functions for making plural cases, but that doesn't really take away any of the steps.

I was silly enough to make such booleans to remove the a article from before named units so that there's no "your unit has destroyed a Charles Martel" and it probably wasn't worth the time it took. It still annoys me to see "your unit has destroyed a American Archer"...

Also I'm fairly sure it should be "Your Axemen have defeated Barbarian Archers", since those archers are plural and indefinite = zero article.
 
Actually plurals can work without any DLL modification, if you can live with only static names (i.e. no custom ones). Just define every unit name in XML as singular/plural, like it's done for non-English languages, then modify the English text keys accordingly.

I don't have time to test it, but red part should work just fine, blue part probably not, but you can play with it:

Code:
		<English>
			<Text>Axemen</Text>
			<Gender>Male</Gender>
			<Plural>1</Plural>
		</English>

Code:
<English>While defending, your %s1_UnitName [COLOR="Red"][NUM1:has:have][/COLOR] killed [COLOR="Blue"][NUM2:a:][/COLOR] %s3_owner_adjective %s2_EnUName!</English>

Alternatively, blue part should work with [NUM2:a:the] but that means no zero articles.

If [NUM1:has:have] doesn't work, [NUM1:has:has:have:have] should. Edited the post like 10 times since there seems be like 10 ways to do it.
 
Top Bottom