Arian
No more ghostbusting!!
Sadly not always, but hopefully often enough.
No, would not, it's still the wrong callbackJust move it over to canConstruct, that should not be a problem in any way.
Edit: Before here was nonsense.
If these callbacks return "False", they just will not have any effect.
In the case here, it returns True in the case a city does not have power, so cities without power can not construct it.
2. edit: this all depends on how you put the building in the XML.
If you can normally build it, then you're right here, then use the cannot construct to restrict it only to certain cities.
If you could normally not build it (due to whatever restrictions, because it's attached to future tech, whatever), then you would have to use the canConstruct callback to allow it for certain cities.
Thanks, it works partially now. The Particle Generator is a World Wonder and when I use canConstruct like this:
Code:
def canConstruct(self,argsList):
pCity = argsList[0]
eBuilding = argsList[1]
bContinue = argsList[2]
bTestVisible = argsList[3]
bIgnoreCost = argsList[4]
### Particle Accelerator begins ###
###########################################################################################
if ( eBuilding == gc.getInfoTypeForString("BUILDING_PARTICLE_ACCELERATOR") ):
### check if city has power ###
##pPlayer = gc.getPlayer(pCity.plot().getOwner())
##iPID = pPlayer.getID()
##iTID = pPlayer.getTeam()
power = pCity.isPower()
if ( power == true ):
return true
return false
###########################################################################################
### Particle Accelerator ends ###
return false
Would this be possible?