View Full Version : Limiting a unit to a group of players


Asjo
Nov 24, 2007, 10:43 AM
I added a new naval unit and allowed all players to make this and I thought it would add to overall versatility. However, the AI used the unit more than I liked, and for most civilizations I prefered to see other units used.

Therefore, I would like to make this unit available only to a handful of nations. Normally, I've just been doing unit replacements, which is quite simple (and the game has examples of that when you begin). I imagined that maybe setting all values in CIV4UnitClassInfos to 0 and then adding the unit for a specific civilization would do the trick. However, when I think about it, setting the values to 0 would mean that even those given the unit specifically would not be able to build it.

Could I just delete the unit class from CIV4UnitClassInfos or what options do I have?

CXDamian
Nov 24, 2007, 12:07 PM
Two ways to do it,

1. Leave CIV4UnitClassInfos.xml as is, then in CIV4CivilizationInfos.xml: add the following under <Units> for all civs you don't want to use:
<Unit>
<UnitClassType>UNITCLASS_TUGBOAT</UnitClassType>
<UnitType>NONE</UnitType>
</Unit>

2. Change CIV4UnitClassInfos.xml for your unit: Change <DefaultUnit> to NONE.
repeat above CIV4CivilizationInfos edit, except do it only for the civs you want to have access to the unit. Change <UnitType> to UNIT_TUGBOAT