OrionVeteran
Deity
I am trying to create a new tag in CIV4PromotionInfos.xml for a prerequisite project.
I added all the XML and SDK code below and compiled the DLL successfully.
Note: I had to use a read pass for the game to load properly.
What have I left out or done wrong?
CIV4PromotionInfos.xml
For all promotions:
<ProjectPrereq>NONE<ProjectPrereq>
Changed two "nuclear" promotions to require:
<ProjectPrereq>PROJECT_MANHATTAN_PROJECT<ProjectPrereq>
CIV4UnitSchema.xml
<ElementType name="PromojectPrereq" content="textOnly"/>
<element type="PromojectPrereq"/>
SevoPediaPromotion.py
eProject = gc.getPromotionInfo(self.iPromotion).getProjectPrereq()
CyInterface().addImmediateMessage(str(eProject), "")
if (eProject > -1):
screen.attachImageButton(panelName, "", gc.getProjectInfo(eProject).getButton(), GenericButtonSizes.BUTTON_SIZE_CUSTOM, WidgetTypes.WIDGET_PEDIA_JUMP_TO_PROJECT, eProject, 1, False)
The message comes back with a -1 for any promotion including the two I changed to PROJECT_MANHATTAN_PROJECT.
CvInfos.h
int getProjectPrereq() const;
int m_iProjectPrereq;
CvInfos.cpp
m_iProjectPrereq(NO_PROJECT),
int CvPromotionInfo::getProjectPrereq() const
{
return m_iProjectPrereq;
}
stream->Read(&m_iProjectPrereq);
stream->Write(m_iProjectPrereq);
CvPromotionInfo::ReadPass2:
pXML->GetChildXmlValByName(szTextVal, "ProjectPrereq");
m_iProjectPrereq = GC.getInfoTypeForString(szTextVal);
CyInfoInterface1.cpp
.def("getProjectPrereq", &CvPromotionInfo::getProjectPrereq, "int ()")
CvUnit.cpp
Under canAcquirePromotion:
ProjectTypes eProject = (ProjectTypes)GC.getPromotionInfo(ePromotion).getProjectPrereq();
if (eProject != NO_PROJECT)
{
if (GET_TEAM(getTeam()).getProjectCount((ProjectTypes)eProject) < 1)
{
return false;
}
}
I added all the XML and SDK code below and compiled the DLL successfully.
Note: I had to use a read pass for the game to load properly.
What have I left out or done wrong?
CIV4PromotionInfos.xml
Spoiler :
For all promotions:
<ProjectPrereq>NONE<ProjectPrereq>
Changed two "nuclear" promotions to require:
<ProjectPrereq>PROJECT_MANHATTAN_PROJECT<ProjectPrereq>
CIV4UnitSchema.xml
Spoiler :
<ElementType name="PromojectPrereq" content="textOnly"/>
<element type="PromojectPrereq"/>
SevoPediaPromotion.py
Spoiler :
eProject = gc.getPromotionInfo(self.iPromotion).getProjectPrereq()
CyInterface().addImmediateMessage(str(eProject), "")
if (eProject > -1):
screen.attachImageButton(panelName, "", gc.getProjectInfo(eProject).getButton(), GenericButtonSizes.BUTTON_SIZE_CUSTOM, WidgetTypes.WIDGET_PEDIA_JUMP_TO_PROJECT, eProject, 1, False)
The message comes back with a -1 for any promotion including the two I changed to PROJECT_MANHATTAN_PROJECT.
CvInfos.h
Spoiler :
int getProjectPrereq() const;
int m_iProjectPrereq;
CvInfos.cpp
Spoiler :
m_iProjectPrereq(NO_PROJECT),
int CvPromotionInfo::getProjectPrereq() const
{
return m_iProjectPrereq;
}
stream->Read(&m_iProjectPrereq);
stream->Write(m_iProjectPrereq);
CvPromotionInfo::ReadPass2:
pXML->GetChildXmlValByName(szTextVal, "ProjectPrereq");
m_iProjectPrereq = GC.getInfoTypeForString(szTextVal);
CyInfoInterface1.cpp
Spoiler :
.def("getProjectPrereq", &CvPromotionInfo::getProjectPrereq, "int ()")
CvUnit.cpp
Spoiler :
Under canAcquirePromotion:
ProjectTypes eProject = (ProjectTypes)GC.getPromotionInfo(ePromotion).getProjectPrereq();
if (eProject != NO_PROJECT)
{
if (GET_TEAM(getTeam()).getProjectCount((ProjectTypes)eProject) < 1)
{
return false;
}
}
Last edited: