[PYTHON] Module as a gameoption

I don't think it's possible to conditionally load XML, because XML is loaded by the executable as far as I know. The intent behind modules is providing variable content on install time, not at runtime.

I haven't worked with Python in modules much, because it's hard to have truly modular Python in the first place. But I guess you could make the root import conditional on some game option without problems.
 
hey,

well i ended up doing this:

def onBeginGameTurn(self, argsList):
'Called at the beginning of the end of each turn'
iGameTurn = argsList[0]
## Barbarian Civ ##
if (gc.getGame().isOption(GameOptionTypes.GAMEOPTION_BARBARIAN_CIV)):
BarbCiv.BarbCiv().checkBarb()
## Barbarian Civ ##
CvTopCivs.CvTopCivs().turnChecker(iGameTurn)

added the option in the dll.
at least it wont fire the functions if a player decided not to play with it.
 
Top Bottom