juni_be_good
Black mage
Hello
I am trying to allow techs to bring a free unit to all civs (and not only the first who discovers it). For that I added a FreeUnitClass tag after the existing FirstFreeUnitClass, with a minOccurs set to 0 (for easier use). When I launch my mod with just these XML changes, it loads perfectly.
I am now working on SDK to make the game able to read it. Everything is correct except one line that is not working.
In the CvTechInfo::read(CvXMLLoadUtility* pXML), I saw this code was used for FirstFreeUnitClass tag :
So I added this line for my custom tag :
DLL compiles properly, but when I launch my mod, I get an error message about a Tag (without name) that it is unable to find.
I'm sure my mistake is on this line, because if I remove it, my mod loads well. Does anyone know where I'm wrong ?
I am trying to allow techs to bring a free unit to all civs (and not only the first who discovers it). For that I added a FreeUnitClass tag after the existing FirstFreeUnitClass, with a minOccurs set to 0 (for easier use). When I launch my mod with just these XML changes, it loads perfectly.
I am now working on SDK to make the game able to read it. Everything is correct except one line that is not working.
In the CvTechInfo::read(CvXMLLoadUtility* pXML), I saw this code was used for FirstFreeUnitClass tag :
Code:
pXML->GetChildXmlValByName(szTextVal, "FirstFreeUnitClass");
m_iFirstFreeUnitClass = pXML->FindInInfoClass(szTextVal, GC.getUnitClassInfo(), sizeof(GC.getUnitClassInfo((UnitClassTypes)0)), GC.getNumUnitClassInfos());
So I added this line for my custom tag :
Code:
pXML->GetChildXmlValByName(szTextVal, "FreeUnitClass");
m_iFreeUnitClass = pXML->FindInInfoClass(szTextVal, GC.getUnitClassInfo(), sizeof(GC.getUnitClassInfo((UnitClassTypes)0)), GC.getNumUnitClassInfos());
DLL compiles properly, but when I launch my mod, I get an error message about a Tag (without name) that it is unable to find.
I'm sure my mistake is on this line, because if I remove it, my mod loads well. Does anyone know where I'm wrong ?