1. We have added a Gift Upgrades feature that allows you to gift an account upgrade to another member, just in time for the holiday season. You can see the gift option when going to the Account Upgrades screen, or on any user profile screen.
    Dismiss Notice

Adding new attitude modifiers

Discussion in 'Civ4 - Creation & Customization' started by Bhruic, Oct 4, 2007.

  1. Bhruic

    Bhruic Emperor

    Nov 15, 2005
    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:
    	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);
    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)?

  2. snarko

    snarko DLLer

    Dec 9, 2003
    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.

Share This Page