Units Prereq buildings?

Fariic

Chieftain
Joined
Apr 13, 2010
Messages
93
Is it possible to make a unit available only after a building is constructed.

I want the Warrior to require a barracks to be built, before the unit becomes available.
Is this possible?
 
Yes, there is within CIV5Units.xml a "Unit_BuildingClassRequireds" table (which is unused in vanilla apparently). To get the warrior to do what you want, the code snippet would look like this:

Code:
	<Unit_BuildingClassRequireds>
		<Row>
			<UnitType>UNIT_WARRIOR</UnitType>
			<BuildingClassType>BUILDINGCLASS_BARRACKS</BuildingClassType>
		</Row>
	</Unit_BuildingClassRequireds>

I haven't tested this, but I'm fairly sure it should work. Happy modding!
 
Thank you. Been looking all over for a string in the XML's like that.

Edit: It does indeed work. Thank you.
 
Back
Top Bottom