Denver
Chieftain
- Joined
- Oct 19, 2019
- Messages
- 4
I'm trying to make it so that every Stock Exchange will give 2 gold per citizen in the city, up to 255 citizens. (In the future +1 when unpowered, another +1 when powered or something similar).
Here is what I have so far in an sql file:
In game, when building a Stock Exchange in an unpowered city, with only this mod enabled, the gold per turn increases by exactly the default value (4), ignoring the additional intended effect. Other basic changes in the same modfile can work.
What I think I might've done wrong:

Here is what I have so far in an sql file:
Code:
DECLARE @cnt INT = 1;
WHILE @cnt < 256
BEGIN
@seyield = 'BUILDING_STOCK_EXCHANGE_YIELD_' + @cnt;
@secitizens = 'BUILDING_STOCK_EXCHANGE_CITIZENS_' + @cnt;
@secount = 'COUNT_CITIZENS_' + @cnt;
INSERT INTO
BuildingModifiers (BuildingType, ModifierId)
VALUES
('BUILDING_STOCK_EXCHANGE', @seyield);
INSERT INTO
Modifiers (ModifierId, ModifierType, RunOnce, Permanent, SubjectRequirementSetId)
VALUES
(@seyield, 'MODIFIER_BUILDING_YIELD_CHANGE', 0, 0, @secitizens);
INSERT INTO
ModifierArguments (ModifierID, Name, Value)
VALUES
(@seyield, 'BuildingType', 'BUILDING_STOCK_EXCHANGE'),
(@seyield, 'Amount', '2'),
(@seyield, 'YieldType', 'YIELD_GOLD');
INSERT INTO
RequirementSets(RequirementSetId, RequirementSetType)
VALUES
(@secitizens, 'REQUIREMENT_TEST_ALL');
INSERT INTO
RequirementSetRequirements(RequirementSetId, RequirementId)
VALUES
(@secitizens, @secount);
INSERT INTO
Requirements(RequirementId, RequirementType)
VALUES
(@secount, 'REQUIREMENT_COLLECTION_ATLEAST');
INSERT INTO
RequirementArguments(RequirementId, Name, Value)
VALUES
(@secount, 'CollectionType', 'COLLECTION_CITY_PLOT_YIELDS'),
(@secount, 'Count', '1');
SET @cnt = @cnt + 1;
END;
In game, when building a Stock Exchange in an unpowered city, with only this mod enabled, the gold per turn increases by exactly the default value (4), ignoring the additional intended effect. Other basic changes in the same modfile can work.
What I think I might've done wrong:
- Made one tiny spelling mistake or wrong ID somewhere.
- I'm way too tired right now so this is really likely and will check again after some sleep.
- Maybe Civ 6 SQL doesn't support variables, or WHILE, or string concatenation for some reason.
- I've completely dropped the ball and what I'm trying to do will never work with this method and should try a different approach.
