ripple01
Emperor
I posted this in the SDK/Python forum, but wanted to repost it here as well for greater visibility:
Hi all,
First off, I have very newb programming knowledge, so go easy on me.
I am trying to copy some code by Implaer[WrG] and use it in my mod. The code adds a new XML tag in Civ4TraitInfos.XML that increases Military Production by an int.
First, I added the relevant bits to CvInfos.cpp under CvTraitInfo:
Then do the same in CvInfos.h
DllExport int getMilitaryProductionModifier() const;
int m_iMilitaryProductionModifier;
And then the following in CvGameText.cpp
When I load the mod, the trait effect shows up in the Civ Select Screen and in the Civilopedia. However, it does not seem to work or show up in game. Could anyone tell me if I'm leaving something out or have something incorrect?
Cheers,
ripple01
Hi all,
First off, I have very newb programming knowledge, so go easy on me.
I am trying to copy some code by Implaer[WrG] and use it in my mod. The code adds a new XML tag in Civ4TraitInfos.XML that increases Military Production by an int.
First, I added the relevant bits to CvInfos.cpp under CvTraitInfo:
Spoiler :
m_iMilitaryProductionModifier(0)
int CvTraitInfo::getMilitaryProductionModifier() const
{
return m_iMilitaryProductionModifier;
}
pXML->GetChildXmlValByName(&m_iMilitaryProductionModifi er, "iMilitaryProductionModifier");
int CvTraitInfo::getMilitaryProductionModifier() const
{
return m_iMilitaryProductionModifier;
}
pXML->GetChildXmlValByName(&m_iMilitaryProductionModifi er, "iMilitaryProductionModifier");
Then do the same in CvInfos.h
Spoiler :
DllExport int getMilitaryProductionModifier() const;
int m_iMilitaryProductionModifier;
And then the following in CvGameText.cpp
Spoiler :
if (GC.getTraitInfo(eTrait).getMilitaryProductionModi fier() != 0)
{
szHelpString.append(NEWLINE);
szHelpString.append(" ");
szHelpString.append(gDLL->getText("TXT_KEY_CIVIC_MILITARY_PRODUCTION", GC.getTraitInfo(eTrait).getMilitaryProductionModif ier()));
}
{
szHelpString.append(NEWLINE);
szHelpString.append(" ");
szHelpString.append(gDLL->getText("TXT_KEY_CIVIC_MILITARY_PRODUCTION", GC.getTraitInfo(eTrait).getMilitaryProductionModif ier()));
}
When I load the mod, the trait effect shows up in the Civ Select Screen and in the Civilopedia. However, it does not seem to work or show up in game. Could anyone tell me if I'm leaving something out or have something incorrect?
Cheers,
ripple01