Hi,
I am trying to change the AI's attitude towards the player in python but it seems like whatever I try it jsut doesn't work. I have the following code but it never gets into the if loop
It never seems to go into the inner if loop. Also is there a function called AI_changeAttitude by any chance ? I didn't find it on
http://civilization4.net/files/modding/PythonAPI/
Are there any other ways to modify the AI attitude in runtime.
Thanks
I am trying to change the AI's attitude towards the player in python but it seems like whatever I try it jsut doesn't work. I have the following code but it never gets into the if loop
Code:
def changeAIAttitude(self, iPlayer):
# change the AI attitude towards the active player
player = gc.getPlayer(iPlayer)
if(player.isHuman() == False):
player = gc.getPlayer(iPlayer)
# get the attitude of the AI to player
attitude = player.AI_getAttitude(gc.getPlayer(0).getID())
print "Change AI Attitude called"
[b]# Never gets in here[/b]
# whatever the attitude - do something
if(attitude != AttitudeTypes.ATTITUDE_FURIOUS):
iAttitude = player.AI_getAttitudeExtra(gc.getPlayer(0).getID())
print "Attitude"
print attitude
player.AI_changeAttitudeExtra(gc.getPlayer(0).getID(), 100)
print "Attitude"
print player.AI_getAttitudeExtra(gc.getPlayer(0).getID())
return
It never seems to go into the inner if loop. Also is there a function called AI_changeAttitude by any chance ? I didn't find it on
http://civilization4.net/files/modding/PythonAPI/
Are there any other ways to modify the AI attitude in runtime.
Thanks