[BNW] Food & Production from city state trade routes

ShelleyProm

Chieftain
Joined
Jan 5, 2019
Messages
2
Hey, I want to mod a social policy in the patronage tree to give Food and Production from city state trade route.
My idea is to use the "TRAIT_GATEWAY_AFRICA" Trait to write my own trait with Food/Production instead of Gold/Culture. Next I need a .lua where every civ gain this trait when the social policy is choosen. There is my problem. I have nearly no idea when it comes to LUA. So far I have this which is not much. Maybe someone can help me here.

Code:
function CustomPolicyTradeRoutes(iPlayer)
   local player = Players[iPlayer]
   if (player:HasPolicy(GameInfo.Policies["POLICY_CUSTOM_TEST"].ID)) then
   end
end
 
seems complicated with lua, you should have some function called whenever a player has a trade route with a city state and add a dummy building in the origin city which gives the yields. Traits can't be given via lua i'm afraid, if you are using whoward's dll or the community patch one you get the unifiied yields and the Policy_TradeRouteYieldChange table which gives a yield for all trade routes, not only the CS ones.
 
tie the trait to an unreasearchable tech (via xml/sql), then detect the policy being given and grant the tech (via lua).

However, without a modded dll supporting the unified yields project, it's very unlikely that food/production work in that table as the devs implemented less and less outside of what they needed as CivV progressed
 
Top Bottom