So I'm trying to make this mod that will do the seemingly simple task of allowing a user to take a super specialist / great specialist back out of a city after it has joined. Thus allowing a user to store the great person in the city while waiting for that wonder completion / tech research option, then pull back out of the city and use.
I've figured out how to spawn new great people in any city, and figured out how events like onCityBuilt work. What I can't figure out is how is how to actually get interface functions. I'm a long time c++ / c# programmer, so python isn't that tough. I'm just missing some major link between where we make the specialist buttons (CvMainInterface.py or so it would seem) and where the code is that actually increases / decreases the specialist count in the cities.
So question one:
For all you modders who add buttons to the interface: how do you link where you add the button (in your individual screens interface file) and where the button's functionality code executes? Is there some magic XML thing I'm missing where it says "this one goes there, that one goes there"?
--
So I bust out the c++ sdk code for the city (CvCity.cpp / .h) and I can clearly see that there is an exposed "getNumGreatPeople()" and a clearly not exposed "changeNumGreatPeople(int)" Obviously I'd want to expose this to implement my mod. But pretending I bothered, and figured out how to call it (see question one) I can't figure out how the city stores WHICH great people it has. Its an int, and there doesn't appear to be a data structure storing which great people are in the city, only how many. As the different kinds of great people do different things.... WTH?
Is there some other file that provides a global tracking for all great people? (That'd be a horrible way to do this, but I'm reaching here...)
Any guesses out there on where this information is stored?
I've figured out how to spawn new great people in any city, and figured out how events like onCityBuilt work. What I can't figure out is how is how to actually get interface functions. I'm a long time c++ / c# programmer, so python isn't that tough. I'm just missing some major link between where we make the specialist buttons (CvMainInterface.py or so it would seem) and where the code is that actually increases / decreases the specialist count in the cities.
So question one:
For all you modders who add buttons to the interface: how do you link where you add the button (in your individual screens interface file) and where the button's functionality code executes? Is there some magic XML thing I'm missing where it says "this one goes there, that one goes there"?
--
So I bust out the c++ sdk code for the city (CvCity.cpp / .h) and I can clearly see that there is an exposed "getNumGreatPeople()" and a clearly not exposed "changeNumGreatPeople(int)" Obviously I'd want to expose this to implement my mod. But pretending I bothered, and figured out how to call it (see question one) I can't figure out how the city stores WHICH great people it has. Its an int, and there doesn't appear to be a data structure storing which great people are in the city, only how many. As the different kinds of great people do different things.... WTH?
Is there some other file that provides a global tracking for all great people? (That'd be a horrible way to do this, but I'm reaching here...)
Any guesses out there on where this information is stored?