[GS] Destination Yields of Domestic Trade Routes

makaki

Chieftain
Joined
Nov 23, 2019
Messages
1
Location
Vienna
Hello,

I hope this is not the wrong place to ask, but I've looked a while and didn't find any answers so: I'm trying to implement a mod that makes domestic trade routes "transfer" food, so to say, meaning while the origin of the trade route gains food, the destination loses food.

I have a couple of questions: Is this possible or are trade route yields somehow capped to be positive only? And if this is possible, how would I go about implementing it, exactly? I understand the basics (using SQL to manipulate the in-game database), but I have as of yet failed to figure out which tables I need to change in order for my changes to actually appear in-game.

This is what I have tried:
Code:
INSERT INTO Modifiers (ModifierId, ModifierType, SubjectRequirementSetId)
VALUES
 ('MAK_DOMESTIC_TRADE_ROUTE_ORIGIN_FOOD', 'MODIFIER_PLAYER_ADJUST_TRADE_ROUTE_YIELD_PER_TERRAIN_DOMESTIC', NULL),
 ('MAK_DOMESTIC_TRADE_ROUTE_DESTINATION_FOOD', 'MODIFIER_PLAYER_ADJUST_TRADE_ROUTE_YIELD_PER_TERRAIN_DOMESTIC', NULL);

INSERT INTO ModifierArguments (ModifierId, Name, Value)
VALUES
 ('MAK_DOMESTIC_TRADE_ROUTE_ORIGIN_FOOD', 'TerrainType', 'TERRAIN_GRASS'),
 ('MAK_DOMESTIC_TRADE_ROUTE_ORIGIN_FOOD', 'YieldType', 'YIELD_FOOD'),
 ('MAK_DOMESTIC_TRADE_ROUTE_ORIGIN_FOOD', 'Origin', 1),
 ('MAK_DOMESTIC_TRADE_ROUTE_ORIGIN_FOOD', 'Amount', 5),
 ('MAK_DOMESTIC_TRADE_ROUTE_DESTINATION_FOOD', 'TerrainType', 'TERRAIN_GRASS'),
 ('MAK_DOMESTIC_TRADE_ROUTE_DESTINATION_FOOD', 'YieldType', 'YIELD_FOOD'),
 ('MAK_DOMESTIC_TRADE_ROUTE_DESTINATION_FOOD', 'Destination', 1),
 ('MAK_DOMESTIC_TRADE_ROUTE_DESTINATION_FOOD', 'Amount', -5);

INSERT INTO GovernmentModifiers (GovernmentType, ModifierId)
SELECT GovernmentType, 'MAK_DOMESTIC_TRADE_ROUTE_ORIGIN_FOOD' FROM GOVERNMENTS;

INSERT INTO GovernmentModifiers (GovernmentType, ModifierId)
SELECT GovernmentType, 'MAK_DOMESTIC_TRADE_ROUTE_DESTINATION_FOOD' FROM GOVERNMENTS;

This changes nothing. Is attaching it to all governments the wrong way of going about actually making them show up in game? Am I using the wrong modifier types/arguments? I have tried others (MODIFIER_PLAYER_ADJUST_TRADE_ROUTE_YIELD_FOR_DOMESTIC, for example), but to no avail.
 
A ModifierId never needs to be added to table Types. They are not elemental game "Types".

"KIND_MODIFIER" only applies to ModifierType and one only needs to add a new "KIND_MODIFIER" to table Types when adding a new sort of modifier with a discreet and new CollectionType and EffectType in table DynamicModifiers.

Multiple ModifierIds can use the same ModifierType, and the code used by Firaxis very often does use the same ModifierType for multiple different ModifierIds. As mod-makers we can re-use an existing ModifierType for our new ModifierId and in such cases we never need to add anything to table Types related to our new ModifierId .

Given other people's experience with these issues re trade route yields it appears that the SOMETHING_ADJUST_TRADE_ROUTE_YIELD_SOMETHING ModifierTypes all seem to ignore negative values for Amount entries in table ModifierArguments
 
Top Bottom