void CvXMLLoadUtility::SetGlobalClassInfo(std::vector<T*>& aInfos, const char* szTagName, bool bTwoPass)
{
char szLog[256];
sprintf(szLog, "SetGlobalClassInfo (%s)", szTagName);
PROFILE(szLog);
logMsg(szLog);
// if we successfully locate the tag name in the xml file
if (gDLL->getXMLIFace()->LocateNode(m_pFXml, szTagName))
{
// loop through each tag
do
{
SkipToNextVal(); // skip to the next non-comment node
T* pClassInfo = new T;
FAssert(NULL != pClassInfo);
if (NULL == pClassInfo)
{
break;
}
bool bSuccess = pClassInfo->read(this);
FAssert(bSuccess);[/code]
The last line is where we found the assert thrown. So looking back at what called this function we find:
Code:
void CvXMLLoadUtility::LoadGlobalClassInfo(std::vector<T*>& aInfos, const char* szFileRoot, const char* szFileDirectory, const char* szXmlPath, bool bTwoPass, CvCacheObject* (CvDLLUtilityIFaceBase::*pArgFunction) (const TCHAR*))
{
bool bLoaded = false;
bool bWriteCache = true;
CvCacheObject* pCache = NULL;
GC.addToInfosVectors(&aInfos);
if (NULL != pArgFunction)
{
pCache = (gDLL->*pArgFunction)(CvString::format("%s.dat", szFileRoot)); // cache file name
if (gDLL->cacheRead(pCache, CvString::format("xml\\\\%s\\\\%s.xml", szFileDirectory, szFileRoot)))
{
logMsg("Read %s from cache", szFileDirectory);
bLoaded = true;
bWriteCache = false;
}
}
if (!bLoaded)
{
bLoaded = LoadCivXml(m_pFXml, CvString::format("xml\\%s/%s.xml", szFileDirectory, szFileRoot));
if (!bLoaded)
{
char szMessage[1024];
sprintf(szMessage, "LoadXML call failed for %s.", CvString::format("%s/%s.xml", szFileDirectory, szFileRoot).GetCString());
gDLL->MessageBox(szMessage, "XML Load Error");
}
else
{
SetGlobalClassInfo(aInfos, szXmlPath, bTwoPass);
if (gDLL->isModularXMLLoading())
The last line is where the green arrow is pointing so it would've been the SetGlobalClassInfo(aInfos, szXmlPath, bTwoPass); line before it that was where we had advanced from this function to the one we found the assert in. I'm not sure if the value I get when I hover over the aInfos makes any difference (it's pointing to the 226th item in that vector or array.) Sometimes this enumeration can help you pin down which game object has the problem but I think that array may indicate something that isn't all that helpful here... not sure though. If it IS the # of the game object we're having trouble with then it's actually the 227th item because 0 is counted as the first in the vector/array numeration. (Thus if this was a unit itself causing an issue it might be the 227th unit in the core file.) Again... not entirely sure without looking a lot deeper into the whole unit art loading process.
But the stack breakdown makes it very clear that we're dealing with an error in the UNIT art infos.
Now... looking through the rest of the asset files, I found the unit art file you have there though you don't have your own schema... that might help but I'm not sure it's necessary. Anyhow... all I can really say is the problem is in that file itself. Somewhere. Strategyonly might know more about art issues like these.
If I'm not mistaken, C2C's dll would probably let me know more due to new messages built in to help with issues like these. But there's so many other dependencies there such as added xml expectations that I'm thinking it'd be impossible to get it's assistance on this mod.
However, there IS a pretty good xml validator program that Alberts built that could possibly be pretty useful here. I suppose I could go and copy over the core BtS schema into this Art file and run the validator to see what I can figure out from that... hmm...
Anyhow... looking further into it.