echinococcus
Prince
Excellent. Will the AI understand to use this though?
def cannotGrow(self,argsList):
pCity = argsList[0]
if pCity.getNumRealBuilding(gc.getInfoTypeForString('BUILDING_ICEHOUSE')) > 0:
if pCity.getNumBonuses(gc.getInfoTypeForString('BONUS_MANA_ICE')) *4 > pCity.getPopulation():
return True
return False
def cannotStarve(self,argsList):
pCity = argsList[0]
if pCity.getNumRealBuilding(gc.getInfoTypeForString('BUILDING_ICEHOUSE')) > 0:
if pCity.getNumBonuses(gc.getInfoTypeForString('BONUS_MANA_ICE')) > 4 * pCity.getPopulation():
return True
return False
Edit: I found the problem. It is always something stupid, isn't it. I had changed the name of the building's art file without creating such a file
XienWolf said:While speaking of compilling the DLL though, where does it put the thing? As I read through Kael's post it sounded like it will place it right where the current DLL is, which would mean I sure better make a backup before I make my first attempt (and failure) at compiling my own.
Could someone reupload this? And would anyone be willing to make this a standalone modcomp that can be integrated into BtS?
I was interested in making this a "national wonder" kind of building in my mod, so the python and SDK changes were the main thing I was after (and any changes that have to be made in the XML for all that to work with the assigned building).
Well, I still want it to only work when there's tundra nearby. I've managed to get the SDK and python code inserted, thanks for pointing out the spoiler stuff. I don't suppose you would happen to know how to prevent the building from being built in the first place if the city isn't built within range of the tundra, would you?As Magister said, if you can compile the DLL already, the changes are listed in the first post. The Python would need adjusting to refer to your National Wonder rather than "BUILDING_ICEHOUSE" and you can remove any reference to the terrain types.
Well, I still want it to only work when there's tundra nearby. I've managed to get the SDK and python code inserted, thanks for pointing out the spoiler stuff. I don't suppose you would happen to know how to prevent the building from being built in the first place if the city isn't built within range of the tundra, would you?
if ( eBuilding == gc.getInfoTypeForString("BUILDING_ICEHOUSE") ):
### find taiga within the city radius controlled by your team ###
pPlayer = gc.getPlayer(pCity.plot().getOwner())
iPID = pPlayer.getID()
iTID = pPlayer.getTeam()
iX = pCity.getX()
iY = pCity.getY()
for iXLoop in range(iX - 2, iX + 3, 1):
for iYLoop in range(iY - 2, iY + 3, 1):
pPlot = CyMap().plot(iXLoop, iYLoop)
if ( pPlot.isPlayerCityRadius(iPID)==true ):
if ( pPlot.getTeam()==iTID ):
if ( pPlot.[b]isTundra()[/b]==true ):
return False
return True
I'm trying to model this after the Machu Picchu mod, but I'm having trouble finding the correct function of pPlot to use. I've highlighted the part that I'm pretty sure I have wrong.
Code:if ( eBuilding == gc.getInfoTypeForString("BUILDING_ICEHOUSE") ): ### find taiga within the city radius controlled by your team ### pPlayer = gc.getPlayer(pCity.plot().getOwner()) iPID = pPlayer.getID() iTID = pPlayer.getTeam() iX = pCity.getX() iY = pCity.getY() for iXLoop in range(iX - 2, iX + 3, 1): for iYLoop in range(iY - 2, iY + 3, 1): pPlot = CyMap().plot(iXLoop, iYLoop) if ( pPlot.isPlayerCityRadius(iPID)==true ): if ( pPlot.getTeam()==iTID ): if ( pPlot.[b]isTundra()[/b]==true ): return False return True
bool isWater ()
bool isFlatlands ()
bool isHills ()
bool isPeak ()
if ( eBuilding == gc.getInfoTypeForString("BUILDING_ICEHOUSE") ):
### find taiga within the city radius controlled by your team ###
pPlayer = gc.getPlayer(pCity.plot().getOwner())
iPID = pPlayer.getID()
iTID = pPlayer.getTeam()
iX = pCity.getX()
iY = pCity.getY()
for iXLoop in range(iX - 2, iX + 3, 1):
for iYLoop in range(iY - 2, iY + 3, 1):
pPlot = CyMap().plot(iXLoop, iYLoop)
if ( pPlot.isPlayerCityRadius(iPID)==true ):
if ( pPlot.getTeam()==iTID ):
if ( pPlot.getTerrainType() == gc.getInfoTypeForString('TERRAIN_TUNDRA' ):
return False
return True
Ah, Ok. So, using that, would I be correct with this code?
And thanks for all the assistance you've been providing.
if (pCity.canWork(pPlot)):
if ( pPlot.isPlayerCityRadius(iPID)==true ):
if ( pPlot.getTeam()==iTID ):
Damn, it seems my code causes an OOS error in multiplayer. Any idea how to get around this?