TC01
Deity
So, how exactly do I do this?
I'm using the following code to do this for buildings:
However, there is not a isCivilizationFreeUnitClass() function. Instead, there is a getCivilizationFreeUnitsClass() function. What I don't get is how to use it. What does it return? I get that I would do this:
What I'm not sure about is how to translate val to the unit type of the free unit class. I'm pretty sure it's not just returning the unit type of the free unit class- since that doesn't seem to be working.
I'm using the following code to do this for buildings:
Code:
pCiv = gc.getCivilizationInfo(pPlayer.getCivilizationType())
for iBuildingClass in range(gc.getNumBuildingClassInfos()):
if iBuildingClass != gc.getInfoTypeForString("BUILDINGCLASS_CAPITOL"):
if pCiv.isCivilizationFreeBuildingClass(iBuildingClass):
iBuilding = pCiv.getCivilizationBuildings(iBuildingClass)
pCity.setNumRealBuilding(iBuilding, pCity.getNumRealBuilding(iBuilding) + 1)
pPlanet.setHasBuilding(iBuilding, true)
However, there is not a isCivilizationFreeUnitClass() function. Instead, there is a getCivilizationFreeUnitsClass() function. What I don't get is how to use it. What does it return? I get that I would do this:
Code:
for iUnitClass in range(gc.getNumUnitClassInfos()):
val = pCiv.getCivilizationFreeUnitsClass(iUnitClass)
What I'm not sure about is how to translate val to the unit type of the free unit class. I'm pretty sure it's not just returning the unit type of the free unit class- since that doesn't seem to be working.