Modifier/Requirement Auto-Generator
Modifier/Requirement Auto-Generator
About this mod Machine translation
Modifier/Requirement Auto-Generator
I'm tired of having to manually update multiple tables every time I create a modifier, and once you have a decent number of modifiers it becomes very tedious as the code can get very long.
I created this Modifier Generator in SQL so that I can enter all modifier fields from Modifiers and ModifierArguments into one row and both tables will update automatically. Modifier attachments will also be automatically generated for (almost) all tables, the exceptions are
GreatPersonIndividualActionModifiers and GreatPersonIndividualBirthModifiers.
I did the same thing for all requirement tables (Requirements, RequirementArguments, RequirementSets, RequirementSetRequirements, etc.) so one row would update all related tables.
This is most useful when you are creating multiple modifiers at once... when creating a few modifiers it will have more limited use, although you can of course still use it.
I've literally been teaching myself SQL for the past week, so if someone who really knows SQL wants to take a look at it to improve/optimize it I'd be happy if you do, as long as you tell me what I'm doing wrong or inefficiently
I don't know if this will be useful to anyone else, but I thought I'd share it.
Here is the code:
/*
SQL Modifier Generator for Civilization VI
Created by thecrazyscotsman (7 Dec 2016)
This framework allows you to input all the relevant parts of a modifier and/or a requirement into a single line. The rest is automatically generated for you.
EXAMPLE:
INSERT INTO ModTempTable (ModifierId, RunOnce, Permanent, OwnerRequirementSetId, SubjectRequirementSetId, ModifierType, Name, Value, Extra, Name2, Value2, Extra2, Name3, Value3, Extra3, AttachedTo)
VALUES
("MODIFIER_ADD_RICEFOOD", 0, 0, NULL, "REQUIREMENT_PLOT_HAS_RICE", "MODIFIER_CITY_PLOT_YIELDS_ADJUST_PLOT_YIELD", "YieldType", "YIELD_FOOD", NULL, "Amount", 1, NULL, NULL, NULL, NULL, "BUILDING_GRANARY");
INSERT INTO ReqTempTable (RequirementSetId, RequirementSetType, RequirementId, RequirementType, Inverse, Name, Value, Extra, Name2, Value2, Extra2)
VALUES
("REQUIREMENT_PLOT_HAS_RICE", "REQUIREMENTSET_TEST_ALL", "PLOT_HAS_RICE", "REQUIREMENT_PLOT_RESOURCE_TYPE_MATCHES", 0, "ResourceType", "RESOURCE_RICE", NULL, NULL, NULL, NULL);
These inputs will generate and insert the correct rows on the Modifiers, ModifierArguments, Requirements, RequirementArguments, RequirementSetRequirements, and RequirementSets tables. It will also automatically attach the modifier to the Granary.
Modifier attachments are automatically created (using the AttachedTo field), with the exception of these two:
GreatPersonIndividualActionModifiers
GreatPersonIndividualBirthModifiers
In order to correctly generate the modifier attachment, the correct prefix must be used (i.e. BUILDING). Custom mod strings must go after the prefix (i.e. BUILDING_TCS_SALOON).
*/
/* CREATE FRAMEWORK -- DO NOT CHANGE */
--Temporary tables dropped at end
CREATE TABLE ModTempTable
(
ModifierId TEXT NOT NULL,
RunOnce BOOLEAN NOT NULL DEFAULT 0,
Permanent BOOLEAN NOT NULL DEFAULT 0,
OwnerRequirementSetId TEXT,
SubjectRequirementSetId TEXT,
ModifierType TEXT NOT NULL,
Name TEXT,
Value TEXT,
Extra TEXT,
Name2 TEXT,
Value2 TEXT,
Extra2 TEXT,
Name3 TEXT,
Value3 TEXT,
Extra3 TEXT,
Name4 TEXT,
Value4 TEXT,
Extra4 TEXT,
Name5 TEXT,
Value5 TEXT,
Extra5 TEXT,
AttachedTo TEXT
);
CREATE TABLE ReqTempTable
(
RequirementSetId TEXT,
RequirementSetType TEXT,
RequirementId TEXT,
RequirementType TEXT,
Inverse BOOLEAN NOT NULL DEFAULT 0,
Name TEXT,
Value TEXT,
Extra TEXT,
Name2 TEXT,
Value2 TEXT,
Extra2 TEXT
);
/* END CREATE FRAMEWORK */
/* BEGIN MOD INPUTS */
--INPUT MODIFIERS
INSERT INTO ModTempTable (ModifierId, RunOnc …
Install & use Install: follow the bundled instructions
- Unzip the archive from playbuff and read the bundled readme / instructions first.
- There is no universal mod manager for this game: some mods replace game files directly, some go into a game-specific Mods folder, and some need a game-specific community loader or tool first — follow the bundled readme.
- Place the files exactly as the readme says; mods with listed dependencies need those installed too.
- Launch the game to confirm it loaded; some games require enabling mods in settings or an in-game mod menu.
Install locations vary a lot between games and mods — the bundled readme is the most reliable guide.