Firstly, this is only possible in a full conversion. It is also probably only possible because of the constraint of "disabling save and exit".
"Deleting" saves:
This can be done with some hackery as outlined in the following steps:
- Detect if the player has died
- Set a global variable called "player dead". If the player loads a save and this variable is set, jump to step 3.
- Make N auto-saves in rapid succession (this may have to be on a timer). N is "max number of save files" as defined by "MaxAutoSaves" in "game.cfg", section "saving". You will probably want to reduce N to be about 5 or so (from 20!) to speed up save deletion and not spam file writes too much.
- Transition to a game-over map with the map text "Game over"
- Save N times again (So the player sees "Game over" when they look at the loading screen).
- Do what you want (e.g. ClearSavedMaps() & reset at map 1, using the global variable as a marker to display some "you died the game has restarted" events).
Note: we do N auto-saves before the map transition to prevent the player alt+f4ing the game during the loading screen. The N saves in step 5 are cosmetic (and prevent N saves occuring each time the player loads a dead save).
Stopping "Save and Exit":
This is fairly simple but requires a custom base_english (or whatever language you are using) file:
- Create a copy of base_english.lang file, and point to it using your main_init config file
- Change the "ExitAndSave" entry ("Main Menu" Category) to empty.
Detecting saves:
The following code will detect if a save has been loaded, this is useful in step 1 incase the player quits before the saves had time to be cleared:
bool loaded=true;
void loadTester(string &in asTimer)
{
if(loaded)
{
loaded=false;
/* load has happened */
}
AddTimer(asTimer,0.1f,"loadTester);
}
void OnEnter()
{
loaded=false;
loadTester("loadTimer");
}
Both of these ideas are completely untested - so good luck.