I cannot get this to work:
This is supposed to let me switch between the 3 power plants the game offers (build a certain power plant, the previous power plant is removed). This is nearly identical to someone's upgradeable buildings demo in the mod comps section.
The fact that I'm asking for help should indicate that the python code does not work...
Any help would be appreciated =).
Code:
if (gc.getBuildingInfo(iBuildingType).getType() == "BUILDING_COAL_PLANT"):
for i in range(gc.getNumBuildingInfos()):
if (gc.getBuildingInfo(i).getType() == "BUILDING_NUCLEAR_PLANT"):
pCity.setHasRealBuilding(i, False)
if (gc.getBuildingInfo(i).getType() == "BUILDING_HYDRO_PLANT"):
pCity.setHasRealBuilding(i, False)
elif (gc.getBuildingInfo(iBuildingType).getType() == "BUILDING_NUCLEAR_PLANT"):
for i in range(gc.getNumBuildingInfos()):
if (gc.getBuildingInfo(i).getType() == "BUILDING_HYDRO_PLANT"):
pCity.setHasRealBuilding(i, False)
if (gc.getBuildingInfo(i).getType() == "BUILDING_COAL_PLANT"):
pCity.setHasRealBuilding(i, False)
elif (gc.getBuildingInfo(iBuildingType).getType() == "BUILDING_HYDRO_PLANT"):
for i in range(gc.getNumBuildingInfos()):
if (gc.getBuildingInfo(i).getType() == "BUILDING_NUCLEAR_PLANT"):
pCity.setHasRealBuilding(i, False)
if (gc.getBuildingInfo(i).getType() == "BUILDING_COAL_PLANT"):
pCity.setHasRealBuilding(i, False)
This is supposed to let me switch between the 3 power plants the game offers (build a certain power plant, the previous power plant is removed). This is nearly identical to someone's upgradeable buildings demo in the mod comps section.
The fact that I'm asking for help should indicate that the python code does not work...
Any help would be appreciated =).