Help with wonder adding charges to Military Engineer?

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:
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'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?
 

Attachments

I initially ran into that problem, but the code I created should create all the proper entries for UNIT_IS_MILITARY_ENGINEER so that the game can recognize it. AFAIK all the logic is there as the Requirements entries should allow you to create custom modifiers.
 
Back
Top Bottom