How do you make a unit unique?

jimmygeo

Warlord
Joined
Jan 15, 2004
Messages
234
Location
Alberta, Canada
I've looked through the UnitInfos.xml file until my eyes crossed:crazyeye: but could not find a tag that would make a unit buildable by only one civ. I also tried modding the CIV4CivilizationsInfos.xml file to match what was done e.g. for the French Musketeer, but it didn't seem to work because I was able to build the unit in a different civ. What am I missing or doing wrong?:confused:

jimmygeo
 
That is handled by a combination of CIV4UnitClassInfos.xml and CIV4CivilizationInfos.xml

In UnitClassInfos, each general type of unit is assigned a class.
One class of Spearmen, one for Warriors, one for Submarines, etc.
In that class is a tag "DefaultUnit" - that is the particular unit of that class that every civ gets to build.

Then in CivilizationInfos, each civ has a block that looks like this :
Code:
			<Units>
				<Unit>
					<UnitClassType>UNITCLASS_MARINE</UnitClassType>
					<UnitType>UNIT_AMERICAN_NAVY_SEAL</UnitType>
				</Unit>
			</Units>

That block says that instead of building the Default unit type of "UNITCLASS_MARINE", they get to build "UNIT_AMERICAN_NAVY_SEAL" instead.

If the unit that you want to make buildable by one civ only is to replace an existing unit, then all you have to do is add another Unit entry to the Civ.

If it is an entirely new unit type that will not replace anything, you will need to create a new UnitClass for it to reside in. Set it's Default to "NONE" and add the Unit entry to the Civ.
 
Thank you very, very much, zyphyr. This is one of the most helpful replies I've ever had in the Forums. It's almost a mini-tutorial. Great!

jimmygeo
 
Back
Top Bottom