my cool save/load stuff goes wonky :(

Hiya!

This should give my saving and restoring some flair - and i can offer a quit after saving that won’t fuck with the restore afterwards - but … i want it to say “welcome back” when you restore a game, and now it just says a flat “Ok.”
[rant][code]report restoring the game:
stop the action;
clear the screen;
say line break;
say line break;
say line break;
say “[note style]Welcome back!”;
say line break;
say line break;
say line break;
wait for any key;
clear the screen;
say line break;
say line break;
say line break;
say line break;
try looking.

Check quitting the game:
clear the screen;
say line break;
say line break;
say line break;
say “[note style]QUIT THE STORY?”;
say “[note style]Are you certain you wish to quit?”;
say “[note style](unsaved progress will be lost)”;
say line break;
say “[note style]>”;
if player consents:
say line break;
say “[note style]THANK YOU FOR PLAYING”;
say line break;
stop game abruptly;
otherwise:
clear the screen;
say line break;
say line break;
say line break;
try looking;
stop the action.

save the game rule response (B) is “[fancy_savegame]”.

To say fancy_savegame:
clear the screen;
say line break;
say line break;
say line break;
say “[note style]CONTINUE?”;
say “[note style]Do you wish to continue playing??”;
say “[note style](unsaved progress will be lost)”;
say line break;
say “[note style]>”;
if player consents:
clear the screen;
say line break;
say line break;
say line break;
try looking;
otherwise:
say line break;
say “[note style]THANK YOU FOR PLAYING”;
say line break;
say “[note style][’][story title][’]”;
say line break;
say “[note style][’][story author][’]”;
say line break;
stop game abruptly.[/code][/rant]
plz help me fix it. :frowning:

It’s the same hack as in the “save the game rule response (B)”. Don’t use “report restoring”; instead, change the reponse for successfully restoring to, say, [fancy_restore] and then define To say fancy_restore as doing the things you want to do. It’s the same principle.

EDIT - Huh, you use a lot of [note style] changes but never revert to [roman style]. Don’t you find that after you save the rest of the text of the game is all in [note style] (whatever that is, I’m guessing an extension?) until it reaches the next formatting?

…then again, a room name is in BOLD, so if you hit a room name it will automatically put things right.

ANYWAY, my point is, you may want to consider having [roman style] after you’re done with all your fancy formatting, to avoid surprises later.

Specifically, I think after you’ve restored the game state has reverted to the state of the saved game. So the “report restoring” rule doesn’t run.

Totally spit-balling here, but if the issue is the save game restoring the memory, thus cutting of the Report, then I think maybe the extension “Permadeath” has the answer. It uses random number tables to compare whether or not a save game is an original run or not.

My point is that you could have an Every Turn check to see whether or not the save state is an original run and then if it’s not, print the “Welcome back…” message.

Hopefully that makes sense.

The other approach (and I don’t know if this is possible) would be to store the system time as a variable, then have an Every Turn statement that checks that variable against the current (real) system time, and if it’s off by (say) 2 minutes then print the “Welcome back…” message and refresh the stored time variable.

Maybe.

These are the relevant rule response texts. You can change the text of them to whatever you want.

The quit the game rule response (A) is "Are you sure you want to quit? ". The save the game rule response (A) is "Save failed.". The save the game rule response (B) is "Ok.". The restore the game rule response (A) is "Restore failed.". The restore the game rule response (B) is "Ok.". The restart the game rule response (A) is "Are you sure you want to restart? ". The restart the game rule response (B) is "Failed.".

Hope this helps.

Note that “restore the game rule response (B)” is what gets printed after a successful restore. The VM is actually inside the “save the game rule” at that point, but you still want to customize that response.

Sorry for the necro, but are these listed anywhere? I looked all over the index and couldn’t find them.

You can check the standard rules, or type RESPONSES ALL in the IDE.

1 Like

Ah, didn’t know that command exists. Thanks!

1 Like