A civ I'm making is supposed to have a custom ability, however when I load a new game it puts me back into the menu.
This is the section I want to add
This results in this from the database.log file
As an experiment, I switched TraitModifiers and Modifiers in the code (meaning that Modifiers instead came before TraitModifiers). This broke the mod in another way instead, I was able to start a game, but my civ suddenly didn't have any leader traits or civ traits or UUs at all (the game text was visible when picking the leader and civ, but not when the game started to load)
This is the section I want to add
Code:
--------------------------------------------------------------------------------------------------------------------------
-- TraitModifiers
--------------------------------------------------------------------------------------------------------------------------
INSERT INTO TraitModifiers
(TraitType, ModifierId)
VALUES ('TRAIT_CIVILIZATION_ZOB_SWEDEN_TRAIT', 'ZOB_SWEDEN_TRAIT_GRASS_HILLS_PRODUCTION');
--------------------------------------------------------------------------------------------------------------------------
-- Modifiers
--------------------------------------------------------------------------------------------------------------------------
INSERT INTO Modifiers
(ModifierId, ModifierType SubjectRequirementSetId)
VALUES ('ZOB_SWEDEN_TRAIT_GRASS_HILLS_PRODUCTION', 'MODIFIER_PLAYER_ADJUST_PLOT_YIELD', 'ZOB_PRODUCTION_PLOT_HAS_GRASS_HILLS_REQUIREMENT');
--------------------------------------------------------------------------------------------------------------------------
-- ModifierArguments
--------------------------------------------------------------------------------------------------------------------------
INSERT INTO ModifierArguments
(ModifierId, Name, Value)
VALUES ('ZOB_SWEDEN_TRAIT_GRASS_HILLS_PRODUCTION', 'YieldType', 'YIELD_PRODUCTION'),
('ZOB_SWEDEN_TRAIT_GRASS_HILLS_PRODUCTION', 'Amount', '2');
--------------------------------------------------------------------------------------------------------------------------
-- Requirements
--------------------------------------------------------------------------------------------------------------------------
INSERT INTO Requirements
(RequirementId, RequirementType)
VALUES ('REQUIRES_PLOT_HAS_ZOB_GRASS_HILLS', 'REQUIREMENT_PLOT_TERRAIN_TYPE_MATCHES');
--------------------------------------------------------------------------------------------------------------------------
-- RequirementArguments
--------------------------------------------------------------------------------------------------------------------------
INSERT INTO RequirementArguments
(RequirementId, Name, Value)
VALUES ('REQUIRES_PLOT_HAS_ZOB_GRASS_HILLS', 'TerrainType', 'TERRAIN_GRASS_HILLS');
--------------------------------------------------------------------------------------------------------------------------
-- RequirementSets
--------------------------------------------------------------------------------------------------------------------------
INSERT INTO RequirementSets
(RequirementSetId, RequirementSetType)
VALUES ('ZOB_PRODUCTION_PLOT_HAS_GRASS_HILLS_REQUIREMENT', 'REQUIREMENTSET_TEST_ALL');
--------------------------------------------------------------------------------------------------------------------------
-- RequirementSetRequirements
--------------------------------------------------------------------------------------------------------------------------
INSERT INTO RequirementSetRequirements
(RequirementSetId, RequirementId)
VALUES ('ZOB_PRODUCTION_PLOT_HAS_GRASS_HILLS_REQUIREMENT', 'REQUIRES_PLOT_HAS_ZOB_GRASS_HILLS');
This results in this from the database.log file
Code:
[3748379.566] [Gameplay] ERROR: near "SubjectRequirementSetId": syntax error
[3748379.569] [Gameplay] ERROR: FOREIGN KEY constraint failed
[3748379.569] [Gameplay] ERROR: FOREIGN KEY constraint failed
[3748379.569] [Gameplay]: Validating Foreign Key Constraints...
[3748379.581] [Gameplay] ERROR: Invalid Reference on TraitModifiers.ModifierId - "ZOB_SWEDEN_TRAIT_GRASS_HILLS_PRODUCTION" does not exist in Modifiers
[3748379.584] [Gameplay]: Failed Validation.
As an experiment, I switched TraitModifiers and Modifiers in the code (meaning that Modifiers instead came before TraitModifiers). This broke the mod in another way instead, I was able to start a game, but my civ suddenly didn't have any leader traits or civ traits or UUs at all (the game text was visible when picking the leader and civ, but not when the game started to load)