Ability active in own territory

'Stache

Chieftain
Joined
Jan 10, 2019
Messages
19
Hello! I made this .xml file for my civ, that should give my units a +10 attack bonus in their own territory.
There are no error messages in my Database.log and the game runs fine, yet the effect never appears.
I think the game swallows my code, but it never thinks its conditions are met.

Code:
<?xml version="1.0" encoding="utf-8"?>
<GameInfo>
   <Types>
        <Row Type="ABILITY_MILITIA" Kind="KIND_ABILITY"/>
    </Types>
    <TypeTags>
        <Row Type="ABILITY_MILITIA" Tag="CLASS_MELEE"/>
       <Row Type="ABILITY_MILITIA" Tag="CLASS_RANGED"/>
       <Row Type="ABILITY_MILITIA" Tag="CLASS_RECON"/>
       <Row Type="ABILITY_MILITIA" Tag="CLASS_HEAVY_CAVALRY"/>
       <Row Type="ABILITY_MILITIA" Tag="CLASS_LIGHT_CAVALRY"/>
       <Row Type="ABILITY_MILITIA" Tag="CLASS_RANGED_CAVALRY"/>
       <Row Type="ABILITY_MILITIA" Tag="CLASS_ANTI_CAVALRY"/>
       <Row Type="ABILITY_MILITIA" Tag="CLASS_NAVAL_RANGED"/>
       <Row Type="ABILITY_MILITIA" Tag="CLASS_NAVAL_MELEE"/>
       <Row Type="ABILITY_MILITIA" Tag="CLASS_HEAVY_CHARIOT"/>
    </TypeTags>
   <UnitAbilities>
       <Row UnitAbilityType="ABILITY_MILITIA" Name="LOC_ABILITY_MILITIA" Description="LOC_ABILITY_MILITIA" Inactive="true"/>
   </UnitAbilities>
    <UnitAbilityModifiers>
        <Row>
            <UnitAbilityType>ABILITY_MILITIA</UnitAbilityType>
            <ModifierId>MILITIA_ADJUST_IN_TERRITORY_COMBAT</ModifierId>
        </Row>
    </UnitAbilityModifiers>
    <Modifiers>
        <Row>
            <ModifierId>MILITIA_ADJUST_IN_TERRITORY_COMBAT</ModifierId>
            <ModifierType>MODIFIER_UNIT_ADJUST_COMBAT_STRENGTH</ModifierType>
            <SubjectRequirementSetId>REQUIREMENTS_UNITS_IN_OWNER_TERRITORY</SubjectRequirementSetId>
        </Row>
    </Modifiers>
    <ModifierArguments>
        <Row>
            <ModifierId>MILITIA_ADJUST_IN_TERRITORY_COMBAT</ModifierId>
            <Name>Amount</Name>
            <Value>10</Value>
        </Row>
       <Row>
           <ModifierId>MILITIA_ADJUST_IN_TERRITORY_COMBAT</ModifierId>
           <Name>AbilityType</Name>
           <Value>ABILITY_MILITIA</Value>
       </Row>
    </ModifierArguments>
    <RequirementSets>
        <Row>
            <RequirementSetId>REQUIREMENTS_UNITS_IN_OWNER_TERRITORY</RequirementSetId>
            <RequirementSetType>REQUIREMENTSET_TEST_ALL</RequirementSetType>
        </Row>
    </RequirementSets>
    <RequirementSetRequirements>
        <Row>
            <RequirementSetId>REQUIREMENTS_UNITS_IN_OWNER_TERRITORY</RequirementSetId>
            <RequirementId>UNIT_IN_OWNER_TERRITORY_REQUIREMENT_MILITIA</RequirementId>
        </Row>
    </RequirementSetRequirements>
    <Requirements>
        <Row>
            <RequirementId>UNIT_IN_OWNER_TERRITORY_REQUIREMENT_MILITIA</RequirementId>
            <RequirementType>REQUIREMENT_UNIT_IN_OWNER_TERRITORY</RequirementType>
        </Row>
    </Requirements>
</GameInfo>

I am still fairly new to modding civ, and this is my first attempt at requirements, so I am sorry if the answer is painfully obvious.

Thank you very much for any help!
 
Tried it. Sadly it didn't change anything.
Changing ALL to ANY is probably a smart idea anyhow.

Thanks!
 
But I noticed other thing, you are using an unit ability for a civ trait right? show that xml, you probably need more modifiers on that side (of the civ). In other way try to see example of civ who has inactive ability for units, but this are activated for your civ, by more modifiers.
 
Hi @raen, I don't know which xml you want me to show you.

Here is the .xml that should do the attack boost:

Code:
<?xml version="1.0" encoding="utf-8"?>
<GameInfo>
   <Types>
        <Row Type="ABILITY_STACHE_MILITIA" Kind="KIND_ABILITY"/>
    </Types>
    <TypeTags>
        <Row Type="ABILITY_STACHE_MILITIA" Tag="CLASS_MELEE"/>
       <Row Type="ABILITY_STACHE_MILITIA" Tag="CLASS_RANGED"/>
       <Row Type="ABILITY_STACHE_MILITIA" Tag="CLASS_RECON"/>
       <Row Type="ABILITY_STACHE_MILITIA" Tag="CLASS_HEAVY_CAVALRY"/>
       <Row Type="ABILITY_STACHE_MILITIA" Tag="CLASS_LIGHT_CAVALRY"/>
       <Row Type="ABILITY_STACHE_MILITIA" Tag="CLASS_RANGED_CAVALRY"/>
       <Row Type="ABILITY_STACHE_MILITIA" Tag="CLASS_ANTI_CAVALRY"/>
       <Row Type="ABILITY_STACHE_MILITIA" Tag="CLASS_NAVAL_RANGED"/>
       <Row Type="ABILITY_STACHE_MILITIA" Tag="CLASS_NAVAL_MELEE"/>
       <Row Type="ABILITY_STACHE_MILITIA" Tag="CLASS_HEAVY_CHARIOT"/>
    </TypeTags>
   <UnitAbilities>
       <Row UnitAbilityType="ABILITY_STACHE_MILITIA" Name="LOC_ABILITY_STACHE_MILITIA" Description="LOC_ABILITY_STACHE_MILITIA" Inactive="true"/>
   </UnitAbilities>
    <UnitAbilityModifiers>
        <Row>
            <UnitAbilityType>ABILITY_STACHE_MILITIA</UnitAbilityType>
            <ModifierId>STACHE_MILITIA_ADJUST_IN_TERRITORY_COMBAT</ModifierId>
        </Row>
    </UnitAbilityModifiers>
    <Modifiers>
        <Row>
            <ModifierId>STACHE_MILITIA_ADJUST_IN_TERRITORY_COMBAT</ModifierId>
            <ModifierType>MODIFIER_UNIT_ADJUST_COMBAT_STRENGTH</ModifierType>
            <SubjectRequirementSetId>REQUIREMENTS_UNITS_IN_OWNER_TERRITORY</SubjectRequirementSetId>
        </Row>
    </Modifiers>
    <ModifierArguments>
        <Row>
            <ModifierId>STACHE_MILITIA_ADJUST_IN_TERRITORY_COMBAT</ModifierId>
            <Name>Amount</Name>
            <Value>10</Value>
        </Row>
       <Row>
           <ModifierId>STACHE_MILITIA_ADJUST_IN_TERRITORY_COMBAT</ModifierId>
           <Name>AbilityType</Name>
           <Value>ABILITY_STACHE_MILITIA</Value>
       </Row>
    </ModifierArguments>
    <RequirementSets>
        <Row>
            <RequirementSetId>REQUIREMENTS_UNITS_IN_OWNER_TERRITORY</RequirementSetId>
            <RequirementSetType>REQUIREMENTSET_TEST_ANY</RequirementSetType>
        </Row>
    </RequirementSets>
    <RequirementSetRequirements>
        <Row>
            <RequirementSetId>REQUIREMENTS_UNITS_IN_OWNER_TERRITORY</RequirementSetId>
            <RequirementId>UNIT_IN_OWNER_TERRITORY_REQUIREMENT_STACHE_MILITIA</RequirementId>
        </Row>
    </RequirementSetRequirements>
    <Requirements>
        <Row>
            <RequirementId>UNIT_IN_OWNER_TERRITORY_REQUIREMENT_STACHE_MILITIA</RequirementId>
            <RequirementType>REQUIREMENT_UNIT_IN_OWNER_TERRITORY</RequirementType>
        </Row>
    </Requirements>
   <TraitModifiers>
       <Row TraitType="TRAIT_CIVILIZATION_STACHE_THALVARIA" ModifierId="ABILITY_STACHE_MILITIA"/>
   </TraitModifiers>
</GameInfo>

I already have an ability for my units which is embedded into my civ.
It negates the movement penalty on hills.
Here it is, works just fine:

Code:
<?xml version="1.0" encoding="utf-8"?>
<GameInfo>
   <Types>
       <Row Type="ABILITY_STACHE_IGNORE_HILL_COST" Kind="KIND_ABILITY"/>
   </Types>
   <TypeTags>
       <Row Type="ABILITY_STACHE_IGNORE_HILL_COST" Tag="CLASS_LANDCIVILIAN"/>
       <Row Type="ABILITY_STACHE_IGNORE_HILL_COST" Tag="CLASS_RECON"/>
       <Row Type="ABILITY_STACHE_IGNORE_HILL_COST" Tag="CLASS_MELEE"/>
       <Row Type="ABILITY_STACHE_IGNORE_HILL_COST" Tag="CLASS_RANGED"/>
       <Row Type="ABILITY_STACHE_IGNORE_HILL_COST" Tag="CLASS_SIEGE"/>
       <Row Type="ABILITY_STACHE_IGNORE_HILL_COST" Tag="CLASS_HEAVY_CAVALRY"/>
       <Row Type="ABILITY_STACHE_IGNORE_HILL_COST" Tag="CLASS_LIGHT_CAVALRY"/>
       <Row Type="ABILITY_STACHE_IGNORE_HILL_COST" Tag="CLASS_RANGED_CAVALRY"/>
       <Row Type="ABILITY_STACHE_IGNORE_HILL_COST" Tag="CLASS_ANTI_CAVALRY"/>
       <Row Type="ABILITY_STACHE_IGNORE_HILL_COST" Tag="CLASS_HEAVY_CHARIOT"/>
       <Row Type="ABILITY_STACHE_IGNORE_HILL_COST" Tag="CLASS_LIGHT_CHARIOT"/>
       <Row Type="ABILITY_STACHE_IGNORE_HILL_COST" Tag="CLASS_BATTERING_RAM"/>
       <Row Type="ABILITY_STACHE_IGNORE_HILL_COST" Tag="CLASS_SIEGE_TOWER"/>
       <Row Type="ABILITY_STACHE_IGNORE_HILL_COST" Tag="CLASS_OBSERVATION"/>
       <Row Type="ABILITY_STACHE_IGNORE_HILL_COST" Tag="CLASS_ANTI_AIR"/>
       <Row Type="ABILITY_STACHE_IGNORE_HILL_COST" Tag="CLASS_GARDE"/>
   </TypeTags>
   <UnitAbilities>
       <Row UnitAbilityType="ABILITY_STACHE_IGNORE_HILL_COST" Name="LOC_ABILITY_STACHE_IGNORE_HILL_COST_NAME" Description="LOC_ABILITY_STACHE_IGNORE_HILL_COST_DESCRIPTION" Inactive="true"/>
   </UnitAbilities>
   <UnitAbilityModifiers>
       <Row>
           <UnitAbilityType>ABILITY_STACHE_IGNORE_HILL_COST</UnitAbilityType>
           <ModifierId>ALTITUDE_TRAINING_IGNORE_HILLS</ModifierId>
       </Row>
   </UnitAbilityModifiers>
   <Modifiers>
       <Row>
           <ModifierId>STACHE_IGNORE_HILL_COST</ModifierId>
           <ModifierType>MODIFIER_PLAYER_UNITS_GRANT_ABILITY</ModifierType>
           <Permanent>true</Permanent>
       </Row>
   </Modifiers>
   <ModifierArguments>
       <Row>
           <ModifierId>STACHE_IGNORE_HILL_COST</ModifierId>
           <Name>AbilityType</Name>
           <Value>ABILITY_STACHE_IGNORE_HILL_COST</Value>
       </Row>
   </ModifierArguments>
   <TraitModifiers>
       <Row TraitType="TRAIT_CIVILIZATION_STACHE_THALVARIA" ModifierId="STACHE_IGNORE_HILL_COST"/>
   </TraitModifiers>
</GameInfo>

"TRAIT_CIVILIZATION_STACHE_THALVARIA" is the name of the trait of my civ.
 
Okay,
I have put

<Row>
<ModifierId>STACHE_MILITIA_ADJUST_IN_TERRITORY_COMBAT</ModifierId>
<ModifierType>MODIFIER_PLAYER_UNITS_GRANT_ABILITY</ModifierType>
<Permanent>true</Permanent>
</Row>

into the <Modifiers>.

But still, the game doesn't react to it.


Code:
<?xml version="1.0" encoding="utf-8"?>
<GameInfo>
   <Types>
        <Row Type="ABILITY_STACHE_MILITIA" Kind="KIND_ABILITY"/>
    </Types>
    <TypeTags>
        <Row Type="ABILITY_STACHE_MILITIA" Tag="CLASS_MELEE"/>
       <Row Type="ABILITY_STACHE_MILITIA" Tag="CLASS_RANGED"/>
       <Row Type="ABILITY_STACHE_MILITIA" Tag="CLASS_RECON"/>
       <Row Type="ABILITY_STACHE_MILITIA" Tag="CLASS_HEAVY_CAVALRY"/>
       <Row Type="ABILITY_STACHE_MILITIA" Tag="CLASS_LIGHT_CAVALRY"/>
       <Row Type="ABILITY_STACHE_MILITIA" Tag="CLASS_RANGED_CAVALRY"/>
       <Row Type="ABILITY_STACHE_MILITIA" Tag="CLASS_ANTI_CAVALRY"/>
       <Row Type="ABILITY_STACHE_MILITIA" Tag="CLASS_NAVAL_RANGED"/>
       <Row Type="ABILITY_STACHE_MILITIA" Tag="CLASS_NAVAL_MELEE"/>
       <Row Type="ABILITY_STACHE_MILITIA" Tag="CLASS_HEAVY_CHARIOT"/>
    </TypeTags>
   <UnitAbilities>
       <Row UnitAbilityType="ABILITY_STACHE_MILITIA" Name="LOC_ABILITY_STACHE_MILITIA" Description="LOC_ABILITY_STACHE_MILITIA" Inactive="true"/>
   </UnitAbilities>
    <UnitAbilityModifiers>
        <Row>
            <UnitAbilityType>ABILITY_STACHE_MILITIA</UnitAbilityType>
            <ModifierId>STACHE_MILITIA_ADJUST_IN_TERRITORY_COMBAT</ModifierId>
        </Row>
    </UnitAbilityModifiers>
    <Modifiers>
       <Row>
           <ModifierId>STACHE_MILITIA_ADJUST_IN_TERRITORY_COMBAT</ModifierId>
           <ModifierType>MODIFIER_PLAYER_UNITS_GRANT_ABILITY</ModifierType>
           <Permanent>true</Permanent>
       </Row>
        <Row>
            <ModifierId>STACHE_MILITIA_ADJUST_IN_TERRITORY_COMBAT</ModifierId>
            <ModifierType>MODIFIER_UNIT_ADJUST_COMBAT_STRENGTH</ModifierType>
            <SubjectRequirementSetId>REQUIREMENTS_UNITS_IN_OWNER_TERRITORY</SubjectRequirementSetId>
        </Row>
    </Modifiers>
    <ModifierArguments>
        <Row>
            <ModifierId>STACHE_MILITIA_ADJUST_IN_TERRITORY_COMBAT</ModifierId>
            <Name>Amount</Name>
            <Value>10</Value>
        </Row>
       <Row>
           <ModifierId>STACHE_MILITIA_ADJUST_IN_TERRITORY_COMBAT</ModifierId>
           <Name>AbilityType</Name>
           <Value>ABILITY_STACHE_MILITIA</Value>
       </Row>
    </ModifierArguments>
    <RequirementSets>
        <Row>
            <RequirementSetId>REQUIREMENTS_UNITS_IN_OWNER_TERRITORY</RequirementSetId>
            <RequirementSetType>REQUIREMENTSET_TEST_ANY</RequirementSetType>
        </Row>
    </RequirementSets>
    <RequirementSetRequirements>
        <Row>
            <RequirementSetId>REQUIREMENTS_UNITS_IN_OWNER_TERRITORY</RequirementSetId>
            <RequirementId>UNIT_IN_OWNER_TERRITORY_REQUIREMENT_STACHE_MILITIA</RequirementId>
        </Row>
    </RequirementSetRequirements>
    <Requirements>
        <Row>
            <RequirementId>UNIT_IN_OWNER_TERRITORY_REQUIREMENT_STACHE_MILITIA</RequirementId>
            <RequirementType>REQUIREMENT_UNIT_IN_OWNER_TERRITORY</RequirementType>
        </Row>
    </Requirements>
</GameInfo>
 
Don´t forget to change this:
Code:
<Row TraitType="TRAIT_CIVILIZATION_STACHE_THALVARIA" ModifierId="ABILITY_STACHE_MILITIA"/>

You have to create a new modifier where you add the grant and the ability type (I said to you and all related modifiers and requirements :p). In other words you have to have a new set of these just for the new ability for the civ (trait):
Code:
<Modifiers>
      <Row>
           <ModifierId>STACHE_NEW CIV_ABILITY</ModifierId>
           <ModifierType>MODIFIER_PLAYER_UNITS_GRANT_ABILITY</ModifierType>
           <Permanent>true</Permanent>
       </Row>
   </Modifiers>
   <ModifierArguments>
       <Row>
           <ModifierId>STACHE_NEW CIV_ABILITY</ModifierId>
           <Name>AbilityType</Name>
           <Value>ABILITY_STACHE_MILITIA</Value>
       </Row>
   </ModifierArguments>
   <TraitModifiers>
       <Row TraitType="TRAIT_CIVILIZATION_STACHE_THALVARIA" ModifierId="STACHE_NEW CIV_ABILITY"/>
   </TraitModifiers>
 
Thanks! The game is reacting to my code now, although not positively.
I inserted your code, but with,
<Row TraitType="TRAIT_CIVILIZATION_STACHE_THALVARIA" ModifierId="ABILITY_STACHE_MILITIA"/>,
the Database.log said that the ModifierId "ABILITY_STACHE_MILITIA" was not defined in <modifiers>
So I referenced the other ModifierId instead.

Now it's back to not reacting:

Code:
<?xml version="1.0" encoding="utf-8"?>
<GameInfo>
   <Types>
        <Row Type="ABILITY_STACHE_MILITIA" Kind="KIND_ABILITY"/>
    </Types>
    <TypeTags>
        <Row Type="ABILITY_STACHE_MILITIA" Tag="CLASS_MELEE"/>
       <Row Type="ABILITY_STACHE_MILITIA" Tag="CLASS_RANGED"/>
       <Row Type="ABILITY_STACHE_MILITIA" Tag="CLASS_RECON"/>
       <Row Type="ABILITY_STACHE_MILITIA" Tag="CLASS_HEAVY_CAVALRY"/>
       <Row Type="ABILITY_STACHE_MILITIA" Tag="CLASS_LIGHT_CAVALRY"/>
       <Row Type="ABILITY_STACHE_MILITIA" Tag="CLASS_RANGED_CAVALRY"/>
       <Row Type="ABILITY_STACHE_MILITIA" Tag="CLASS_ANTI_CAVALRY"/>
       <Row Type="ABILITY_STACHE_MILITIA" Tag="CLASS_NAVAL_RANGED"/>
       <Row Type="ABILITY_STACHE_MILITIA" Tag="CLASS_NAVAL_MELEE"/>
       <Row Type="ABILITY_STACHE_MILITIA" Tag="CLASS_HEAVY_CHARIOT"/>
    </TypeTags>
   <UnitAbilities>
       <Row UnitAbilityType="ABILITY_STACHE_MILITIA" Name="LOC_ABILITY_STACHE_MILITIA" Description="LOC_ABILITY_STACHE_MILITIA" Inactive="true"/>
   </UnitAbilities>
    <UnitAbilityModifiers>
        <Row>
            <UnitAbilityType>ABILITY_STACHE_MILITIA</UnitAbilityType>
            <ModifierId>STACHE_MILITIA_ADJUST_IN_TERRITORY_COMBAT</ModifierId>
        </Row>
    </UnitAbilityModifiers>
    <Modifiers>
       <Row>
           <ModifierId>STACHE_MILITIA_GRANTING</ModifierId>
           <ModifierType>MODIFIER_PLAYER_UNITS_GRANT_ABILITY</ModifierType>
           <Permanent>true</Permanent>
       </Row>
        <Row>
            <ModifierId>STACHE_MILITIA_ADJUST_IN_TERRITORY_COMBAT</ModifierId>
            <ModifierType>MODIFIER_UNIT_ADJUST_COMBAT_STRENGTH</ModifierType>
            <SubjectRequirementSetId>REQUIREMENTS_UNITS_IN_OWNER_TERRITORY</SubjectRequirementSetId>
        </Row>
    </Modifiers>
    <ModifierArguments>
        <Row>
            <ModifierId>STACHE_MILITIA_ADJUST_IN_TERRITORY_COMBAT</ModifierId>
            <Name>Amount</Name>
            <Value>10</Value>
        </Row>
       <Row>
           <ModifierId>STACHE_MILITIA_GRANTING</ModifierId>
           <Name>AbilityType</Name>
           <Value>ABILITY_STACHE_MILITIA</Value>
       </Row>
    </ModifierArguments>
    <RequirementSets>
        <Row>
            <RequirementSetId>REQUIREMENTS_UNITS_IN_OWNER_TERRITORY</RequirementSetId>
            <RequirementSetType>REQUIREMENTSET_TEST_ANY</RequirementSetType>
        </Row>
    </RequirementSets>
    <RequirementSetRequirements>
        <Row>
            <RequirementSetId>REQUIREMENTS_UNITS_IN_OWNER_TERRITORY</RequirementSetId>
            <RequirementId>UNIT_IN_OWNER_TERRITORY_REQUIREMENT_STACHE_MILITIA</RequirementId>
        </Row>
    </RequirementSetRequirements>
    <Requirements>
        <Row>
            <RequirementId>UNIT_IN_OWNER_TERRITORY_REQUIREMENT_STACHE_MILITIA</RequirementId>
            <RequirementType>REQUIREMENT_UNIT_IN_OWNER_TERRITORY</RequirementType>
        </Row>
    </Requirements>
   <TraitModifiers>
       <Row TraitType="TRAIT_CIVILIZATION_STACHE_THALVARIA" ModifierId="STACHE_MILITIA_GRANTING"/>
       <Row TraitType="TRAIT_CIVILIZATION_STACHE_THALVARIA" ModifierId="STACHE_MILITIA_ADJUST_IN_TERRITORY_COMBAT"/>
   </TraitModifiers>
</GameInfo>
 
Remove this:
Code:
<Row TraitType="TRAIT_CIVILIZATION_STACHE_THALVARIA" ModifierId="STACHE_MILITIA_ADJUST_IN_TERRITORY_COMBAT"/>

You have already a new modifier that you called STACHE_MILITIA_GRANTING, that you are grating, and defining what ability to grant.
 
So you mean:

Code:
<?xml version="1.0" encoding="utf-8"?>
<GameInfo>
   <Types>
        <Row Type="ABILITY_STACHE_MILITIA" Kind="KIND_ABILITY"/>
    </Types>
    <TypeTags>
        <Row Type="ABILITY_STACHE_MILITIA" Tag="CLASS_MELEE"/>
       <Row Type="ABILITY_STACHE_MILITIA" Tag="CLASS_RANGED"/>
       <Row Type="ABILITY_STACHE_MILITIA" Tag="CLASS_RECON"/>
       <Row Type="ABILITY_STACHE_MILITIA" Tag="CLASS_HEAVY_CAVALRY"/>
       <Row Type="ABILITY_STACHE_MILITIA" Tag="CLASS_LIGHT_CAVALRY"/>
       <Row Type="ABILITY_STACHE_MILITIA" Tag="CLASS_RANGED_CAVALRY"/>
       <Row Type="ABILITY_STACHE_MILITIA" Tag="CLASS_ANTI_CAVALRY"/>
       <Row Type="ABILITY_STACHE_MILITIA" Tag="CLASS_NAVAL_RANGED"/>
       <Row Type="ABILITY_STACHE_MILITIA" Tag="CLASS_NAVAL_MELEE"/>
       <Row Type="ABILITY_STACHE_MILITIA" Tag="CLASS_HEAVY_CHARIOT"/>
    </TypeTags>
   <UnitAbilities>
       <Row UnitAbilityType="ABILITY_STACHE_MILITIA" Name="LOC_ABILITY_STACHE_MILITIA" Description="LOC_ABILITY_STACHE_MILITIA" Inactive="true"/>
   </UnitAbilities>
    <UnitAbilityModifiers>
        <Row>
            <UnitAbilityType>ABILITY_STACHE_MILITIA</UnitAbilityType>
            <ModifierId>STACHE_MILITIA_ADJUST_IN_TERRITORY_COMBAT</ModifierId>
        </Row>
    </UnitAbilityModifiers>
    <Modifiers>
       <Row>
           <ModifierId>STACHE_MILITIA_GRANTING</ModifierId>
           <ModifierType>MODIFIER_PLAYER_UNITS_GRANT_ABILITY</ModifierType>
           <Permanent>true</Permanent>
       </Row>
        <Row>
            <ModifierId>STACHE_MILITIA_ADJUST_IN_TERRITORY_COMBAT</ModifierId>
            <ModifierType>MODIFIER_UNIT_ADJUST_COMBAT_STRENGTH</ModifierType>
            <SubjectRequirementSetId>REQUIREMENTS_UNITS_IN_OWNER_TERRITORY</SubjectRequirementSetId>
        </Row>
    </Modifiers>
    <ModifierArguments>
        <Row>
            <ModifierId>STACHE_MILITIA_ADJUST_IN_TERRITORY_COMBAT</ModifierId>
            <Name>Amount</Name>
            <Value>10</Value>
        </Row>
       <Row>
           <ModifierId>STACHE_MILITIA_GRANTING</ModifierId>
           <Name>AbilityType</Name>
           <Value>ABILITY_STACHE_MILITIA</Value>
       </Row>
    </ModifierArguments>
    <RequirementSets>
        <Row>
            <RequirementSetId>REQUIREMENTS_UNITS_IN_OWNER_TERRITORY</RequirementSetId>
            <RequirementSetType>REQUIREMENTSET_TEST_ANY</RequirementSetType>
        </Row>
    </RequirementSets>
    <RequirementSetRequirements>
        <Row>
            <RequirementSetId>REQUIREMENTS_UNITS_IN_OWNER_TERRITORY</RequirementSetId>
            <RequirementId>UNIT_IN_OWNER_TERRITORY_REQUIREMENT_STACHE_MILITIA</RequirementId>
        </Row>
    </RequirementSetRequirements>
    <Requirements>
        <Row>
            <RequirementId>UNIT_IN_OWNER_TERRITORY_REQUIREMENT_STACHE_MILITIA</RequirementId>
            <RequirementType>REQUIREMENT_UNIT_IN_OWNER_TERRITORY</RequirementType>
        </Row>
    </Requirements>
   <TraitModifiers>
       <Row TraitType="TRAIT_CIVILIZATION_STACHE_THALVARIA" ModifierId="STACHE_MILITIA_GRANTING"/>
   </TraitModifiers>
</GameInfo>

The code still doesn't react.

I am sorry if this is tedious.
 
Tried it, no change.
There is no error in the Database.log.
(exept that one: "[Gameplay] ERROR: no such table: main.MomentIllustrations" But I got that one since way before this, and it doesn't affect it)

Thanks for your help raen!
Now the code is much clearer, and I start to get the hang of it.


Current Code:
Code:
<?xml version="1.0" encoding="utf-8"?>
<GameInfo>
   <Types>
        <Row Type="ABILITY_STACHE_MILITIA" Kind="KIND_ABILITY"/>
    </Types>
    <TypeTags>
        <Row Type="ABILITY_STACHE_MILITIA" Tag="CLASS_MELEE"/>
       <Row Type="ABILITY_STACHE_MILITIA" Tag="CLASS_RANGED"/>
       <Row Type="ABILITY_STACHE_MILITIA" Tag="CLASS_RECON"/>
       <Row Type="ABILITY_STACHE_MILITIA" Tag="CLASS_HEAVY_CAVALRY"/>
       <Row Type="ABILITY_STACHE_MILITIA" Tag="CLASS_LIGHT_CAVALRY"/>
       <Row Type="ABILITY_STACHE_MILITIA" Tag="CLASS_RANGED_CAVALRY"/>
       <Row Type="ABILITY_STACHE_MILITIA" Tag="CLASS_ANTI_CAVALRY"/>
       <Row Type="ABILITY_STACHE_MILITIA" Tag="CLASS_NAVAL_RANGED"/>
       <Row Type="ABILITY_STACHE_MILITIA" Tag="CLASS_NAVAL_MELEE"/>
       <Row Type="ABILITY_STACHE_MILITIA" Tag="CLASS_HEAVY_CHARIOT"/>
    </TypeTags>
   <UnitAbilities>
       <Row UnitAbilityType="ABILITY_STACHE_MILITIA" Name="LOC_ABILITY_STACHE_MILITIA" Description="LOC_ABILITY_STACHE_MILITIA" Inactive="true"/>
   </UnitAbilities>
    <UnitAbilityModifiers>
        <Row>
            <UnitAbilityType>ABILITY_STACHE_MILITIA</UnitAbilityType>
            <ModifierId>STACHE_MILITIA_ADJUST_IN_TERRITORY_COMBAT</ModifierId>
        </Row>
    </UnitAbilityModifiers>
    <Modifiers>
       <Row>
           <ModifierId>STACHE_MILITIA_GRANTING</ModifierId>
           <ModifierType>MODIFIER_PLAYER_UNITS_GRANT_ABILITY</ModifierType>
           <Permanent>true</Permanent>
       </Row>
        <Row>
            <ModifierId>STACHE_MILITIA_ADJUST_IN_TERRITORY_COMBAT</ModifierId>
            <ModifierType>MODIFIER_UNIT_ADJUST_COMBAT_STRENGTH</ModifierType>
            <SubjectRequirementSetId>REQUIREMENTS_UNITS_IN_OWNER_TERRITORY</SubjectRequirementSetId>
        </Row>
    </Modifiers>
    <ModifierArguments>
        <Row>
            <ModifierId>STACHE_MILITIA_ADJUST_IN_TERRITORY_COMBAT</ModifierId>
            <Name>Amount</Name>
            <Value>10</Value>
        </Row>
       <Row>
           <ModifierId>STACHE_MILITIA_GRANTING</ModifierId>
           <Name>AbilityType</Name>
           <Value>ABILITY_STACHE_MILITIA</Value>
       </Row>
    </ModifierArguments>
    <RequirementSets>
        <Row>
            <RequirementSetId>REQUIREMENTS_UNITS_IN_OWNER_TERRITORY</RequirementSetId>
            <RequirementSetType>REQUIREMENTSET_TEST_ALL</RequirementSetType>
        </Row>
    </RequirementSets>
    <RequirementSetRequirements>
        <Row>
            <RequirementSetId>REQUIREMENTS_UNITS_IN_OWNER_TERRITORY</RequirementSetId>
            <RequirementId>UNIT_IN_OWNER_TERRITORY_REQUIREMENT_STACHE_MILITIA</RequirementId>
        </Row>
    </RequirementSetRequirements>
    <Requirements>
        <Row>
            <RequirementId>UNIT_IN_OWNER_TERRITORY_REQUIREMENT_STACHE_MILITIA</RequirementId>
            <RequirementType>REQUIREMENT_UNIT_IN_OWNER_TERRITORY</RequirementType>
        </Row>
    </Requirements>
   <TraitModifiers>
       <Row TraitType="TRAIT_CIVILIZATION_STACHE_THALVARIA" ModifierId="STACHE_MILITIA_GRANTING"/>
   </TraitModifiers>
</GameInfo>
 
Last edited:
Back
Top Bottom