[SDK] How to store data so it survives the save/load process?

SevenSpirits

Immortal?
Joined
Jul 7, 2007
Messages
512
I'm making a mod which requires storing some random numbers which are chosen at the time of map generation. (They're float arrays, but it hardly matters - I could just store a random seed.)

I have it working, except that of course the information is not saved in save games, or loaded again. Is there any way to do this?

If not, is there perhaps some other unchanging piece of data in the save file I could access and use as a random seed?

Thanks for your help.
 
Never mind - I've answered my own question.

The answer is that several classes, including CvGame (which I used), have private read and write functions. It's straightforward to insert a read and write in those functions, emulating the existing stuff.

Obviously, this breaks save game compatibility.
 
We do this with our BUG mod ... there is an SDKToolKit that someone put together. I'm not at my civ pc at the moment but try searching for SDKtoolkit and see what you find.
 
Back
Top Bottom