Basic Python Help

isau

Deity
Joined
Jan 15, 2007
Messages
3,071
Hey guys,

I'm working on an expansion pack style mod. I've had an easy time modding the XML files to add new features. The next step for me is starting work on Python and possibly the core .dll as well.

I think I'm missing something critical about Python, though. I understand how to change functions that are already defined in Python. What I am totally not getting is how to implement functions that are "exposed to Python" from the C++, but don't already have a definition in the .py files. Or is this even possible?

Specifically, the function I need to override is countVote (defined in the C++ files in class CvGame.) I can see the function's definition in CvGame.cpp and that it is exposed to Python in CyGame.h, but have had no luck interacting with it from Python. What I am trying to do is change the way votes are counted up (apply a penalty for leaders with certain traits).

Any help you guys can give would be awesome.
 
Exposed to python means python can access it. It doesn't mean that python can override it. Most of the functions you can override are in CvGameUtils.py. If it's not there you might have to do it in the SDK.
 
Top Bottom