Pir Lan Tota
Warlord
Hi guys,
so made mod for 3.17 (dvd version) of game by modding straight into the game files, not using a seperate MOD to load.
I am now building it into a proper mod that can be loaded seperately, which works, but the python code that works in 3.17 doesnt work in 3.19 (steam version). The code was already corrected by Nightinggale (Thanks again!), but somehow doesnt seem to trigger.
The code I am using in CvEventManager.py
https://forums.civfanatics.com/threads/plant-forest-mod-cant-get-it-to-work.621068/
I have attached the mod below. The code should trigger the changing of tree_nursery improvement into a forest.
so made mod for 3.17 (dvd version) of game by modding straight into the game files, not using a seperate MOD to load.
I am now building it into a proper mod that can be loaded seperately, which works, but the python code that works in 3.17 doesnt work in 3.19 (steam version). The code was already corrected by Nightinggale (Thanks again!), but somehow doesnt seem to trigger.
The code I am using in CvEventManager.py
https://forums.civfanatics.com/threads/plant-forest-mod-cant-get-it-to-work.621068/
I have attached the mod below. The code should trigger the changing of tree_nursery improvement into a forest.
PHP:
def onImprovementBuilt(self, argsList):
'Improvement Built'
iImprovement, iX, iY = argsList
iForestType = CvUtil.findInfoTypeNum(gc.getFeatureInfo, gc.getNumFeatureInfos(),'FEATURE_FOREST')
iNursery = CvUtil.findInfoTypeNum(gc.getImprovementInfo,gc.getNumImprovementInfos(),'IMPROVEMENT_TREE_NURSERY')
if (iImprovement == iNursery):
pPlot = CyMap().plot(iX, iY)
pPlot.setFeatureType(iForestType, -1)
pPlot.setImprovementType(-1)
if (not self.__LOG_IMPROVEMENT):
return
CvUtil.pyPrint('Improvement %s was built at %d, %d'
%(PyInfo.ImprovementInfo(iImprovement).getDescription(), iX, iY))