I'm trying to get new xml/schema files to load. I have added the functions, that should find the info from xml, to CvInfos.cpp and CvInfos.h, but nothing seems to happen. I checked the xml log, and my new files weren't loaded.
Where is defined loading the new xml files, or have I done something wrong/missed something?
Just in case here's all my changes:
Where is defined loading the new xml files, or have I done something wrong/missed something?
Just in case here's all my changes:
- CIV4IdeologyInfosSpoiler :Code:
<?xml version="1.0"?> <!-- edited with XMLSPY v2004 rel. 2 U (http://www.xmlspy.com) by Alex Mantzaris (Firaxis Games) --> <!-- Sid Meier's Civilization 4 --> <!-- Copyright Firaxis Games 2005 --> <!-- --> <!-- Ideology --> <Civ4IdeologyInfo xmlns="x-schema:CIV4IdeologySchema.xml"> <IdeologyInfos> <IdeologyInfo> <Type>IDEOLOGY_DEMOCRACY</Type> <Description>Democracy</Description> <Civilopedia>democracy_pedia</Civilopedia> <Button>Art/Interface/Buttons/Religions/Jewish.dds</Button> <TechPrereq>NONE</TechPrereq> <FreeUnitClass>NONE</FreeUnitClass> <iFreeUnits>0</iFreeUnits> <iSpreadFactor>100</iSpreadFactor> </IdeologyInfo> </IdeologyInfos> </Civ4IdeologyInfo>
Spoiler :Code:<!-- edited with XMLSPY v2004 rel. 2 U (http://www.xmlspy.com) by Alex Mantzaris (Firaxis Games) --> <!-- Sid Meier's Civilization 4 --> <!-- Copyright Firaxis Games 2005 --> <!-- --> <!-- Ideology Schema --> <Schema xmlns="urn:schemas-microsoft-com:xml-data" xmlns:dt="urn:schemas-microsoft-com:datatypes"> <ElementType name="Type" content="textOnly"/> <ElementType name="Description" content="textOnly"/> <ElementType name="Civilopedia" content="textOnly"/> <ElementType name="Button" content="textOnly"/> <ElementType name="TechPrereq" content="textOnly"/> <ElementType name="FreeUnitClass" content="textOnly"/> <ElementType name="iFreeUnits" content="textOnly" dt:type="int"/> <ElementType name="iSpreadFactor" content="textOnly" dt:type="int"/> <ElementType name="iOrderPriority" content="textOnly" dt:type="int"/> <ElementType name="IdeologyInfo" content="eltOnly"> <element type="Type"/> <element type="Description"/> <element type="Civilopedia"/> <element type="Button"/> <element type="TechPrereq"/> <element type="FreeUnitClass"/> <element type="iFreeUnits"/> <element type="iSpreadFactor"/> <element type="iOrderPriority" minOccurs="0"/> </ElementType> <ElementType name="IdeologyInfos" content="eltOnly"> <element type="IdeologyInfo" maxOccurs="*"/> </ElementType> <ElementType name="Civ4IdeologyInfo" content="eltOnly"> <element type="IdeologyInfos"/> </ElementType> </Schema>
- CvInfos.hSpoiler :Code:
//++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ // // class : CvIdeologyInfo // // DESC: // //++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ class CvIdeologyInfo : public CvInfoBase { //---------------------------------------PUBLIC INTERFACE--------------------------------- public: CvIdeologyInfo(); virtual ~CvIdeologyInfo(); int getTechPrereq() const; int getFreeUnitClass() const; int getNumFreeUnits() const; int getSpreadFactor() const; // Arrays bool read(CvXMLLoadUtility* pXML); //---------------------------------------PROTECTED MEMBER VARIABLES--------------------------------- protected: int m_iTechPrereq; int m_iFreeUnitClass; int m_iNumFreeUnits; int m_iSpreadFactor; // Arrays };
- CvInfos.cppSpoiler :Code:
//====================================================================================================== // CvIdeologyInfo //====================================================================================================== //------------------------------------------------------------------------------------------------------ // // FUNCTION: CvIdeologyInfo() // // PURPOSE : Default constructor // //------------------------------------------------------------------------------------------------------ CvIdeologyInfo::CvIdeologyInfo() : m_iTechPrereq(NO_TECH), m_iFreeUnitClass(NO_UNITCLASS), m_iNumFreeUnits(0), m_iSpreadFactor(0) { } //------------------------------------------------------------------------------------------------------ // // FUNCTION: ~CvIdeologyInfo() // // PURPOSE : Default destructor // //------------------------------------------------------------------------------------------------------ CvIdeologyInfo::~CvIdeologyInfo() { } int CvIdeologyInfo::getTechPrereq() const { return m_iTechPrereq; } int CvIdeologyInfo::getFreeUnitClass() const { return m_iFreeUnitClass; } int CvIdeologyInfo::getNumFreeUnits() const { return m_iNumFreeUnits; } int CvIdeologyInfo::getSpreadFactor() const { return m_iSpreadFactor; } bool CvIdeologyInfo::read(CvXMLLoadUtility* pXML) { CvString szTextVal; if (!CvInfoBase::read(pXML)) { return false; } pXML->GetChildXmlValByName(szTextVal, "TechPrereq"); m_iTechPrereq = pXML->FindInInfoClass(szTextVal); pXML->GetChildXmlValByName(szTextVal, "FreeUnitClass"); m_iFreeUnitClass = pXML->FindInInfoClass(szTextVal); pXML->GetChildXmlValByName(&m_iNumFreeUnits, "iFreeUnits"); pXML->GetChildXmlValByName(&m_iSpreadFactor, "iSpreadFactor"); return true; }