Afforess
The White Wizard
It doesn't work. Here's a screenshot, so you can see that I typed it right.

If you type ` without holding shift, you get a different non-Python console. Make sure you hold shift and that you see a message in the console about it being for Python.
The latest CvInfos.cpp file you sent still had the old plural name of getCivicAttitudeChanges(). Did you perhaps rename it like I suggested in your "secret" file?![]()
python::class_<CvCivicInfo, python::bases<CvInfoBase> >("CvCivicInfo")
...
// Arrays
...
[B].def("getCivicAttitudeChanges", &CvCivicInfo::getCivicAttitudeChanges, "int (int /*CivicTypes*/ iCivicType)")[/B]
;
python::class_<CvUnitClassInfo, python::bases<CvInfoBase> >("CvUnitClassInfo")
...
// create arrays to hold attitude changes and messages
SAFE_DELETE_ARRAY(m_piCivicAttitudeChanges);
m_piCivicAttitudeChanges = new int[GC.getNumCivicInfos()];
//SAFE_DELETE_ARRAY(m_pszCivicAttitudeTextKeys);
//m_pszCivicAttitudeTextKeys = new CvString[GC.getNumCivicInfos()];
pXML->InitList(&m_piCivicAttitudeChanges, GC.getNumCivicInfos(), 0);
if (!CvInfoBase::read(pXML))
{
return false;
}
if (gDLL->getXMLIFace()->SetToChildByTagName(pXML->GetXML(),"CivicAttitudeChanges"))
{
}
else
{
pXML->InitList(&m_piCivicAttitudeChanges, GC.getNumCivicInfos(), 0);
}
LoadGlobalClassInfo(GC.getCivicInfo(), "CIV4CivicInfos", "GameInfo", "Civ4CivicInfos/CivicInfos/CivicInfo", [B]true[/B], &CvDLLUtilityIFaceBase::createCivicInfoCacheObject);
if (pXML->SkipToNextVal())
{
[B][COLOR="Orange"]pXML->InitList(&m_piCivicAttitudeChanges, GC.getNumCivicInfos(), 0);[/COLOR][/B]
[s]for (int i = 0; i < GC.getNumCivicInfos(); i++)[/s]
[s]{[/s]
[s]m_piCivicAttitudeChanges[i] = 0;[/s]
[s]//m_pszCivicAttitudeTextKeys[i] = NULL;[/s]
[s]}[/s]
int iCount = gDLL->getXMLIFace()->GetNumChildren(pXML->GetXML());
Oh, I missed one part I think. In readpass2() make these changes:
It looks like that during the second read pass, only the main information (type, description, key, etc) from CvInfoBase is read again, but read() isn't called again. Thus we need to initialize the arrays at the end of read() and at the start of readpass2().Code:if (pXML->SkipToNextVal()) { [B][COLOR=Orange]pXML->InitList(&m_piCivicAttitudeChanges, GC.getNumCivicInfos(), 0);[/COLOR][/B] [s]for (int i = 0; i < GC.getNumCivicInfos(); i++)[/s] [s]{[/s] [s]m_piCivicAttitudeChanges[i] = 0;[/s] [s]//m_pszCivicAttitudeTextKeys[i] = NULL;[/s] [s]}[/s] int iCount = gDLL->getXMLIFace()->GetNumChildren(pXML->GetXML());
Remove the call to pXML->InitList() from the end of read(). I think that's actually causing a problem because the number of civics is not known when they are first being read in.
You made the change to CVXMLLoadUtilitySet.cpp, right?