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

    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
     
  2. snarko

    snarko DLLer

    Joined:
    Dec 9, 2003
    Messages:
    1,512
    Location:
    Sweden
    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