Bonuses for trading resources to multiple civs

Uighur_Caesar

Comandante en Jefe
Joined
Mar 14, 2015
Messages
1,227
Location
Florida
So the UB for a civ I'm working on is supposed to provide +1 gold on a a strategic resource for every civ you are trading it to. For example, if you're trading any amount of oil to 3 civs, you get +3 gold on sources of oil. I've never done something with trade deals before so I'm unsure what it should look like. I'm assuming I can use either SetFromPlayer or SetToPlayer to count how many people I'm trading the resource to, but I'm not sure how to check what's being traded. Any ideas?
 
Code:
Player:GetResourceExport(ResourceType resource)
Actually never mind, this affects how many oil was exported to any civilization. -1 oil = +1 gold.
 
but I'm not sure how to check what's being traded. Any ideas?

Start in the Diplomacy popup code (from the Diplo Corner More Info drop-down menu). One of the tabs there show the current trade deals for the player and clicking on one shows the details of the trade.

You can use that code as the basis for a) iterating all current trade deals a player has and b) detecting if the trade involves the required resource
 
Back
Top Bottom