is CvGlobals Deinitialized when I return to the main menu?

Afforess

The White Wizard
Joined
Jul 31, 2007
Messages
12,239
Location
Austin, Texas
I need a safe spot to store information between actual games, so that it's still there when I exit to the main menu and launch another game. Would arrays in CvGlobals be safe?
 
The only way to do this is to use the scriptdata fields, for example on CvGame or CvPlot. Many mods do this using the "pickle" capability in sdtoolkit or bugdata. You can search for these keywords on the forum to read many previous discussions.
 
it is Deinitialized

Really? Dang. Hmm, so it appears I'll have to store the info in the CvInfos after all. What a hassle.

The only way to do this is to use the scriptdata fields, for example on CvGame or CvPlot. Many mods do this using the "pickle" capability in sdtoolkit or bugdata. You can search for these keywords on the forum to read many previous discussions.

CvGame, and later, CvPlot, only exist once a game has been created. I need to store information when no games are yet in play.
 
Can you describe more about what you are trying to do? It seems that you may want to think of this as configuration data, which is stored in ini files by BUG.
 
It's okay, I just added new arrays in CvTechInfos. I have a dynamic tech tree, so gameoptions might remove era's worth of techs, or change the prereqs around. I needed a way to restore the tech tree if the user went to the main menu, and then started a game with different options, w/o reloading the XML.
 
Back
Top Bottom