I'm trying to add modifiers based on the number of cities a player has. This works correctly when gaining cities (as shown in game and in FireTuner):
For the modifiers, both RunOnce and Permanent are false (confirmed by FireTuner).
Here is the requirements code:
I believe the issue is with the Requirement still being marked as Met even when I have fewer cities. Is this just an issue with REQUIREMENT_PLAYER_HAS_AT_LEAST_NUMBER_CITIES? Like perhaps the game logic looks at the most cities you've ever had rather than your current number? If so, is there another way I can track number of cities?
Here's the Modifier code if that helps. I've tried adding the modifier two different ways (as TraitModifier or DistrictModifier), but they both behave the same.
- At 1 city, only the Requirement for having 1 city is marked as Met, and only the Modifier for having 1 city is applied.
- At 2 cities, the 1-city and 2-city Requirements are met, and both of their Modifiers are applied.
For the modifiers, both RunOnce and Permanent are false (confirmed by FireTuner).
Here is the requirements code:
Code:
-------------------------------------
-- Requirements
-------------------------------------
INSERT INTO Requirements (RequirementId, RequirementType) VALUES
('ZZ_REQUIRE_1_CITY', 'REQUIREMENT_PLAYER_HAS_AT_LEAST_NUMBER_CITIES'),
('ZZ_REQUIRE_2_CITY', 'REQUIREMENT_PLAYER_HAS_AT_LEAST_NUMBER_CITIES');
-------------------------------------
-- RequirementArguments
-------------------------------------
INSERT INTO RequirementArguments (RequirementId, Name, Value) VALUES
('ZZ_REQUIRE_1_CITY', 'Amount', 1),
('ZZ_REQUIRE_2_CITY', 'Amount', 2);
-------------------------------------
-- RequirementSets
-------------------------------------
INSERT INTO RequirementSets (RequirementSetId, RequirementSetType) VALUES
('ZZ_REQSET_1_CITY', 'REQUIREMENTSET_TEST_ALL'),
('ZZ_REQSET_2_CITY', 'REQUIREMENTSET_TEST_ALL');
-------------------------------------
-- RequirementSetRequirements
-------------------------------------
INSERT INTO RequirementSetRequirements (RequirementSetId, RequirementId) VALUES
('ZZ_REQSET_1_CITY', 'ZZ_REQUIRE_1_CITY'),
('ZZ_REQSET_2_CITY', 'ZZ_REQUIRE_2_CITY');
I believe the issue is with the Requirement still being marked as Met even when I have fewer cities. Is this just an issue with REQUIREMENT_PLAYER_HAS_AT_LEAST_NUMBER_CITIES? Like perhaps the game logic looks at the most cities you've ever had rather than your current number? If so, is there another way I can track number of cities?
Here's the Modifier code if that helps. I've tried adding the modifier two different ways (as TraitModifier or DistrictModifier), but they both behave the same.
Code:
-------------------------------------
-- Modifiers for Trait
-------------------------------------
INSERT INTO Modifiers (ModifierId, ModifierType, OwnerRequirementSetId) VALUES
('ZZ_MODIFIER_TRAIT_1_CITY_PROD', 'MODIFIER_PLAYER_CITIES_ADJUST_CITY_YIELD_MODIFIER', 'ZZ_REQSET_1_CITY'),
('ZZ_MODIFIER_TRAIT_2_CITY_PROD', 'MODIFIER_PLAYER_CITIES_ADJUST_CITY_YIELD_MODIFIER', 'ZZ_REQSET_2_CITY');
-------------------------------------
-- ModifierArguments
-------------------------------------
INSERT INTO ModifierArguments (ModifierId, Name, Value) VALUES
('ZZ_MODIFIER_TRAIT_1_CITY_PROD', 'YieldType', 'YIELD_PRODUCTION'),
('ZZ_MODIFIER_TRAIT_2_CITY_PROD', 'YieldType', 'YIELD_PRODUCTION');
INSERT INTO ModifierArguments (ModifierId, Name, Value) VALUES
('ZZ_MODIFIER_TRAIT_1_CITY_PROD', 'Amount', +5),
('ZZ_MODIFIER_TRAIT_2_CITY_PROD', 'Amount', +10);
-------------------------------------
-- TraitModifiers
-------------------------------------
INSERT INTO TraitModifiers (TraitType, ModifierId) VALUES
('TRAIT_LEADER_MAJOR_CIV', 'ZZ_MODIFIER_TRAIT_1_CITY_PROD'),
('TRAIT_LEADER_MAJOR_CIV', 'ZZ_MODIFIER_TRAIT_2_CITY_PROD');