changing plot yield does not realise

AmekiKyou

Chieftain
Joined
Apr 28, 2017
Messages
11
Location
Japan
Hey, guys. I am still in trouble with my Alice MOD.

My leader, Alice, is equipped with 2 abilities:

1. Add +1 gold and +1 faith to forest tiles. ('Grimoire of Alice')
2. Add +1 production to lumber mills. (a part of 'Handling doll')

For there is no exact modifier defining forest tile and lumber mill in the original files, I wrote the requirement sets. However this does not work, although the mod can run smoothly.

Here is my code (about the modifiers):
Code:
    <LeaderTraits>
        <Row LeaderType="LEADER_ALICE" TraitType="TRAIT_LEADER_GRIMOIRE_OF_ALICE"/>
        <Row LeaderType="LEADER_ALICE" TraitType="TRAIT_LEADER_HANDLING_DOLLS"/>
    </LeaderTraits>
    <LeaderQuotes>
        <Row LeaderType="LEADER_ALICE" Quote="LOC_LEADER_ALICE_QUOTE"/>
    </LeaderQuotes>
    <Traits>
        <Row TraitType="TRAIT_LEADER_GRIMOIRE_OF_ALICE" Name="LOC_TRAIT_LEADER_GRIMOIRE_OF_ALICE_NAME" Description="LOC_TRAIT_LEADER_GRIMOIRE_OF_ALICE_DESCRIPTION"/>
        <Row TraitType="TRAIT_LEADER_HANDLING_DOLLS" Name="LOC_LEADER_HANDLING_DOLLS_NAME" Description="LOC_LEADER_HANDLING_DOLLS_DESCRIPTION"/>
        <Row TraitType="TRAIT_AGENDA_SOLITARY" Name="LOC_AGENDA_SOLITARY_NAME" Description="LOC_AGENDA_SOLITARY_DESCRIPTION"/>
    </Traits>
    <TraitModifiers>
        <!--GRIMOIRE OF ALICE-->
        <Row>
            <TraitType>TRAIT_LEADER_GRIMOIRE_OF_ALICE</TraitType>
            <ModifierId>ALICE_FOREST_GOLD</ModifierId>
        </Row>
        <Row>
            <TraitType>TRAIT_LEADER_GRIMOIRE_OF_ALICE</TraitType>
            <ModifierId>ALICE_FOREST_FAITH</ModifierId>
        </Row>
        
        <!--HANDLING DOLLS-->
        <Row>
            <TraitType>TRAIT_LEADER_HANDLING_DOLLS</TraitType>
            <ModifierId>ALICE_LUMBER_MILL_PRODUCTION</ModifierId>
        </Row>
        <Row>
            <TraitType>TRAIT_LEADER_HANDLING_DOLLS</TraitType>
            <ModifierId>ALICE_WORKER_EXTRA_TIME</ModifierId>
        </Row>
        <Row>
            <TraitType>TRAIT_LEADER_HANDLING_DOLLS</TraitType>
            <ModifierId>ALICE_WORKER_DISTRICT_ACCELERATION</ModifierId>
        </Row>
    </TraitModifiers>
    <Modifiers>
        <!--GRIMOIRE OF ALICE-->
        <Row>
            <ModifierId>ALICE_FOREST_GOLD</ModifierId>
            <ModifierType>MODIFIER_CITY_PLOT_YIELDS_ADJUST_PLOT_YIELD</ModifierType>
            <SubjectRequirementSetId>TERRAIN_IS_ALICE_FOREST</SubjectRequirementSetId>
        </Row>
        <Row>
            <ModifierId>ALICE_FOREST_FAITH</ModifierId>
            <ModifierType>MODIFIER_CITY_PLOT_YIELDS_ADJUST_PLOT_YIELD</ModifierType>
            <SubjectRequirementSetId>TERRAIN_IS_ALICE_FOREST</SubjectRequirementSetId>
        </Row>
        
        <!--HANDLING DOLLS-->
        <Row>
            <ModifierId>ALICE_LUMBER_MILL_PRODUCTION</ModifierId>
            <ModifierType>REQUIREMENT_PLOT_IMPROVEMENT_TYPE_MATCHES</ModifierType>
            <SubjectRequirementSetId>REQUIRES_PLOT_HAS_LUMBER_MILL_SET</SubjectRequirementSetId>
        </Row>
        <Row>
            <ModifierId>ALICE_WORKER_EXTRA_TIME</ModifierId>
            <ModifierType>MODIFIER_PLAYER_UNITS_ADJUST_BUILDER_CHARGES</ModifierType>
            <SubjectRequirementSetId>UNIT_IS_BUILDER</SubjectRequirementSetId>
        </Row>
        <Row>
            <ModifierId>ALICE_WORKER_DISTRICT_ACCELERATION</ModifierId>
            <ModifierType>MODIFIER_PLAYER_ADJUST_UNIT_DISTRICT_PERCENT</ModifierType>
        </Row>
    </Modifiers>
    <ModifierArguments>
        <!--GRIMORE OF ALICE-->
        <Row>
            <ModifierId>ALICE_FOREST_GOLD</ModifierId>
            <Name>Amount</Name>
            <Value>1</Value>
        </Row>
        <Row>
            <ModifierId>ALICE_FOREST_GOLD</ModifierId>
            <Name>YieldType</Name>
            <Value>YIELD_GOLD</Value>
        </Row>
        <Row>
            <ModifierId>ALICE_FOREST_FAITH</ModifierId>
            <Name>Amount</Name>
            <Value>1</Value>
        </Row>
        <Row>
            <ModifierId>ALICE_FOREST_FAITH</ModifierId>
            <Name>YieldType</Name>
            <Value>YIELD_FAITH</Value>
        </Row>

        <!--HANDLING DOLLS-->
        <Row>
            <ModifierId>ALICE_LUMBER_MILL_PRODUCTION</ModifierId>
            <Name>Amount</Name>
            <Value>1</Value>
        </Row>
        <Row>
            <ModifierId>ALICE_LUMBER_MILL_PRODUCTION</ModifierId>
            <Name>YieldType</Name>
            <Value>YIELD_PRODUCTION</Value>
        </Row>
        <Row>
            <ModifierId>ALICE_WORKER_EXTRA_TIME</ModifierId>
            <Name>Amount</Name>
            <Value>2</Value>
        </Row>
        <Row>
            <ModifierId>ALICE_WORKER_DISTRICT_ACCELERATION</ModifierId>
            <Name>Amount</Name>
            <Value>25</Value>
        </Row>
    </ModifierArguments>
    <RequirementSets>
        <Row>
            <RequirementSetId>TERRAIN_IS_ALICE_FOREST</RequirementSetId>
            <RequirementSetType>REQUIREMENTSET_TEST_ALL</RequirementSetType>
        </Row>
        <Row>
            <RequirementSetId>REQUIRES_PLOT_HAS_LUMBER_MILL_SET</RequirementSetId>
            <RequirementSetType>REQUIREMENTSET_TEST_ALL</RequirementSetType>
        </Row>
    </RequirementSets>
    <RequirementSetRequirements>
        <Row>
            <RequirementSetId>TERRAIN_IS_ALICE_FOREST</RequirementSetId>
            <RequirementId>PLOT_IS_FOREST_REQUIREMENT</RequirementId>
        </Row>
        <Row>
            <RequirementSetId>REQUIRES_PLOT_HAS_LUMBER_MILL_SET</RequirementSetId>
            <RequirementId>REQUIRES_PLOT_HAS_LUMBER_MILL</RequirementId>
        </Row>
    </RequirementSetRequirements>
    <Requirements>
        <Row>
            <RequirementId>ALICE_PLOT_IS_FOREST_REQUIREMENT</RequirementId>
            <RequirementType>REQUIREMENT_PLOT_FEATURE_TYPE_MATCHES</RequirementType>
        </Row>
        <Row>
            <RequirementId>REQUIRES_PLOT_HAS_LUMBER_MILL</RequirementId>
            <RequirementType>REQUIREMENT_PLOT_IMPROVEMENT_TYPE_MATCHES</RequirementType>
        </Row>
    </Requirements>
    <RequirementArguments>
        <Row>
            <RequirementId>ALICE_PLOT_IS_FOREST_REQUIREMENT</RequirementId>
            <Name>FeatureType</Name>
            <Value>FEATURE_FOREST</Value>
        </Row>
        <Row>
            <RequirementId>REQUIRES_PLOT_HAS_LUMBER_MILL</RequirementId>
            <Name>ImprovementType</Name>
            <Value>IMPROVEMENT_LUMBER_MILL</Value>
        </Row>
    </RequirementArguments>

I don't know what is wrong with the mod. Can anyone help me with this?

The full Leader.XML is posted here.
 

Attachments

I'm not sure if you can use modifier_city_plot_yields with Trait. Owner of Trait modifier is player, so you should use modifier types that start with modifier_player_xxx. If you want to use modifier_city_xxx you most likely need a 2-step approach. Trait modifier must attach a city modifier to all player's cities. And then the city modifier can modify yields, just like you did.
 
Mismatch:

PLOT_IS_FOREST_REQUIREMENT
ALICE_PLOT_IS_FOREST_REQUIREMENT

Hi LeeS, Thanks for your reply. I rewrote the mismatched item, but the effect still does not occur.
There should be some more problem in here.
 
I'm not sure if you can use modifier_city_plot_yields with Trait. Owner of Trait modifier is player, so you should use modifier types that start with modifier_player_xxx. If you want to use modifier_city_xxx you most likely need a 2-step approach. Trait modifier must attach a city modifier to all player's cities. And then the city modifier can modify yields, just like you did.

Eh... I don't know how to attach the trait modifier to city modifier? Can you show me an example? Thanks.
 
I don't have access to my computer as of now, so I can't provide an example. But look for Trait modifiers that use modifier type (defined in DynamicModifiers) with effect Attach_Modifier. This modifier will have in its arguments a modifier that will be attached and actually working. This may seem complicated at first, but it's really worth understanding because it's a very powerful and flexible mechanism especially when you combine it with requirements. You can attach specific modifiers to objects that meet specific criteria.
I'll be able to give you more details in a few days when I'm back home, if you don't solve it until then.
 
I don't have access to my computer as of now, so I can't provide an example. But look for Trait modifiers that use modifier type (defined in DynamicModifiers) with effect Attach_Modifier. This modifier will have in its arguments a modifier that will be attached and actually working. This may seem complicated at first, but it's really worth understanding because it's a very powerful and flexible mechanism especially when you combine it with requirements. You can attach specific modifiers to objects that meet specific criteria.
I'll be able to give you more details in a few days when I'm back home, if you don't solve it until then.
Thanks!
 
Back
Top Bottom