Increasing Tile Yields per Trade Route

Freia

Chieftain
Joined
Jun 16, 2017
Messages
5
Hi guys I'm trying to make my own civ and I've got most of the code down except for the UA. The UA is supposed to increase Metal Resource production yields by 2 per Trade Route going in and out of the city.

I wanted to code it myself but I don't know where to start. I'm assuming it's coding with Lua.

I think I'm supposed to check how many Trade Routes are going in and out of each city and then build a dummy building that increases the yields for each Route?
 
You've pretty much hit the nail on the head there with what you need to do. You may not even need to write any Lua yourself, as all the Lua will be doing is adding a dummy building for each trade route in the city - plenty of other mods do similar functions, what I would suggest is finding one that does and looking under the hood at their Lua code to see how they went about it
 
Thanks, Pouakai! Got it working after looking around the others' code and doing a lot of thinking.
 
I'm not too keen on making a new thread when this one is pretty recent so I'm just going to double post to ask.

For anyone: is there any way I can modify a specific Trade Route's gold output by a modifier (say 33% or even 100%)? I tried to look in the Modiki but I can't find anything but that might just be me.
 
I'm not too keen on making a new thread when this one is pretty recent so I'm just going to double post to ask.

For anyone: is there any way I can modify a specific Trade Route's gold output by a modifier (say 33% or even 100%)? I tried to look in the Modiki but I can't find anything but that might just be me.

Nope. Just by raw Gold. TradeRouteRecipientBonus, TradeRouteTargetBonus, TradeRouteSeaGoldBonus, and TradeRouteLandGoldBonus are what you've got to play with (bearing in mind that the first two work in single units (1, 2, etc) whereas the second two work in hundreds (100 = 1 gold, 200 = 2 gold, etc.)).
 
Top Bottom