EDIT: assume that Civtraits and TraitModifiers are already initialised
Hello everyone,
I'm trying to have a requirement on a civ trait for a custom civ of mine. I'm having trouble with the requirements. I've tested the code below and the problem only arises when I try to include any form of requirements
INSERT INTO Modifiers
(ModifierId, ModifierType, RunOnce, Permanent, SubjectRequirementSetId )
VALUES
('MODIFIER_AETERNUM_IMPERIUM_BUILDING_EXTRA_PRODUCTION', 'MODIFIER_PLAYER_CITIES_ADJUST_CITY_YIELD_MODIFIER', 0, 1, 'KETTONIA_GRANARY_AND_MONUMENT');
INSERT INTO ModifierArguments
(ModifierId, Name, Value )
VALUES
('MODIFIER_AETERNUM_IMPERIUM_BUILDING_EXTRA_PRODUCTION', 'YieldType', 'YIELD_PRODUCTION' ),
('MODIFIER_AETERNUM_IMPERIUM_BUILDING_EXTRA_PRODUCTION', 'Amount', '20' ),
INSERT INTO RequirementSets
(RequirementSetId, RequirementSetType )
VALUES
('KETTONIA_GRANARY_AND_MONUMENT', 'REQUIREMENT_TEST_ALL' );
INSERT INTO RequirementSetRequirements
(RequirementSetId, RequirementId )
VALUES
('KETTONIA_GRANARY_AND_MONUMENT', 'KETTONIA_GRANARY_AND_MONUMENT_REQUIREMENT');
INSERT INTO Requirements
(RequirementId, RequirementType )
VALUES
('KETTONIA_GRANARY_AND_MONUMENT_REQUIREMENT', 'REQUIREMENT_CITY_HAS_BUILDING' ),
('KETTONIA_GRANARY_AND_MONUMENT_REQUIREMENT', 'REQUIREMENT_CITY_HAS_BUILDING' );
INSERT INTO RequirementArguments
(RequirementId, Name, Value )
VALUES
('KETTONIA_GRANARY_AND_MONUMENT_REQUIREMENT', 'BuildingType', 'BUILDING_GRANARY' ),
('KETTONIA_GRANARY_AND_MONUMENT_REQUIREMENT', 'BuildingType', 'BUILDING_MONUMENT' );
What I want to happen is that player cities with both a granary and monument get +20% production. As I said earlier, the modifiers themselves work, its only when the requirements start getting involved that I cannot load. Below is the most recent log
[1660144.584] [Localization]: StartupErrorMessages.xml
[1660144.584] [Localization]: Input XML does not contain database entry tags. GameData, GameInfo or Database
[1660155.655] [Localization]: Validating Foreign Key Constraints...
[1660155.656] [Localization]: Passed Validation.
[1660155.671] [Configuration]: Validating Foreign Key Constraints...
[1660155.672] [Configuration]: Passed Validation.
[1660157.151] [FullTextSearch]: Initializing FullTextSearch
[1660158.808] [Gameplay]: Validating Foreign Key Constraints...
[1660158.819] [Gameplay]: Passed Validation.
[1660161.028] [Configuration] ERROR: FOREIGN KEY constraint failed
[1660161.029] [Configuration] ERROR: FOREIGN KEY constraint failed
[1660161.250] [Configuration]: Validating Foreign Key Constraints...
[1660161.250] [Configuration] ERROR: Invalid Reference on InputActionDefaultGestures.ActionId - "Toggle5movement" does not exist in InputActions
[1660161.250] [Configuration]: Failed Validation.
[1660161.644] [Configuration] ERROR: Failed to Backup Database.
[1660162.296] [HallofFame]: Database found. Checking versions...
[1660162.298] [HallofFame]: Database is up-to-date!
[1660176.850] [FullTextSearch]: FTS - Creating Context
[1660182.700] [Configuration] ERROR: FOREIGN KEY constraint failed
[1660182.700] [Configuration] ERROR: FOREIGN KEY constraint failed
[1660182.720] [Configuration]: Validating Foreign Key Constraints...
[1660182.720] [Configuration] ERROR: Invalid Reference on InputActionDefaultGestures.ActionId - "Toggle5movement" does not exist in InputActions
[1660182.720] [Configuration]: Failed Validation.
[1660183.101] [Configuration] ERROR: Failed to Backup Database.
[1660188.310] [Gameplay] ERROR: UNIQUE constraint failed: Requirements.RequirementId
[1660188.310] [Gameplay] ERROR: UNIQUE constraint failed: Requirements.RequirementId
[1660188.876] [Localization] ERROR: near "(": syntax error
[1660189.034] [Gameplay] ERROR: FOREIGN KEY constraint failed
[1660189.034] [Gameplay] ERROR: FOREIGN KEY constraint failed
[1660189.035] [Gameplay]: Validating Foreign Key Constraints...
[1660189.049] [Gameplay] ERROR: Invalid Reference on RequirementSetRequirements.RequirementId - "KETTONIA_GRANARY_AND_MONUMENT_REQUIREMENT" does not exist in Requirements
[1660189.057] [Gameplay]: Failed Validation.
[1660192.380] [Configuration] ERROR: FOREIGN KEY constraint failed
[1660192.380] [Configuration] ERROR: FOREIGN KEY constraint failed
[1660193.536] [Configuration]: Validating Foreign Key Constraints...
[1660193.536] [Configuration] ERROR: Invalid Reference on InputActionDefaultGestures.ActionId - "Toggle5movement" does not exist in InputActions
[1660193.536] [Configuration]: Failed Validation.
[1660194.007] [Configuration] ERROR: Failed to Backup Database.
[1660194.366] [FullTextSearch]: FTS - Creating Context
Note: I am using the cheatpanel mod to test things easily. However, it has been working well with the modifiers so I have deduced that the root problem are the requirements.
Any help would be appreciated. Thank you!
Hello everyone,
I'm trying to have a requirement on a civ trait for a custom civ of mine. I'm having trouble with the requirements. I've tested the code below and the problem only arises when I try to include any form of requirements
INSERT INTO Modifiers
(ModifierId, ModifierType, RunOnce, Permanent, SubjectRequirementSetId )
VALUES
('MODIFIER_AETERNUM_IMPERIUM_BUILDING_EXTRA_PRODUCTION', 'MODIFIER_PLAYER_CITIES_ADJUST_CITY_YIELD_MODIFIER', 0, 1, 'KETTONIA_GRANARY_AND_MONUMENT');
INSERT INTO ModifierArguments
(ModifierId, Name, Value )
VALUES
('MODIFIER_AETERNUM_IMPERIUM_BUILDING_EXTRA_PRODUCTION', 'YieldType', 'YIELD_PRODUCTION' ),
('MODIFIER_AETERNUM_IMPERIUM_BUILDING_EXTRA_PRODUCTION', 'Amount', '20' ),
INSERT INTO RequirementSets
(RequirementSetId, RequirementSetType )
VALUES
('KETTONIA_GRANARY_AND_MONUMENT', 'REQUIREMENT_TEST_ALL' );
INSERT INTO RequirementSetRequirements
(RequirementSetId, RequirementId )
VALUES
('KETTONIA_GRANARY_AND_MONUMENT', 'KETTONIA_GRANARY_AND_MONUMENT_REQUIREMENT');
INSERT INTO Requirements
(RequirementId, RequirementType )
VALUES
('KETTONIA_GRANARY_AND_MONUMENT_REQUIREMENT', 'REQUIREMENT_CITY_HAS_BUILDING' ),
('KETTONIA_GRANARY_AND_MONUMENT_REQUIREMENT', 'REQUIREMENT_CITY_HAS_BUILDING' );
INSERT INTO RequirementArguments
(RequirementId, Name, Value )
VALUES
('KETTONIA_GRANARY_AND_MONUMENT_REQUIREMENT', 'BuildingType', 'BUILDING_GRANARY' ),
('KETTONIA_GRANARY_AND_MONUMENT_REQUIREMENT', 'BuildingType', 'BUILDING_MONUMENT' );
What I want to happen is that player cities with both a granary and monument get +20% production. As I said earlier, the modifiers themselves work, its only when the requirements start getting involved that I cannot load. Below is the most recent log
[1660144.584] [Localization]: StartupErrorMessages.xml
[1660144.584] [Localization]: Input XML does not contain database entry tags. GameData, GameInfo or Database
[1660155.655] [Localization]: Validating Foreign Key Constraints...
[1660155.656] [Localization]: Passed Validation.
[1660155.671] [Configuration]: Validating Foreign Key Constraints...
[1660155.672] [Configuration]: Passed Validation.
[1660157.151] [FullTextSearch]: Initializing FullTextSearch
[1660158.808] [Gameplay]: Validating Foreign Key Constraints...
[1660158.819] [Gameplay]: Passed Validation.
[1660161.028] [Configuration] ERROR: FOREIGN KEY constraint failed
[1660161.029] [Configuration] ERROR: FOREIGN KEY constraint failed
[1660161.250] [Configuration]: Validating Foreign Key Constraints...
[1660161.250] [Configuration] ERROR: Invalid Reference on InputActionDefaultGestures.ActionId - "Toggle5movement" does not exist in InputActions
[1660161.250] [Configuration]: Failed Validation.
[1660161.644] [Configuration] ERROR: Failed to Backup Database.
[1660162.296] [HallofFame]: Database found. Checking versions...
[1660162.298] [HallofFame]: Database is up-to-date!
[1660176.850] [FullTextSearch]: FTS - Creating Context
[1660182.700] [Configuration] ERROR: FOREIGN KEY constraint failed
[1660182.700] [Configuration] ERROR: FOREIGN KEY constraint failed
[1660182.720] [Configuration]: Validating Foreign Key Constraints...
[1660182.720] [Configuration] ERROR: Invalid Reference on InputActionDefaultGestures.ActionId - "Toggle5movement" does not exist in InputActions
[1660182.720] [Configuration]: Failed Validation.
[1660183.101] [Configuration] ERROR: Failed to Backup Database.
[1660188.310] [Gameplay] ERROR: UNIQUE constraint failed: Requirements.RequirementId
[1660188.310] [Gameplay] ERROR: UNIQUE constraint failed: Requirements.RequirementId
[1660188.876] [Localization] ERROR: near "(": syntax error
[1660189.034] [Gameplay] ERROR: FOREIGN KEY constraint failed
[1660189.034] [Gameplay] ERROR: FOREIGN KEY constraint failed
[1660189.035] [Gameplay]: Validating Foreign Key Constraints...
[1660189.049] [Gameplay] ERROR: Invalid Reference on RequirementSetRequirements.RequirementId - "KETTONIA_GRANARY_AND_MONUMENT_REQUIREMENT" does not exist in Requirements
[1660189.057] [Gameplay]: Failed Validation.
[1660192.380] [Configuration] ERROR: FOREIGN KEY constraint failed
[1660192.380] [Configuration] ERROR: FOREIGN KEY constraint failed
[1660193.536] [Configuration]: Validating Foreign Key Constraints...
[1660193.536] [Configuration] ERROR: Invalid Reference on InputActionDefaultGestures.ActionId - "Toggle5movement" does not exist in InputActions
[1660193.536] [Configuration]: Failed Validation.
[1660194.007] [Configuration] ERROR: Failed to Backup Database.
[1660194.366] [FullTextSearch]: FTS - Creating Context
Note: I am using the cheatpanel mod to test things easily. However, it has been working well with the modifiers so I have deduced that the root problem are the requirements.
Any help would be appreciated. Thank you!