Is this done in Python or XML

Sarge85

Multiplayer Noob
Joined
Mar 27, 2008
Messages
138
Location
Pacific Northwest
Goal:

Unique Unit: Holy Warrior
Modifier: 25% reduction in build time in city with state religion.

What i've done so far:

Added to UnitInfosXML
<bStateReligion>1</bStateReligion>
<iStateReligionUnitProductionModifier>0</iStateReligionUnitProductionModifier>

Above was taken from the Organized Religon Civic

I added this to UnitSchema:
<ElementType name="bStateReligion" content="textOnly" dt:type="boolean"/>
<ElementType name="iStateReligionUnitProductionModifier" content="textOnly" dt:type="int"/>

I also added under:
<ElementType name="UnitInfo" content="eltOnly">
<element type="bStateReligion"/>
<element type="iStateReligionUnitProductionModifier"/>
=====

Sadly the XML won't load. I'm not at my game computer so I'm not sure what the exact message is.

Am I in the ball park though?
I was wondering if I have to list the <Element Type > in the Schema in a particular order

My other question is do I have to add:
<bStateReligion>1</bStateReligion>
<iStateReligionUnitProductionModifier>0</iStateReligionUnitProductionModifier>

to every single unit, or can i just leave it on the Holy Warrior?

===

Noob Modding
Sarge
 
You need to write C++ code to make your own custom DLL. This is what is responsible for reading in the XML. You'd need to add those fields to CvUnitInfo (CvInfos.cpp) along with code to read them from XML and then alter CvCity to use them when calculating production.

On the plus side, you won't need to modify any Python files. :mischief:
 
Back to the goal... This can be done in XML

Goal:

Unique Unit: Holy Warrior
Modifier: 25% reduction in build time in city with state religion.

Create a new unit based on Warrior. Use the religion tags to define the exact condition (any state religion? or one of the 7?) and reduce the cost with 25% (<iCost> from 40 to 30). Done.
 
Top Bottom