EmperorFool
Deity
If the city is never in a "packed up" state, meaning each time it moves one tile the city is created anew with all the buildings, there's no reason to ever pickle its attributes.
baldyr said:Yeah, you should only pickle onPreSave and unpickle onPreLoad (or whatever). The data needs to be stored somewhere in the meanwhile though.
Just out of curiosity: How hard would it be to make something like a simplified CyCity class in the SDK? Because I've always wanted to have colonies as proto-cities - without population points, food bar, culture, only a few possible building classes, et cetera. Like a CyColony class, I guess.
Yeah, I used the wrong prefix. What exactly is Cv and Cy short for?This is possible without a new CvColony class (would be Cv, not Cy- Cy is the stuff exposed to Python). I think it's also pretty easy. You would add two booleans, one to CvCity and one to CvBuildingInfo. The one in CvCity declares a city as a colony, the one in CvBuildingInfo would be a new tag for buildings that declares a building buildable in a colony.
Its not.Although, I'm not seeing how this is relevant...
pCity.getNumBuilding()
pCity.getNumGreatPeople()
pCity.getPopulation()
pCity.getScriptData()
pCity.isCapital()
iNumBuiding = pCity.getNumBuilding()
iNumGreatPeople = pCity.getNumGreatPeople()
iPopulation = pCity.getPopulation()
scriptData = pCity.getScriptData()
bIsCapital = pCity.isCapital()
Excellent advice, as always. I try to listen whenever the EmperorFool is handing out advice.For learning Python I have been recommending How to Think Like a Computer Scientist, a free online book that uses Python to teach beginning programming. This project of yours is pretty ambitious. It's not too complicated, but it is quite different from the other mods I've seen. As such you won't be able to modify existing code to do it, so you're best off learning some Python first. Take a weekend and go through what you can in the book, post some questions, and see where you land.