[R&F] [SOLVED] Leader Ability: Combat Bonus in Terrain?

rarmonio8920

Chieftain
Joined
Oct 15, 2008
Messages
28
Hi,

Hope this one's easy, but I haven't been able to get this one working. Simply trying to create a Leader Ability where units have a +5 Combat Strength Bonus in Tundra (and eventually will add snow). Tried using Roosevelt and Hojo's leader abilities as a reference, but still no go. Definitely would appreciate the help, thanks!

Code:
<LeaderTraits>
    <Row LeaderType="LEADER_FROST" TraitType="TRAIT_LEADER_WINTER_STORM"/>
</LeaderTraits>
<LeaderQuotes>
    <Row LeaderType="LEADER_FROST" Quote="LOC_LEADER_FROST_QUOTE"/>
</LeaderQuotes>
<Traits>
    <Row TraitType="TRAIT_LEADER_WINTER_STORM" Name="LOC_TRAIT_LEADER_WINTER_STORM_NAME" Description="LOC_TRAIT_LEADER_WINTER_STORM_DESCRIPTION"/>
    <Row TraitType="TRAIT_AGENDA_REPLACE" Name="LOC_TRAIT_AGENDA_REPLACE_NAME" Description="LOC_TRAIT_AGENDA_REPLACE_DESCRIPTION"/>
</Traits>

<TraitModifiers>
    <Row TraitType="TRAIT_LEADER_WINTER_STORM" ModifierId="TRAIT_WS_COMBAT_STRENGTH_BONUS_IN_TUNDRA"/>
</TraitModifiers>

<Modifiers>
    <Row>
        <ModifierId>TRAIT_WS_COMBAT_STRENGTH_BONUS_IN_TUNDRA</ModifierId>
        <ModifierType>MODIFIER_UNIT_ADJUST_COMBAT_STRENGTH</ModifierType>
        <SubjectRequirementSetId>REQUIREMENTS_UNIT_ON_TUNDRA_WS</SubjectRequirementSetId>
    </Row>
    <Row>
        <ModifierId>TRAIT_WS_COMBAT_STRENGTH_BONUS_IN_TUNDRA</ModifierId>
        <ModifierType>MODIFIER_PLAYER_UNITS_ATTACH_MODIFIER</ModifierType>
    </Row>
</Modifiers>

<ModifierArguments>
    <Row>
        <ModifierId>TRAIT_WS_COMBAT_STRENGTH_BONUS_IN_TUNDRA</ModifierId>
        <Name>Amount</Name>
        <Value>5</Value>
    </Row>
    <Row>
        <ModifierId>TRAIT_WS_COMBAT_STRENGTH_BONUS_IN_TUNDRA</ModifierId>
        <Name>ModifierId</Name>
        <Value>COMBAT_BONUS_TUNDRA_MODIFIER</Value>
    </Row>
</ModifierArguments>
<ModifierStrings>
</ModifierStrings>
<!-- REQUIREMENT TRAITS-->
<RequirementSets>
    <Row>
        <RequirementSetId>REQUIREMENTS_UNIT_ON_TUNDRA_WS</RequirementSetId>
        <RequirementSetType>REQUIREMENTSET_TEST_ALL</RequirementSetType>
    </Row>
</RequirementSets>

<RequirementSetRequirements>
    <Row>
        <RequirementSetId>REQUIREMENTS_UNIT_ON_TUNDRA_WS</RequirementSetId>
        <RequirementId>REQUIRES_UNIT_ON_TUNDRA_WS</RequirementId>
    </Row>
</RequirementSetRequirements>

<Requirements>
    <Row>
        <RequirementId>REQUIRES_UNIT_ON_TUNDRA_WS</RequirementId>
        <RequirementType>REQUIREMENT_PLOT_TERRAIN_TYPE_MATCHES</RequirementType>
    </Row>
</Requirements>

<RequirementArguments>
    <Row>
        <RequirementId>REQUIRES_UNIT_ON_TUNDRA_WS</RequirementId>
        <Name>TerrainType</Name>
        <Value>TERRAIN_TUNDRA</Value>
    </Row>
</RequirementArguments>
 
The database log didn't show any errors. I'm playing with it and looking at my modifier traits, but a Combat Strength increase doesn't occur at all.

What am I missing? I'm generally seeing it at as: I'm trying to apply an Adjust Combat Strength modifier to the leader trait, with a requirement set that requires my unit to be on Tundra Terrain, and arguments that increase the combat strength by 5... but I have no idea what that MODIFIER_PLAYER_UNITS_ATTACH_MODIFIER type does. Is that probably where my error is?
 
It like I said. You have 2 modifiers with the same name and the one that matters is not defined at all.
Make sure that your mod actually loads and logs are enabled. ModifierId is a Primary Key and you can't have 2 with the same name.
 
Oooh, I got it to work. Thanks for pointing that out.
I'm a little new to this, so this is a good learning experience. Just so I'm understanding this correctly, is it accurate to put it like this?: I have a leader trait that has two modifiers and all the subsequent modifier arguments & requirement sets... The first modifier gives a combat bonus for units with terrain requirements and the second actually attaches that bonus to all of the player's units?
 
Last edited:
Top Bottom