I'm trying to use a culture tree unlock to change the value of tea plots from 0 gold to 15 gold.
If I use a .sql file, it works, but it will also implement the increase when a town is founded. It will double up the bonus when the modifier unlocks.
If I try to implement in the .xml file, it gives all non-resources the bonus, and all resource plots no bonus. (my theory is something is wrong with the test, so the default response when testing a resource if it's TEA returns false, but if the test never even occurs it returns true - of course I can't invert the result because then all resources, not just tea, will receive the benefit).
Code is below, please help. Mainly there's some principle I'm not understanding here.
Below - works, but will also apply the bonus when a settlement is founded:
Below - applies the bonus at the appropriate time, but to all non-resource tiles (nothing special happens for tea)
If I use a .sql file, it works, but it will also implement the increase when a town is founded. It will double up the bonus when the modifier unlocks.
If I try to implement in the .xml file, it gives all non-resources the bonus, and all resource plots no bonus. (my theory is something is wrong with the test, so the default response when testing a resource if it's TEA returns false, but if the test never even occurs it returns true - of course I can't invert the result because then all resources, not just tea, will receive the benefit).
Code is below, please help. Mainly there's some principle I'm not understanding here.
Below - works, but will also apply the bonus when a settlement is founded:
Insert INTO TraitModifiers(TraitType, ModifierId) VALUES
('TRAIT_ENGLAND', 'MOD_ACT_OF_UNION_GOLD_BONUS');
Insert INTO Modifiers(ModifierId, ModifierType, SubjectRequirementSetId) VALUES
('MOD_ACT_OF_UNION_GOLD_BONUS', 'MOD_ACT_OF_UNION_GOLD_BONUS_TYPE', 'PLOT_HAS_TEA_REQS');
Insert INTO ModifierArguments(ModifierId, Name, Value) VALUES
('MOD_ACT_OF_UNION_GOLD_BONUS', 'YieldType', 'YIELD_GOLD'),
('MOD_ACT_OF_UNION_GOLD_BONUS', 'Amount','15');
Insert INTO DynamicModifiers(ModifierType, CollectionType, EffectType) VALUES
('MOD_ACT_OF_UNION_GOLD_BONUS_TYPE', 'COLLECTION_PLAYER_PLOT_YIELDS', 'EFFECT_PLOT_ADJUST_YIELD');
Insert INTO Types(Type, Kind) VALUES
('MOD_ACT_OF_UNION_GOLD_BONUS_TYPE', 'KIND_MODIFIER');
Insert INTO RequirementSetRequirements(RequirementSetId, RequirementId) VALUES
('PLOT_HAS_TEA_REQS', 'PLOT_HAS_TEA');
Insert INTO RequirementSets(RequirementSetId, RequirementSetType) VALUES
('PLOT_HAS_TEA_REQS','REQUIREMENTSET_TEST_ALL');
Insert INTO Requirements(RequirementId, RequirementType) VALUES ('PLOT_HAS_TEA', 'REQUIREMENT_PLOT_RESOURCE_TYPE_MATCHES');
Insert INTO RequirementArguments(RequirementId, Name, Value) VALUES ('PLOT_HAS_TEA', 'ResourceType', 'RESOURCE_TEA');
Below - applies the bonus at the appropriate time, but to all non-resource tiles (nothing special happens for tea)
<Modifier id="MOD_ACT_OF_UNION_GOLD_BONUS" collection="COLLECTION_PLAYER_PLOT_YIELDS" effect="EFFECT_PLOT_ADJUST_YIELD">
<SubjectRequirements>
<Requirement type="REQUIREMENT_PLOT_RESOURCE_TYPE_MATCHES" RequirementSetType="REQUIREMENTSET_TEST_ALL">
<Argument Name="ResourceType">RESOURCE_TEA</Argument>
</Requirement>
</SubjectRequirements>
<Argument name="Amount">15</Argument>
<Argument name="YieldType">YIELD_GOLD</Argument>
</Modifier>