Edgewaters
Chieftain
- Joined
- Dec 5, 2005
- Messages
- 34
I really want to use the code for sacrificing units from the Mesoamerican mod (the one that ships with the game), however, I can't quite get a handle on exactly how Python works. I have a vague idea which parts of the code are responsible for handling that event, but I don't fully understand how I would bring them over to my mod.
For instance, I look at CvMesoAmericanEvents.py and I can see that it's got some stuff at the beginning (to generate random numbers, I think for the epidemic and capture events, and to get surrounding plots, which seems to have something to do with the Spanish invasion) and then there's three "classes", one for epidemic, one for the Spanish invasion, and another for a few features of the mod like capturing units (and sacrifice). I've got a pretty good idea I can cut out two of the classes and parts of the third. But I don't know what I can cut out from the beginning (what do I need to import?)
I also want to know if I could just use a few small parts of the stuff - because it seems that the parts dealing with sacrifice consist of just a few lines - in that file and put them in CvEventManager.
I'm similarly unsure about how to separate just the sacrifice function from the other functions in the other files.
If anyone's got the time, could they walk me through it?
For instance, I look at CvMesoAmericanEvents.py and I can see that it's got some stuff at the beginning (to generate random numbers, I think for the epidemic and capture events, and to get surrounding plots, which seems to have something to do with the Spanish invasion) and then there's three "classes", one for epidemic, one for the Spanish invasion, and another for a few features of the mod like capturing units (and sacrifice). I've got a pretty good idea I can cut out two of the classes and parts of the third. But I don't know what I can cut out from the beginning (what do I need to import?)
I also want to know if I could just use a few small parts of the stuff - because it seems that the parts dealing with sacrifice consist of just a few lines - in that file and put them in CvEventManager.
I'm similarly unsure about how to separate just the sacrifice function from the other functions in the other files.
If anyone's got the time, could they walk me through it?