[GS] Modding trade routes (HELP!)

Razbo

Chieftain
Joined
Jan 14, 2020
Messages
13
Armed with the modding guide from LeeS, and the Guide to Modifiers from NicholasV, I wanted to see if I could make some mods to trade routes. As a first baby step proof of concept I just wanted to make all trade routes grant extra science. I failed miserably. Nothing I tried had any effect. The GameEffects.log file claims my modifier built correctly. Any help would be very much appreciated.

Anything below with a RJR prefix is stuff I invented; everything else already exists. First I tried it this way:

INSERT INTO Modifiers ( ModifierId, ModifierType)
VALUES ("RJR_MORE_SCIENCE_FOR_TRADE_ROUTE", "MODIFIER_PLAYER_ADJUST_TRADE_ROUTE_YIELD");

INSERT INTO ModifierArguments ( ModifierId, Name, Value)
VALUES ("RJR_MORE_SCIENCE_FOR_TRADE_ROUTE", "Amount", "100" );

INSERT INTO ModifierArguments ( ModifierId, Name, Value)
VALUES ("RJR_MORE_SCIENCE_FOR_TRADE_ROUTE", "YieldType", "YIELD_SCIENCE");

INSERT INTO ModifierArguments ( ModifierId, Name, Value)
VALUES ("RJR_MORE_SCIENCE_FOR_TRADE_ROUTE", "Origin", "1");

INSERT INTO ModifierArguments ( ModifierId, Name, Value)
VALUES ("RJR_MORE_SCIENCE_FOR_TRADE_ROUTE", "Destination", "1");

and when that didn't work I tried using a Dynamic Modifier instead, like so (no change to the args):

INSERT INTO DynamicModifiers ( ModifierType, CollectionType, EffectType)
VALUES ("RJR_MODIFIER_MORE_SCIENCE_FOR_TRADE_ROUTE", "COLLECTION_OWNER", "EFFECT_ADJUST_TRADE_ROUTE_YIELD");

INSERT INTO Types (Type, Kind)
VALUES ("RJR_MODIFIER_MORE_SCIENCE_FOR_TRADE_ROUTE", "KIND_MODIFIER");

INSERT INTO Modifiers ( ModifierId, ModifierType )
VALUES ("RJR_MORE_SCIENCE_FOR_TRADE_ROUTE", "RJR_MODIFIER_MORE_SCIENCE_FOR_TRADE_ROUTE");

But, sadly, nothing had any effect. Thx in advance for any advice.




 
All I see is the creation of a ModifierId, but no attachment of that ModifierId to any player. So while the ModifierId may be getting properly registered into the game it is not actually doing anything.
Code:
INSERT OR REPLACE INTO TraitModifiers
	(ModifierId,				TraitType)
VALUES  ('RJR_MORE_SCIENCE_FOR_TRADE_ROUTE',	'TRAJANS_COLUMN_TRAIT');
This would attach the modifier to Trajan's basic LeaderTrait and thus attach the ModifierId to the player running the game using Trajan as their leader.

To attach the modifier to any and all major players, the following can be used
Code:
INSERT OR REPLACE INTO TraitModifiers
	(ModifierId,				TraitType)
VALUES  ('RJR_MORE_SCIENCE_FOR_TRADE_ROUTE',	'TRAIT_LEADER_MAJOR_CIV');
This will also work for any modded leaders so long as the mod-maker remembers to properly make their leader "inherit" from the LEADER_DEFAULT as Firaxis does for all major civilization leaders.
 
Ah, LeeS, thank you! I had finally muddled my way to attaching it to a policy, but attaching it to to any LEADER_MAJOR_CIV is a very clever trick, indeed, and definitely what I want.

Not knowing much of anything about how stuff works, I hadn't known that modifiers always have to be attached to *something*. And trade routes don't apparently qualify as a *something*.

Thx, again, that is extremely helpful to me.
 
Once again, I am muddling along trying to figure out how to change trade route yields. I tried a couple of things that seemed to me they should work, but failed miserably. Everything in GameEffects.log said all was fine, but nothing happened. At some point I want to add some requirements to my modifiers, but baby steps for now.....

1) First, I tried to get more stuff from city states by attaching modifiers to the City States. For example, from a Cultural City State:

INSERT OR REPLACE INTO TraitModifiers ( ModifierId, TraitType)
VALUES ("RJR_INCREASE_TRADE_ROUTE_YIELD_FOR_CULTURAL_CS", "MINOR_CIV_CULTURAL_TRAIT");

INSERT OR REPLACE INTO Modifiers ( ModifierId, ModifierType)
VALUES ("RJR_INCREASE_TRADE_ROUTE_YIELD_FOR_CULTURAL_CS", "MODIFIER_PLAYER_CITIES_ADJUST_TRADE_ROUTE_YIELD_TO_OTHERS");

INSERT OR REPLACE INTO ModifierArguments ( ModifierId, Name, Value)
VALUES ("RJR_INCREASE_TRADE_ROUTE_YIELD_FOR_CULTURAL_CS", "Amount", "11" );

INSERT OR REPLACE INTO ModifierArguments ( ModifierId, Name, Value)
VALUES ("RJR_INCREASE_TRADE_ROUTE_YIELD_FOR_CULTURAL_CS", "YieldType", "YIELD_CULTURE");

--------------------------------------

2) Something else (unrelated) I tried that didn't work was to attempt to change the yield by some percentage, as opposed to a fixed number. I found a modifier that looked like it should do the trick.


INSERT OR REPLACE INTO TraitModifiers ( ModifierId, TraitType)
VALUES ("RJR_INCREASE_ORIGIN_GOLD_PCT_FOR_TRADE_ROUTES", "TRAIT_LEADER_MAJOR_CIV");

INSERT OR REPLACE INTO Modifiers ( ModifierId, ModifierType)
VALUES ("RJR_INCREASE_ORIGIN_GOLD_PCT_FOR_TRADE_ROUTES", "MODIFIER_PLAYER_ADJUST_TRADE_ROUTE_YIELD_MODIFIER");

INSERT OR REPLACE INTO ModifierArguments ( ModifierId, Name, Value)
VALUES ("RJR_INCREASE_ORIGIN_GOLD_PCT_FOR_TRADE_ROUTES", "YieldType", "YIELD_GOLD");

INSERT OR REPLACE INTO ModifierArguments ( ModifierId, Name, Value)
VALUES ("RJR_INCREASE_ORIGIN_GOLD_PCT_FOR_TRADE_ROUTES", "Amount", "500");

INSERT OR REPLACE INTO ModifierArguments ( ModifierId, Name, Value)
VALUES ("RJR_INCREASE_ORIGIN_GOLD_PCT_FOR_TRADE_ROUTES", "Origin", "1");

I tried both Origin and Destination in the last arg, but neither had any effect.

The only place that particular modifier -- "MODIFIER_PLAYER_ADJUST_TRADE_ROUTE_YIELD_MODIFIER" -- is used in GS is for the 50% reduction associated with letters of marque. (They set the value to -50.)

***************************

So, once again, I am begging for help. It seems like I should start running a tab......
 
To (hopefully) clarify,

This works for major civs,

INSERT OR REPLACE INTO TraitModifiers ( ModifierId, TraitType)
VALUES ("RJR_MORE_GOLD_FROM_OUTGOING_TRADE_ROUTES", "TRAIT_LEADER_MAJOR_CIV");

INSERT OR REPLACE INTO Modifiers ( ModifierId, ModifierType)
VALUES ("RJR_MORE_GOLD_FROM_OUTGOING_TRADE_ROUTES", "MODIFIER_PLAYER_CITIES_ADJUST_TRADE_ROUTE_YIELD_TO_OTHERS");

But this does NOT work for City States,

INSERT OR REPLACE INTO TraitModifiers ( ModifierId, TraitType)
VALUES ("RJR_MORE_GOLD_FROM_ALL_OUTGOING_CS_TRADE_ROUTES", "MINOR_CIV_DEFAULT_TRAIT");

INSERT OR REPLACE INTO Modifiers ( ModifierId, ModifierType)
VALUES ("RJR_MORE_GOLD_FROM_ALL_OUTGOING_CS_TRADE_ROUTES", "MODIFIER_PLAYER_CITIES_ADJUST_TRADE_ROUTE_YIELD_TO_OTHERS");

Seems like I must be missing something simple, but I can't get my head wrapped around it. Sigh. All advice much appreciated. Thx.
 
To (hopefully) clarify,

This works for major civs,

INSERT OR REPLACE INTO TraitModifiers ( ModifierId, TraitType)
VALUES ("RJR_MORE_GOLD_FROM_OUTGOING_TRADE_ROUTES", "TRAIT_LEADER_MAJOR_CIV");

INSERT OR REPLACE INTO Modifiers ( ModifierId, ModifierType)
VALUES ("RJR_MORE_GOLD_FROM_OUTGOING_TRADE_ROUTES", "MODIFIER_PLAYER_CITIES_ADJUST_TRADE_ROUTE_YIELD_TO_OTHERS");

But this does NOT work for City States,

INSERT OR REPLACE INTO TraitModifiers ( ModifierId, TraitType)
VALUES ("RJR_MORE_GOLD_FROM_ALL_OUTGOING_CS_TRADE_ROUTES", "MINOR_CIV_DEFAULT_TRAIT");

INSERT OR REPLACE INTO Modifiers ( ModifierId, ModifierType)
VALUES ("RJR_MORE_GOLD_FROM_ALL_OUTGOING_CS_TRADE_ROUTES", "MODIFIER_PLAYER_CITIES_ADJUST_TRADE_ROUTE_YIELD_TO_OTHERS");

Seems like I must be missing something simple, but I can't get my head wrapped around it. Sigh. All advice much appreciated. Thx.

What are your modifier arguments?
For the
Code:
"MODIFIER_PLAYER_CITIES_ADJUST_TRADE_ROUTE_YIELD_TO_OTHERS"

The arguments should be:
Code:
ModifierId    Name    Type    Value
MINOR_CIV_CULTURAL_SEND_TRADE_ROUTE_BONUS    YieldType        YIELD_CULTURE
AND
Code:
ModifierId    Name    Type    Value
MINOR_CIV_CULTURAL_SEND_TRADE_ROUTE_BONUS    Amount        5
 
Thx, Omar, for your response. No, the args are not the problem.

This looks like something that was broken with GS. See
https://forums.civfanatics.com/threads/trade-routes-to-city-states-bug.661656/
for a bug I tracked down. It looks like the same thing.
Try to find a leader or civ trait that gives you bonus yield if you send trade routes to city states, then emulate it on your own mod. I can't think of an effect that does that right now. Or maybe try to implement a normal bonus yield from trade routes and add "target city state" requirement set?

EDIT: Try looking at Cleopatra's Mediterranean's Bride ability and apply a suitable requirement set.
 
Last edited:
Back
Top Bottom