LPlate2
Warlord
- Joined
- Dec 27, 2018
- Messages
- 299
Hi,
I'm trying to create some new arrays in CIV4CivilizationInfos.xml. On checking the existing arrays in this file, I'm not clear on how to call them in python (or at least when I try, I always get a False response). So I don't know if I'm making a mistake in how I set up my arrays in the dll or if its just python errors.
The basic format of the arrays I want to create matches
The bTest in the following python always seems to yield a False response,
Per CvInfos.h,
, so I thought the above should work. What am I doing wrong?
Similarly, can someone give an example of how to use the equivalent integer call, e.g. getCivilizationUnits(int i) in python?
Looking at the arrays configured for CvCivilizationInfo, it seems that for any array in the format above, python is typically only configured to return a boolean or integer
. Is this understanding correct and is there a reason for it?
thanks
I'm trying to create some new arrays in CIV4CivilizationInfos.xml. On checking the existing arrays in this file, I'm not clear on how to call them in python (or at least when I try, I always get a False response). So I don't know if I'm making a mistake in how I set up my arrays in the dll or if its just python errors.
The basic format of the arrays I want to create matches
Spoiler :
Code:
<FreeBuildingClasses>
<FreeBuildingClass>
<BuildingClassType>BUILDINGCLASS_PALACE</BuildingClassType>
<bFreeBuildingClass>1</bFreeBuildingClass>
</FreeBuildingClass>
</FreeBuildingClasses>
The bTest in the following python always seems to yield a False response,
Spoiler :
Code:
infoCiv = gc.getCivilizationInfo(pPlayer.getCivilizationType())
bTest = infoCiv.isCivilizationFreeBuildingClass(0)
if bTest:
Per CvInfos.h,
Code:
DllExport bool isCivilizationFreeBuildingClass(int i) const; // Exposed to Python
Similarly, can someone give an example of how to use the equivalent integer call, e.g. getCivilizationUnits(int i) in python?
Looking at the arrays configured for CvCivilizationInfo, it seems that for any array in the format above, python is typically only configured to return a boolean or integer
Spoiler :
Code:
.def("getCivilizationBuildings", &CvCivilizationInfo::getCivilizationBuildings, "int (int i)")
.def("getCivilizationUnits", &CvCivilizationInfo::getCivilizationUnits, "int (int i)")
.def("getCivilizationFreeUnitsClass", &CvCivilizationInfo::getCivilizationFreeUnitsClass, "int (int i)")
.def("getCivilizationInitialCivics", &CvCivilizationInfo::getCivilizationInitialCivics, "int (int i)")
.def("isLeaders", &CvCivilizationInfo::isLeaders, "bool (int i)")
.def("isCivilizationFreeBuildingClass", &CvCivilizationInfo::isCivilizationFreeBuildingClass, "bool (int i)")
.def("isCivilizationFreeTechs", &CvCivilizationInfo::isCivilizationFreeTechs, "bool (int i)")
.def("isCivilizationDisableTechs", &CvCivilizationInfo::isCivilizationDisableTechs, "bool (int i)")
thanks