thecrazyscot
Spiffy
- Joined
- Dec 27, 2012
- Messages
- 3,107
So I've made a mod which lowers the cost and adds a charge to the Military Engineer, and I wanted to update the Alhambra to add a charge to all Military Engineers similar to how the Pyramids boost Builders.
It looks like in order to do so a Modifier has to be created as well as a RequirementSet. Here's my relevant code:
I've also uploaded the mod here if anyone wants to test it (just for testing purposes I've changed the Alhambra to 10 cost, City Center adjacency requirement, and flat as well as hilly terrain). Do a Renaissance Era start.
I'm wondering if the problem is with the ModifierType? MODIFIER_PLAYER_UNITS_ADJUST_BUILDER_CHARGES seems like it should work, but after building the Alhambra and building a Military Engineer the unit does not have 4 build charges.
Anyone have any ideas?
It looks like in order to do so a Modifier has to be created as well as a RequirementSet. Here's my relevant code:
Spoiler :
Code:
<RequirementSets>
<Row>
<RequirementSetId>UNIT_IS_MILITARY_ENGINEER</RequirementSetId>
<RequirementSetType>REQUIREMENTSET_TEST_ALL</RequirementSetType>
</Row>
</RequirementSets>
<RequirementSetRequirements>
<Row>
<RequirementSetId>UNIT_IS_MILITARY_ENGINEER</RequirementSetId>
<RequirementId>REQUIREMENT_UNIT_IS_MILITARY_ENGINEER</RequirementId>
</Row>
</RequirementSetRequirements>
<Requirements>
<Row>
<RequirementId>REQUIREMENT_UNIT_IS_MILITARY_ENGINEER</RequirementId>
<RequirementType>REQUIREMENT_UNIT_TYPE_MATCHES</RequirementType>
</Row>
</Requirements>
<RequirementArguments>
<Row>
<RequirementId>REQUIREMENT_UNIT_IS_MILITARY_ENGINEER</RequirementId>
<Name>UnitType</Name>
<Value>UNIT_MILITARY_ENGINEER</Value>
</Row>
</RequirementArguments>
<Modifiers>
<Row>
<ModifierId>TCS_ADD_ENGINEER_CHARGES</ModifierId>
<ModifierType>MODIFIER_PLAYER_UNITS_ADJUST_BUILDER_CHARGES</ModifierType>
<SubjectRequirementSetId>UNIT_IS_MILITARY_ENGINEER</SubjectRequirementSetId>
</Row>
<Modifiers>
<ModifierArguments>
<Row>
<ModifierId>TCS_ADD_ENGINEER_CHARGES</ModifierId>
<Name>Amount</Name>
<Value>1</Value>
</Row>
<ModifierArguments>
<BuildingModifiers>
<Row>
<BuildingType>BUILDING_ALHAMBRA</BuildingType>
<ModifierId>TCS_ADD_ENGINEER_CHARGES</ModifierId>
</Row>
</BuildingModifiers>
I'm wondering if the problem is with the ModifierType? MODIFIER_PLAYER_UNITS_ADJUST_BUILDER_CHARGES seems like it should work, but after building the Alhambra and building a Military Engineer the unit does not have 4 build charges.
Anyone have any ideas?