Custom RequirementSets not working

RFormica

Imperator Silvae
Joined
May 27, 2017
Messages
473
Location
Pennsylvania, USA
I have made some custom RequirementSets for a City State mod, but the custom RequirementSets seem to be causing an error:
Spoiler Database.log :

4123629.458] [Localization]: Validating Foreign Key Constraints...
[4123629.458] [Localization]: Passed Validation.
[4123629.467] [Configuration]: Validating Foreign Key Constraints...
[4123629.467] [Configuration]: Passed Validation.
[4123641.974] [FullTextSearch]: Initializing FullTextSearch
[4123642.388] [Gameplay]: Validating Foreign Key Constraints...
[4123642.404] [Gameplay]: Passed Validation.
[4123644.073] [Configuration]: Validating Foreign Key Constraints...
[4123644.073] [Configuration]: Passed Validation.
[4123729.816] [FullTextSearch]: FTS - Creating Context
[4123772.374] [Configuration]: Validating Foreign Key Constraints...
[4123772.374] [Configuration]: Passed Validation.
[4123773.367] [Gameplay] ERROR: UNIQUE constraint failed: ModifierArguments.ModifierId, ModifierArguments.Name
[4123773.367] [Gameplay] ERROR: UNIQUE constraint failed: ModifierArguments.ModifierId, ModifierArguments.Name
[4123773.368] [Gameplay] ERROR: near "(": syntax error
[4123773.370] [Gameplay] ERROR: FOREIGN KEY constraint failed
[4123773.371] [Gameplay] ERROR: FOREIGN KEY constraint failed
[4123773.371] [Gameplay]: Validating Foreign Key Constraints...
[4123773.378] [Gameplay] ERROR: Invalid Reference on Modifiers.SubjectRequirementSetId - "RF_PLOT_IS_DESERT_REQUIREMENTS" does not exist in RequirementSets
[4123773.379] [Gameplay] ERROR: Invalid Reference on Modifiers.SubjectRequirementSetId - "RF_PLOT_IS_DESERT_REQUIREMENTS" does not exist in RequirementSets
[4123773.379] [Gameplay] ERROR: Invalid Reference on Modifiers.SubjectRequirementSetId - "RF_PLOT_IS_OASIS_REQUIREMENTS" does not exist in RequirementSets
[4123773.379] [Gameplay] ERROR: Invalid Reference on Modifiers.SubjectRequirementSetId - "RF_PLOT_IS_OASIS_REQUIREMENTS" does not exist in RequirementSets
[4123773.379] [Gameplay] ERROR: Invalid Reference on Modifiers.SubjectRequirementSetId - "RF_PLOT_IS_OASIS_REQUIREMENTS" does not exist in RequirementSets
[4123773.379] [Gameplay] ERROR: Invalid Reference on Modifiers.SubjectRequirementSetId - "RF_MINOR_CIV_JIAOHE_REQUIRES_HAS_ANCIENT_WALLS" does not exist in RequirementSets
[4123773.388] [Gameplay]: Failed Validation.
[4123773.428] [Gameplay]: Validating Foreign Key Constraints...
[4123773.442] [Gameplay]: Passed Validation.
[4123775.828] [FullTextSearch]: FTS - Creating Context
[4123775.988] [Configuration]: Validating Foreign Key Constraints...
[4123775.988] [Configuration]: Passed Validation.
[4123848.584] [FullTextSearch]: FullTextSearch - Shutting down

How can I fix this???

Thank you very much!
 

Attachments

First off, in RF_E_Silk_Gaochang.sql you have several syntax errors:
Code:
INSERT INTO ModifierArguments (ModifierId, Name, Value)
    VALUES
        ('RF_MINOR_CIV_GAOCHANG_UNIQUE_INFLUENCE_BONUS', 'ModifierId', 'RF_MINOR_CIV_GAOCHANG_DESERT_GOLD'),
        ('RF_MINOR_CIV_GAOCHANG_UNIQUE_INFLUENCE_BONUS', 'ModifierId', 'RF_MINOR_CIV_GAOCHANG_DESERT_FAITH'),
        ('RF_MINOR_CIV_GAOCHANG_UNIQUE_INFLUENCE_BONUS', 'ModifierId', 'RF_MINOR_CIV_GAOCHANG_OASIS_GOLD'),
        ('RF_MINOR_CIV_GAOCHANG_UNIQUE_INFLUENCE_BONUS', 'ModifierId', 'RF_MINOR_CIV_GAOCHANG_OASIS_FAITH'),
        ('RF_MINOR_CIV_GAOCHANG_UNIQUE_INFLUENCE_BONUS', 'ModifierId', 'RF_MINOR_CIV_GAOCHANG_OASIS_FOOD'),
        ('RF_MINOR_CIV_GAOCHANG_DESERT_GOLD', 'YieldType', 'YIELD_GOLD'),
        ('RF_MINOR_CIV_GAOCHANG_DESERT_GOLD', 'YieldChange', 2); <ERROR
        ('RF_MINOR_CIV_GAOCHANG_DESERT_FAITH', 'YieldType', 'YIELD_FAITH'),
        ('RF_MINOR_CIV_GAOCHANG_DESERT_FAITH', 'YieldChange', 1); <ERROR
        ('RF_MINOR_CIV_GAOCHANG_OASIS_GOLD', 'YieldType', 'YIELD_GOLD'),
        ('RF_MINOR_CIV_GAOCHANG_OASIS_GOLD', 'YieldChange', 5); <ERROR
        ('RF_MINOR_CIV_GAOCHANG_OASIS_FAITH', 'YieldType', 'YIELD_FAITH'),
        ('RF_MINOR_CIV_GAOCHANG_OASIS_FAITH', 'YieldChange', 1); <ERROR
        ('RF_MINOR_CIV_GAOCHANG_OASIS_FOOD', 'YieldType', 'YIELD_FOOD'),
        ('RF_MINOR_CIV_GAOCHANG_OASIS_FOOD', 'YieldChange', 2);
Notice all the semicolons which should be commas. I haven't checked the other files yet, but I would go through and fix those errors before further testing.
 
Second problem: your modifiers are referencing the Requirement, not the RequirementSet

Code:
('RF_MINOR_CIV_GAOCHANG_DESERT_GOLD', 'MODIFIER_PLAYER_ADJUST_PLOT_YIELD', NULL, 'RF_PLOT_IS_DESERT_REQUIREMENTS'),
        ('RF_MINOR_CIV_GAOCHANG_DESERT_FAITH', 'MODIFIER_PLAYER_ADJUST_PLOT_YIELD', NULL, 'RF_PLOT_IS_DESERT_REQUIREMENTS'),
        ('RF_MINOR_CIV_GAOCHANG_OASIS_GOLD', 'MODIFIER_PLAYER_ADJUST_PLOT_YIELD', NULL, 'RF_PLOT_IS_OASIS_REQUIREMENTS'),
        ('RF_MINOR_CIV_GAOCHANG_OASIS_FAITH', 'MODIFIER_PLAYER_ADJUST_PLOT_YIELD', NULL, 'RF_PLOT_IS_OASIS_REQUIREMENTS'),
        ('RF_MINOR_CIV_GAOCHANG_OASIS_FOOD', 'MODIFIER_PLAYER_ADJUST_PLOT_YIELD', NULL, 'RF_PLOT_IS_OASIS_REQUIREMENTS');

Your RequirementSets are
Code:
RF_PLOT_IS_DESERT_REQUIREMENTS_REQ_SET
RF_PLOT_IS_OASIS_REQUIREMENTS_REQ_SET

EDIT: you're having the same problem in RF_E_Silk_Jiaohe.sql, with your modifiers referencing your Requirements rather than your RequirementSets.

This
Code:
RF_MINOR_CIV_JIAOHE_REQUIRES_HAS_ANCIENT_WALLS
is a Requirement.

This
Code:
RF_MINOR_CIV_JIAOHE_REQUIRES_HAS_ANCIENT_WALLS_REQ_SET
is the RequirementSet the modifier should be referencing instead.
 
This is also no good
Code:
        ('RF_MINOR_CIV_GAOCHANG_UNIQUE_INFLUENCE_BONUS', 'ModifierId', 'RF_MINOR_CIV_GAOCHANG_DESERT_GOLD'),
        ('RF_MINOR_CIV_GAOCHANG_UNIQUE_INFLUENCE_BONUS', 'ModifierId', 'RF_MINOR_CIV_GAOCHANG_DESERT_FAITH'),
        ('RF_MINOR_CIV_GAOCHANG_UNIQUE_INFLUENCE_BONUS', 'ModifierId', 'RF_MINOR_CIV_GAOCHANG_OASIS_GOLD'),
        ('RF_MINOR_CIV_GAOCHANG_UNIQUE_INFLUENCE_BONUS', 'ModifierId', 'RF_MINOR_CIV_GAOCHANG_OASIS_FAITH'),
        ('RF_MINOR_CIV_GAOCHANG_UNIQUE_INFLUENCE_BONUS', 'ModifierId', 'RF_MINOR_CIV_GAOCHANG_OASIS_FOOD'),
You cannot repeat a combination of columns ModifierId and Name within table ModifierArguments. Each row within the table must have a unique combination of settings for these two columns or you get the error here
Code:
[4123773.367] [Gameplay] ERROR: UNIQUE constraint failed: ModifierArguments.ModifierId, ModifierArguments.Name
The game then ceases to read anything from within the file where the error occurs.

This is a unique combination
Code:
        ('RF_MINOR_CIV_GAOCHANG_DESERT_GOLD', 'YieldType', 'YIELD_GOLD'),
        ('RF_MINOR_CIV_GAOCHANG_DESERT_GOLD', 'YieldChange', 2)
Whereas this is not
Code:
        ('RF_MINOR_CIV_GAOCHANG_UNIQUE_INFLUENCE_BONUS', 'ModifierId', 'RF_MINOR_CIV_GAOCHANG_DESERT_GOLD'),
        ('RF_MINOR_CIV_GAOCHANG_UNIQUE_INFLUENCE_BONUS', 'ModifierId', 'RF_MINOR_CIV_GAOCHANG_DESERT_FAITH'),
The fact that you have a different entry for the "Value" column does not affect the uniqueness restriction because it is columns (ModifierId, Name) which must have the unique combo.

Code:
CREATE TABLE "ModifierArguments" (
		"ModifierId" TEXT NOT NULL,
		"Name" TEXT NOT NULL,
		"Type" TEXT NOT NULL DEFAULT "ARGTYPE_IDENTITY",
		"Value" TEXT NOT NULL,
		"Extra" TEXT,
		"SecondExtra" TEXT,
		PRIMARY KEY(ModifierId, Name),
		FOREIGN KEY (ModifierId) REFERENCES Modifiers(ModifierId) ON DELETE CASCADE ON UPDATE CASCADE);
"PRIMARY KEY" tells you the columns that must have a unique combination for every row in the given table.
 
This is also no good
Code:
('RF_MINOR_CIV_GAOCHANG_UNIQUE_INFLUENCE_BONUS', 'ModifierId', 'RF_MINOR_CIV_GAOCHANG_DESERT_GOLD'),
('RF_MINOR_CIV_GAOCHANG_UNIQUE_INFLUENCE_BONUS', 'ModifierId', 'RF_MINOR_CIV_GAOCHANG_DESERT_FAITH'),
('RF_MINOR_CIV_GAOCHANG_UNIQUE_INFLUENCE_BONUS', 'ModifierId', 'RF_MINOR_CIV_GAOCHANG_OASIS_GOLD'),
('RF_MINOR_CIV_GAOCHANG_UNIQUE_INFLUENCE_BONUS', 'ModifierId', 'RF_MINOR_CIV_GAOCHANG_OASIS_FAITH'),
('RF_MINOR_CIV_GAOCHANG_UNIQUE_INFLUENCE_BONUS', 'ModifierId', 'RF_MINOR_CIV_GAOCHANG_OASIS_FOOD'),
You cannot repeat a combination of columns ModifierId and Name within table ModifierArguments. Each row within the table must have a unique combination of settings for these two columns or you get the error here
Right, but what should I change that to? (Sorry for the somewhat silly question, I'm not very experienced with SQL.) Thank you!
 
You just need something unique for each one, for instance like this:
Code:
('RF_MINOR_CIV_GAOCHANG_UNIQUE_DESERT_GOLD_BONUS', 'ModifierId', 'RF_MINOR_CIV_GAOCHANG_DESERT_GOLD'),
('RF_MINOR_CIV_GAOCHANG_UNIQUE_DESERT_FAITH_BONUS', 'ModifierId', 'RF_MINOR_CIV_GAOCHANG_DESERT_FAITH'),
('RF_MINOR_CIV_GAOCHANG_UNIQUE_OASIS_GOLD_BONUS', 'ModifierId', 'RF_MINOR_CIV_GAOCHANG_OASIS_GOLD'),
('RF_MINOR_CIV_GAOCHANG_UNIQUE_OASIS_FAITH_BONUS', 'ModifierId', 'RF_MINOR_CIV_GAOCHANG_OASIS_FAITH'),
('RF_MINOR_CIV_GAOCHANG_UNIQUE_OASIS_FOOD_BONUS', 'ModifierId', 'RF_MINOR_CIV_GAOCHANG_OASIS_FOOD'),
 
What do the icons look like? Are they showing up at all, or are they questions marks?

I took a quick look at your DDS files.

1.PNG


I drew the black circle to represent the actual area of the icon. In general you want to stay within the bounds of that circle (I actually would recommend that your icon fit within a 240x240 circle as it can look too big otherwise).

Also, in your Icon Atlas you specify that your IconsPerRow = "4" - that should be set to "3".
 
In your IconAtlas all of your file references (e.g. "RF_E_Silk_Atlas22.dds") do not point to your actual files, because all of your icon files have an extra underscore ("RF_E_Silk_Atlas_22.dds"). You will also need to fix the "Pyu_Icon_Atlas200" element (to "Pyu_Icon_Atlas_200") in your XLP file.
 
Back
Top Bottom