Advanced Diplomacy 2

Looking further into this the code that allows vote pledge trading has been commented out in the CvPlayer::canTradeItem method so doing what I suggested above won't actually enable anything as the call to see if they can be traded will always return false as that is the default.

Code:
	case TRADE_SECRETARY_GENERAL_VOTE:
/* 		
		if (GC.getGameINLINE().isOption(GAMEOPTION_ADVANCED_DIPLOMACY))
		{
			if (!(GET_TEAM(getTeam()).isHuman()))
			{
				if (GC.getGameINLINE().isDiploVote((VoteSourceTypes)item.m_iData))
				{
					if (GC.getGameINLINE().isTeamVoteEligible(GET_PLAYER(eWhoTo).getTeam(), ((VoteSourceTypes)item.m_iData)))
					{
						if (isVotingMember((VoteSourceTypes)item.m_iData) && (getPledgedSecretaryGeneralVote() == NO_TEAM))
						{
							return true;
						}
					}
				}
			}
		} */
		break;

    case TRADE_PLEDGE_VOTE:
/* 		if (GC.getGameINLINE().isOption(GAMEOPTION_ADVANCED_DIPLOMACY))
		{
			iVoteID = GC.getGameINLINE().getCurrentVoteID();
			if (iVoteID > 0)
			{
				VoteTriggeredData* pVoteTriggered = GC.getGameINLINE().getVoteTriggered(iVoteID);
				if (pVoteTriggered != NULL)
				{
					if (GC.getGameINLINE().getSecretaryGeneral(pVoteTriggered->eVoteSource) != getTeam())
					{
						CvVoteInfo& kVote = GC.getVoteInfo(pVoteTriggered->kVoteOption.eVote);
						if (!GC.getGameINLINE().isTeamVote(pVoteTriggered->kVoteOption.eVote))
						{
							if (isVotingMember(pVoteTriggered->eVoteSource) && GET_PLAYER(eWhoTo).isVotingMember(pVoteTriggered->eVoteSource))
							{
								if (getPledgedVote() == NO_PLAYER_VOTE)
								{
									return true;
								}
							}
						}
					}
				}
			}
		} */
        break;

I'll remove the commented out code and see if it breaks anything...but that will need to wait until tomorrow now.
 
Thanks for the update, I will remove the all remnants from my merge then. Do you plan on adding the pledge vote back at some point in the future?
 
Pledge vote does seem like it would be complicated to do

Anyway to have an xml file to change how much the AI values something? I would like to see units in my mod traded a lot, so I would like to have them valued pretty low, as well as I would like to see cities be tradable (for a high price but atleast tradable) as they basically arent right now.

Also any chance on improving AI in this? AI never trades units and Ive never seen it trade contacts (except when they give it for free). It would be a lot nicer if they could do this.

Also just an idea, anyway you can get it so you can see how much AI values anything? Like if you wanted to trade some units, or a city or just a tech and you don't have enough to trade back, theres a way for the AI to say "We would need atleast 5,000 gold for that".
 
Well, the unit has to have the tradable xml tag merged into Unitinfos.xml to be traded. Then, the leaders have a refuse attitudethreshold for worker, co., and military unit trading in leaderheadinfos. I'd make sure they are your best friend before trying to trade with them or waiting for a trade. That can be changed in xml though.

THe AI is in CvPlayerAI and exists for everything. It seems there is an inherent unitvalue.

With the railroad artillery, was their a technology imbalance in any way between the two of you besides the two techs. That might be it because I saw that in the code as a factor to increase the cost of a unit? How much does the railroad artillery cost to hurry production?
 
For first part, yes I am aware of that the threshold. I tried that for cities but no matter what they are always like "You will have to take it off of our..." and I would like to see cities tradable since in real life they really are (alaska, louisiana purchase etc) and would like to see that possible

As for AI not sure exactly whaat that means. Is the AI suppose to trade them?

Well I am trying it now and they only want 120 for railroad aritllery. I added myself a bunch of techs and no difference. I added a bunch of units to me (beside railroad) no difference. I then autoplayed 10 turns, cost went to 183. AI upgraded all my units, so I deleted them, took a turn added more tech, no difference. AI autoplayed another 10 went back down to 120. I messed around with relations and there is no difference. Ive had times though where the AI wants 1000 for the railroad artillery.

It costs 1225 to hurry production

EDIT: Another thing to prove AI doesnt use it. I give other civ and I a railroad artillery. I go to trade mine and I ask what he wants for it, he said no way we can make a deal, but when I do railroad artillery for railroad artillery he accepts. AI should be able to put it up for trade
 
Hey stolenrays :)

You might want to add the python files for BUG from Advanced Diplomacy 1.0. That way someone can merge AD 2.1 with any mod that incorporates BUG.

Here they are: Python BUG files for AD2.1

They go in the Python folder and the BUG_CvMainInterface.py file would need to be renamed to CvMainInterface.py and then merged with the CvMainInterface.py in the target mod.
 
Cool, tanner. I've actually been looking for someone who knows how to do this. I'll put them in the download as an option because some don't use BUG. Maybe you can help me with tips on how to merge BUG with my IIW mod.
 
I was wondering if anyone knows how to code the new diplomacy options into worldbuilder similar to war/peace can me setup. I tried by creating the agreements in game and then saving the worldbuilder, but then when analyzing the worldbuilder file, I found no changes.:confused:
 
I was wondering if anyone knows how to code the new diplomacy options into worldbuilder similar to war/peace can me setup. I tried by creating the agreements in game and then saving the worldbuilder, but then when analyzing the worldbuilder file, I found no changes.:confused:

I've attempted the same and I do not know - don't you need to code that in the DLL for there to be new codes in worldbuilder?
 
I looked, not sure, but didn't see anything hardcoded.
Do you know how to code it in though?

Also I was wondering if you could alter it a bit to make the AI more aggressive, expecially when it comes to unit trading. The biggest example in history (excluding workers/slaves) is obviously Leand-Lease and I think it should be similar to how that works. I've never seen AI attempt to trade with me or another AI units ever. The AI should want to trade when it wants a certain side to win a war. So if England is at war with Germany, and USA wants England to win, it will sell their troops for payment later (something I would love to see add, instead of pay per 30 turns, have an option for paying back in X turns. Basically if UK bought a tank from America and owed them 30 gold, they would pay that X turns later as a whole sum, but doubt thats possible - if it isnt units should be able to be traded for gold per turn). Even if Germany is at ok terms with America, if America is great terms with England they shouldn't trade with Germany. Basically it should be based on if there is a war, and if there isn't than the price should go up.
 
That is intersting, I will have to think about that for awhile to formulate some ideas how to do it on the C++ side. In xml you can change the values of units by changing iassetvalue. That's partially what determines how much gold is traded.

If I saw an example of how to sdk code diplomacy into worldbuilder, I could make some new code for adv diplomacy.

I have stopped coding to finish the IIW mod so we can start our gulf war mod very soon btw.
 
I thought that normally happened if you don't like another civ enough.

In addition, to ad the new adv diplomacy modifiers to worldbuilder, I found you have to change CvWBDesc.py. Probably some python sdk files as well.
 
Working on getting the bugs out of the new version. It compiles, but I get a CTD.

I want two new trades: Non-Agression Pact and POW Exchange. Working on them currently.

@Dacubz. Maybe some sort of modifier that could be changed via the GLobalDefines.xml would help out. Not sure if I could pull it off though. We'll see.
 
Top Bottom