Adding new attitude modifiers

Bhruic

Emperor
Joined
Nov 15, 2005
Messages
1,457
I was looking at adding positive attitude modifiers for both refusing to go to war with someone and refusing to stop trading with someone. The function that assigns modifiers for refusing to go to war/stop trading is CvPlayer::handleDiploEvent(). Basically, I modified it as such:
Code:
case DIPLOEVENT_NO_JOIN_WAR:
	AI_changeMemoryCount(ePlayer, MEMORY_DENIED_JOIN_WAR, 1);
	for (iI = 0; iI < MAX_PLAYERS; iI++)
	{
		if (GET_PLAYER((PlayerTypes)iI).isAlive())
		{
			if (GET_PLAYER((PlayerTypes)iI).getTeam() == ((TeamTypes)iData1))
			{
				GET_PLAYER((PlayerTypes)iI).AI_changeMemoryCount(getID(), MEMORY_MAINTAINED_PEACE, 1);
			}
		}
	}
	break;

It is, however, not working. I added MEMORY_MAINTAINED_PEACE to the enums, set up the text for it, etc. But what I suspect is the problem is that the team is not actually passed as iData1 like it is when you do accept the war request. I can't verify that supposition, however, as I can't find where it forms the diplomatic message. Anyone have any idea where it does that? Or has anyone tried to use iData1 in similar circumstances (perhaps the problem is in another area)?

Bh
 
What you suspect is correct. The message is formed in CvDiplomacy.py. It should be possible to pass on the data the same way it's done if you accept it.
 
Top Bottom