Modular Python Issues

Lplate

Esus (Allegedly)
Joined
Feb 8, 2011
Messages
578
Location
Ireland
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.

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?
 
Sorted. I'm not sure of the why but found a cure.
I removed one of the other modules and all the new modular python calls seem to be working again.
 
Top Bottom