Hi,
I'm working away on a new modmod and modular python is wrecking my head.
I have modular onGameStart and onCityGrowth functions working. Every other bit of modular python (onBeginPlayerTurn, onBuildingBuilt, onCityBuilt, onImprovementDestroyed, onUnitBuilt, onUnitKilled and onUnitCreated) I've tried to set up does not seem to get triggered at all.
Even copying entire working modular python files from my working modules and then deleting down to just one simple command doesn't work.
Below is some very simple test code from onUnitBuilt just to give a promotion to a unit which does not work.
Does anyone have any idea why it might not triggering or has anyone had any previous problems with getting the modular python to work?
I'm working away on a new modmod and modular python is wrecking my head.
I have modular onGameStart and onCityGrowth functions working. Every other bit of modular python (onBeginPlayerTurn, onBuildingBuilt, onCityBuilt, onImprovementDestroyed, onUnitBuilt, onUnitKilled and onUnitCreated) I've tried to set up does not seem to get triggered at all.
Even copying entire working modular python files from my working modules and then deleting down to just one simple command doesn't work.
Below is some very simple test code from onUnitBuilt just to give a promotion to a unit which does not work.
Spoiler :
Code:
from CvPythonExtensions import *
import CvUtil
import CvScreensInterface
import CvDebugTools
import CvWBPopups
import PyHelpers
import Popup as PyPopup
import CvCameraControls
import CvTopCivs
import sys
import CvWorldBuilderScreen
import CvAdvisorUtils
import CvTechChooser
import pickle
import CvIntroMovieScreen
import CustomFunctions
# globals
cf = CustomFunctions.CustomFunctions()
gc = CyGlobalContext()
localText = CyTranslator()
PyPlayer = PyHelpers.PyPlayer
PyInfo = PyHelpers.PyInfo
getInfoType = gc.getInfoTypeForString
getPlot = CyMap().plot
getPlayer = gc.getPlayer
def onUnitBuilt(self, argsList):
pCity = argsList[0]
pUnit = argsList[1]
#
iWeak = getInfoType('PROMOTION_WEAK')
pUnit.setHasPromotion(iWeak, True)
#
Does anyone have any idea why it might not triggering or has anyone had any previous problems with getting the modular python to work?