Callbacks not called :)

bilbon_s

Chieftain
Joined
Dec 30, 2006
Messages
7
Hi,

I have made some modification in CvGameUtils.py. I added code to cannotTrain in order to change what players can build in their cities.
To activate the code I set USE_CANNOT_TRAIN_CALLBACK to 1 in PythonCallbackDefines.xml.
The problem is that the code is still not executed. Did I forgot something ?

Thanks,

Sylvain
 
Does your python code work? Best bet is to add some log messages to your code, then you'll know for sure if it is being called and if it is all working.

To make sure the callback itself is working just add this line:

return True

As the first line of code in cannotTrain, if you can't build any units at all than the callback is working and you need to check your code :)
 
Hi,

Thanks for the tips :).
The result is that my code is working and is called if I change the original game files. But if I just copy the two modded files into my mod directory then it is not working.

The problem come from the mod, good news.
 
Back
Top Bottom