[SDK] Advanced Diplomacy

Another bug: AI players gave their workers for free. If you ask them what they want for exchange they say: 'it's ok. i don't need anything.' :)

P.S. I didn't had a chance to find out if the problem with AI asking for cease fire between you and your enemy was fixed. But maybe it was my fault (bad merging)?
 
Also, you can request contact to other civs for free... they don't want any gold for it.
 
Okay, after merging some more code from AND, I don't get python errors anymore.

But... you can sign embassy multiple times (Bug), the AI will often ask you for it (maybe after loading a savegame):

attachment.php


attachment.php




When canceling any of them, all embassies get cancled.
 
And another bug, when decline to make peace (with somebody else), this screen appears:

attachment.php


Not possible to continue playing at this point. Accepting her request does not work either.
 
Thanks for all the reports; I believe I've fixed all the reported bugs. I've updated to Version 1.03. Lots of files changes in the SDK; but no python or XML changes.
 
Okay, some more bugs:

#1: You are using TXT_KEY_CIV_GREECE_ADJECTIVE instead of TXT_KEY_CIV_GREECE_SHORT_DESC. That leads to strange results when using other languages than English. (German: "Griechisch" instead of "Griechenland" oder "den Griechen" X_x) You should use SHORT_DESC in all instances.

#2: This function does not work. I'm still at war with Greece when using "Peace it is."

attachment.php
 
Updated to 1.04.

Files changes are in CvDiplomacy.py, CvPlayer.cpp, and CvPlayerAI.cpp. All of your problems should be fixed Cybah. Tell me if you find any further bugs; but I think I've caught them all.
 
Hehe, still not proper.

PHP:
1>CvPlayer.cpp(4868) : error C2660: 'CvPlayer::AI_getMemoryCount' : function does not take 3 arguments
1>CvPlayer.cpp(4878) : error C2660: 'CvPlayer::AI_getMemoryCount' : function does not take 3 arguments

Cannot compile the new code:

PHP:
/************************************************************************************************/
/* Afforess	                  Start		 08/01/10                                               */
/*                                                                                              */
/* Advanced Diplomacy                                                                           */
/************************************************************************************************/
   case DIPLOEVENT_MAKE_PEACE_WITH:
		if (GET_TEAM(GET_PLAYER(ePlayer).getTeam()).isAtWar((TeamTypes)iData1))
		{
			if (AI_getMemoryCount(ePlayer, MEMORY_EVENT_GOOD_TO_US, 1) < 3) <------------------------ this
			{
				AI_changeMemoryCount(ePlayer, MEMORY_EVENT_GOOD_TO_US, 1);
			}
			GET_TEAM(GET_PLAYER(ePlayer).getTeam()).makePeace((TeamTypes)iData1);
		}
        break;
    case DIPLOEVENT_NO_MAKE_PEACE_WITH:
		if (GET_TEAM(GET_PLAYER(ePlayer).getTeam()).isAtWar((TeamTypes)iData1))
		{
			if (AI_getMemoryCount(ePlayer, MEMORY_REFUSED_HELP, 1) < 3) <------------------------ this
			{
				AI_changeMemoryCount(ePlayer, MEMORY_REFUSED_HELP, 1);
			}
		}
        break;
/************************************************************************************************/
/* Afforess	                     END                                                            */
/************************************************************************************************/
 
Hehe, still not proper.

PHP:
1>CvPlayer.cpp(4868) : error C2660: 'CvPlayer::AI_getMemoryCount' : function does not take 3 arguments
1>CvPlayer.cpp(4878) : error C2660: 'CvPlayer::AI_getMemoryCount' : function does not take 3 arguments

Cannot compile the new code:

PHP:
/************************************************************************************************/
/* Afforess	                  Start		 08/01/10                                               */
/*                                                                                              */
/* Advanced Diplomacy                                                                           */
/************************************************************************************************/
   case DIPLOEVENT_MAKE_PEACE_WITH:
		if (GET_TEAM(GET_PLAYER(ePlayer).getTeam()).isAtWar((TeamTypes)iData1))
		{
			if (AI_getMemoryCount(ePlayer, MEMORY_EVENT_GOOD_TO_US) < 3)
			{
				AI_changeMemoryCount(ePlayer, MEMORY_EVENT_GOOD_TO_US, 1);
			}
			GET_TEAM(GET_PLAYER(ePlayer).getTeam()).makePeace((TeamTypes)iData1);
		}
        break;
    case DIPLOEVENT_NO_MAKE_PEACE_WITH:
		if (GET_TEAM(GET_PLAYER(ePlayer).getTeam()).isAtWar((TeamTypes)iData1))
		{
			if (AI_getMemoryCount(ePlayer, MEMORY_REFUSED_HELP) < 3)
			{
				AI_changeMemoryCount(ePlayer, MEMORY_REFUSED_HELP, 1);
			}
		}
        break;
/************************************************************************************************/
/* Afforess	                     END                                                            */
/************************************************************************************************/

My bad, change it to this:

PHP:
/************************************************************************************************/
/* Afforess	                  Start		 08/01/10                                               */
/*                                                                                              */
/* Advanced Diplomacy                                                                           */
/************************************************************************************************/
   case DIPLOEVENT_MAKE_PEACE_WITH:
		if (GET_TEAM(GET_PLAYER(ePlayer).getTeam()).isAtWar((TeamTypes)iData1))
		{
			if (AI_getMemoryCount(ePlayer, MEMORY_EVENT_GOOD_TO_US) < 3)
			{
				AI_changeMemoryCount(ePlayer, MEMORY_EVENT_GOOD_TO_US, 1);
			}
			GET_TEAM(GET_PLAYER(ePlayer).getTeam()).makePeace((TeamTypes)iData1);
		}
        break;
    case DIPLOEVENT_NO_MAKE_PEACE_WITH:
		if (GET_TEAM(GET_PLAYER(ePlayer).getTeam()).isAtWar((TeamTypes)iData1))
		{
			if (AI_getMemoryCount(ePlayer, MEMORY_REFUSED_HELP) < 3)
			{
				AI_changeMemoryCount(ePlayer, MEMORY_REFUSED_HELP, 1);
			}
		}
        break;
/************************************************************************************************/
/* Afforess	                     END                                                            */
/************************************************************************************************/

I'll update the download too.
 
Back
Top Bottom