phungus420
Deity
- Joined
- Mar 1, 2003
- Messages
- 6,296
Bah, I didn't succefully get it to run the init or reset functions in Civ4lerts, I was just writing to my file in the SVN, not the mod, so it wasn't even loading up. After actually loading it up, I get errors because of function arguments.
What I think would work, would be to get Civ4lerts to reinitialize after the player is changed. So based on the code here:
should execute the onLoadGame function, but it does not work, because of the arguments. The function for onLoadGame in Civ4lerts is this:
But I have no idea what I"m supposed to put in the arguments. Putting in self, or putting in Civ4lerts.AbstractStatefulAlert as the argument fails, self is aparently undefined (even though it is everywhere in Civ4's python, I can't figure out where it is undefined), and putting in Civ4lerts.AbstractStatefulAlert says it's a class object, and it wants a AbstractStatefulAlert class instance. 
Also trying to run Civ4lerts.AbstractStatefulAlert._init() & Civ4lerts.AbstractStatefulAlert._reset() by themselves the way onLoadGame does also runs into the same argument problems.
What I think would work, would be to get Civ4lerts to reinitialize after the player is changed. So based on the code here:
Code:
def changeHuman( newHumanIdx, oldHumanIdx ) :
##********************************
## LEMMY 101 FIX
##********************************
game.changeHumanPlayer( oldHumanIdx, newHumanIdx )
import Civ4lerts
Civ4lerts.AbstractStatefulAlert.onLoadGame()
##********************************
## LEMMY 101 FIX
##********************************
should execute the onLoadGame function, but it does not work, because of the arguments. The function for onLoadGame in Civ4lerts is this:
Code:
class AbstractStatefulAlert:
"""
Provides a base class and several convenience functions for
implementing an alert that retains state between turns.
"""
...
def onLoadGame(self, argsList):
self._init()
self._reset()
return 0

Also trying to run Civ4lerts.AbstractStatefulAlert._init() & Civ4lerts.AbstractStatefulAlert._reset() by themselves the way onLoadGame does also runs into the same argument problems.