View Full Version : [SDK] Difference between CvDeal::startTrade and CvPlayer::handleDiploEvent


ClassicThunder
Jun 27, 2007, 02:29 PM
What is the difference between between CvDeal::startTrade and CvPlayer::handleDiploEvent. Is startTrade a regular trade when you open up the window and cause a trade, and handleDiploEvent for when a civilization approaches you with an offer?

Thanks,
ClassicThunder

snarko
Jun 27, 2007, 02:44 PM
It's a bit difficult to tell exactly what they are for since handleDiploEvent is only called from outside the SDK. As I understand it handleDiploEvent is for onesided diplomatic events. Any form of demand or request. CvDeal::addTrades (which is what calls startTrade) is for all trades where both offer something aswell as anything not handled by handleDiploEvent. For example if civ A demands a tech from civ B then handleDiploEvent is what makes the AI upset that you make a demand or refuse their demand while addTrades is what gives you/them the tech (if they/you accept).

Why do you ask?

ClassicThunder
Jun 27, 2007, 02:52 PM
I'm working on my Good/Evil component for my mod and want to make it so when you bully for war and trade embargoes it adds to the players Evil, while encouraging peace and offering gifts to lower civs adds to your Good.

Thanks for clearing that up for me.