Weird python error with the flag/TeamAI.h

Since the acquisition of the tech itself is already broadcast over the network, you don't need another message to found the ideology. Just put the code into setHasTech() I believe (follow foundReligion() back to what calls it) and you're all set. Each machine will execute the same code to found the ideology.
 
What do I need to do to create popup? I have this code in CvPlayer. It's called by setHasTech.
Code:
void CvPlayer::foundIdeology(IdeologyTypes eIdeology, IdeologyTypes eSlotIdeology, bool bAward)
{
	if (NO_IDEOLOGY == eIdeology)
	{
		return;
	}

	if (GC.getGameINLINE().isIdeologyFounded(eIdeology))
	{
		if (isHuman())
		{
			CvPopupInfo* pInfo = new CvPopupInfo(BUTTONPOPUP_FOUND_IDEOLOGY, eSlotIdeology);
			if (NULL != pInfo)
			{
				gDLL->getInterfaceIFace()->addPopup(pInfo, getID());
			}
		}

		return;
	}

	GC.getGameINLINE().setIdeologySlotTaken(eSlotIdeology, true);
}
Or do I need to add something else to create a popup when you discover the tech the ideology requires?

EDIT: But doesn't that code check if the ideology is already founded, and if yes add the popup?
EDIT2: I'll try redoing it.
 
The BUTTONPOPUP_FOUND_IDEOLOGY seems to add the pick ideology popup. How would I display the popup that tells you have founded the ideology?

EDIT: Now I know how I'll do it:
  • modify CvPlayer::foundIdeology to set a holycity somewhere
  • add CvCity::setHasIdeology function
  • call makeIdeologyFounded, set true (this way ideology advisor will work)
  • add check if you have only one city with this ideology
  • if yes, use BUTTONPOPUP_CHANGEIDEOLOGY

EDIT2: Hmm, crash when settling. Debugging time I quess...
 
Somehow the crash was fixed when I rebuilt the entire DLL, and the DLL was 10kb bigger. :confused:
But now everything works as planned. Thank you very much of your help EmperorFool, it was irreplaceable.
Now I need to plan what I want the code to do... :hmm:
 
Top Bottom