Is it possible to manually load and save the game.

General Tso

Panzer General
Joined
Oct 12, 2007
Messages
1,547
Location
U. S. of A.
Would it be possible for me to manually load and save the game at certain spots? I would like to display a message like "Saving current map" and then save the game without any user input. Then have a popup available that allows the player to restart the current map (i.e. load a game). To do this I need to be able to manually load and save a game without user input (other than requesting a map restart). Is this possible?
 
Not without creating a custom DLL. BUG and BULL have an AutoSave feature that does the first part (save the game automatically at certain points). BULL exposes the function to Python, and BUG calls it from various events.
 
Not without creating a custom DLL. BUG and BULL have an AutoSave feature that does the first part (save the game automatically at certain points). BULL exposes the function to Python, and BUG calls it from various events.

Thanks, I will check it out. However, I just started working with the SDK recently, so I'm somewhat new at it. If you (or anybody else) could give me a more detailed explanation of where to start, I'd greatly appreciate it.
 
CvDLLEngineIFaceBase.h declares CvDLLEngineIFaceBase::SaveGame(CvString& szFilename, SaveGameTypes eType) which you can call. This is what BULL uses. It also defines LoadGame() and QuickLoad() along with other related functions, but I don't see a LoadGame() that takes a file name. Perhaps you'll get lucky and QuickLoad() will load whatever game was last saved with SaveGame()?
 
Thanks, maybe I can disable QuickSave and QuickLoad from being used directly by the player and then use them for map reloading. Now all I have to do is figure out how to generate a QuickSave from my Python code that starts a new map. The new map is loaded during the human player's turn, and can happen at any time during the turn. Is there a way to manually call code within the SDK from Python?
 
Top Bottom