Louis the XIV
Sun King
I'm trying to add the plague in civ 4 bts by creating a modcomp.
But whenever I right the following code I get an error in which it tells me that I need an attribute.
Here is the original code I wrote under the city built [argslist]:
And here is the error it gave me:
Then I tried giving it an attribute like this:
But then when I load up the game, the game gives me a python error in which it says that it has no attribute and it still doesn't work.
If anyone knows how to add an attribute I really really really really really really really need help!
But whenever I right the following code I get an error in which it tells me that I need an attribute.
Here is the original code I wrote under the city built [argslist]:
Code:
city = argsList[0]
##--------PLAGUE END: spreading to founded cities
pUnit = gc.getInfoTypeForString("UNIT_SETTLER")
if pUnit.isHasPromotion(gc.getInfoTypeForString("PROMOTION_PLAGUE")):
city.setHasRealBuilding(iPlague, True)
##--------PLAGUE END: spreading to founded cities
if (city.getOwner() == gc.getGame().getActivePlayer()):
Then I tried giving it an attribute like this:
Code:
'vassalState' : self.onVassalState,
'changeWar' : self.onChangeWar,
'setPlayerAlive' : self.onSetPlayerAlive,
'playerChangeStateReligion' : self.onPlayerChangeStateReligion,
'playerGoldTrade' : self.onPlayerGoldTrade,
'windowActivation' : self.onWindowActivation,
'gameUpdate' : self.onGameUpdate, #sample generic event
### PLAGUE START ### PLAGUE START
'isHasPromotion' : self.onisHasPromotion,
} ### PLAGUE END ### PLAGUE END
If anyone knows how to add an attribute I really really really really really really really need help!