Sack City Mod Development Thread

k ;)

oh damn, yes I forgot that part, this can get out. (for loop in oncitydoturn). Just changed it, and this time, I downloaded 0.4.7 before :D

about onCityAcquiredAndKept: oh that's true: stolen: can you disable the button in SDK, when bConquest ist false?

I'm back from vacation, so I will try to work on the AI and disabling the liberation city problem.
 
k ;)

oh damn, yes I forgot that part, this can get out. (for loop in oncitydoturn). Just changed it, and this time, I downloaded 0.4.7 before :D

about onCityAcquiredAndKept: oh that's true: stolen: can you disable the button in SDK, when bConquest ist false?


I don't think that anyone should get the popup button upon libertation because of a part of this code that is lacking (bGift):
Code:
	if (bGift)
	{
		szBuffer = gDLL->getText("TXT_KEY_POPUP_RETURN_ALLIED_CITY", GET_PLAYER(eHighestCulturePlayer).getCivilizationDescriptionKey());
		gDLL->getInterfaceIFace()->popupAddGenericButton(pPopup, szBuffer, NULL, 2, WIDGET_GENERAL, 2, eHighestCulturePlayer);
	}
 
I also don't think that you should get the popup button when the city is gifted to you because of this part where out button is not triggered.

Code:
bool CvDLLButtonPopup::launchDisbandCityPopup(CvPopup* pPopup, CvPopupInfo &info)
{
	CvPlayer& player = GET_PLAYER(GC.getGameINLINE().getActivePlayer());

	CvCity* pNewCity = player.getCity(info.getData1());
	if (NULL == pNewCity)
	{
		FAssert(false);
		return (false);
	}

	CvWString szBuffer;
	szBuffer = gDLL->getText("TXT_KEY_POPUP_FLIPPED_CITY_KEEP", pNewCity->getNameKey());
	gDLL->getInterfaceIFace()->popupSetBodyString(pPopup, szBuffer);
	gDLL->getInterfaceIFace()->popupAddGenericButton(pPopup, gDLL->getText("TXT_KEY_POPUP_KEEP_FLIPPED_CITY").c_str(), NULL, 0, WIDGET_GENERAL);
	gDLL->getInterfaceIFace()->popupAddGenericButton(pPopup, gDLL->getText("TXT_KEY_POPUP_DISBAND_FLIPPED_CITY").c_str(), NULL, 1, WIDGET_GENERAL);
	gDLL->getInterfaceIFace()->popupLaunch(pPopup, false, POPUPSTATE_IMMEDIATE);

	gDLL->getInterfaceIFace()->playGeneralSound("AS2D_CULTUREFLIP");

	return (true);
}
 
I added a few SDK changes to the AI will use it. I tested it and it indeed works. The problem is, they never seemed to raze anymore though (even barbarians). I didn't add the memory yet to get the AI bugs out first. Next I will add the iSackProb value to LeaderheadInfos.xml and then try and add a memory value.

Sorry Pla if I missed a question.
 
Here are some new things I've done:

1. Create a CvPlayer sack funtion.
2. Leader memories for Sack city& Sack Holy City.
3. the python function cityacquiredandkept2 now triggers in the sack function after the TASK_SACK is picked from CvDllbutton.cpp
4. Leaderhead Sack probabilites added.

New Problem:
1. No gold given to conquerer after sacking!-I must have messed something up somewhere.

Idea:
1. If it will be more efficient & easy I can move the sack messages to the new sack function.
 
OK, I've tried all week to code the memories and AI into the SDK, with partial successes. I've attached my newest versions. I really need some help/feedback on this. At times I can get things to work/sometimes not. Currently, I don't think the new TASK_SACK function is triggering from DLLbuttonpopup.cpp.

In addition, what is strange is that there is no gold being given upon sacking with the 0.6 eventmanager changes, but not so with 0.4?!? That seems like something that is not triggereing between the sdk/python. :confused:
 
I'll have a look about the gold...

edit: hm. in my short test, it looks fine. now, the money is calculated with the number of buildings a city has....
 
I'll have a look about the gold...

edit: hm. in my short test, it looks fine. now, the money is calculated with the number of buildings a city has....

OK, I figured out what I was doing wrong in the sdk. The memories are now triggered properly. I also added the raze city sound effect for after you sack the city.

For some reason I still don't receive gold upon sacking and the population never changes more than -1.:confused: Am I doing something wrong when I test it in game?
 
so stolen, now try this. you can check all vars by deleting the comments of # under those # Test lines

to check via WB is not a good idea, because the gold will not be added to the player and cities can lose all buildings when conquered before the popup appears.
 
checked. I can't imagine why and how. Does the TXT_KEY_MESSAGE_CITY_SACK_1 text comes twice? Do you receive/lose the gold twice?

Or do you get TXT_KEY_MESSAGE_CITY_SACK_1 and afterwards TXT_KEY_MESSAGE_CITY_SACK_3 ?
 
TXT_KEY_MESSAGE_CITY_SACK_1 is what repeats. No other messages afterwards. Gold is received only once. The second message says that no gold was received.
 

Attachments

  • Untitled.jpg
    Untitled.jpg
    110.9 KB · Views: 69
Hi PIE. I think it is nearly ready for a release. I just wanted you to take a look at it first because you put a lot of good work into it.:goodjob:

I've added a Custom GameOption, fixed all the errors I could fine. The only thing that is odd now is that your python gold sound isn't triggered. Maybe you could take a look at that. Even if that isn't fixed I think that the mod is good enough. I hope people will like it becuase so many others have requested it.
 
Back
Top Bottom