I’m trying to implement the new checkpoint save system. I want to allow players to name their saves.
I have followed the instructions given on this forum and the choice-script website and set the saves and restores up in a gosub.
*label save
*temp slot Which slot do you want to save?
*fake_choice
#Slot 1: ${save_name_1}*
*set slot 1*
#Slot 2: ${save_name_2}*
*set slot 2*
#Slot 3: ${save_name_3}*
*set slot 3*
#Cancel*
*return*
What do you want to call your saved game?
*input_text save_name[slot]
*if slot = 1
save_checkpoint slot1
return
*if slot = 2
save_checkpoint slot2
return
*if slot = 3
save_checkpoint slot3
return
label load if (reload) choice selectable_if (choice_saved_checkpoint_slot1) #Slot 1: ${save_name_1}restore_checkpoint slot1 selectable_if (choice_saved_checkpoint_slot2) #Slot 2: ${save_name_2} restore_checkpoint slot2 selectable_if (choice_saved_checkpoint_slot3) #Slot 3: ${save_name_3}
*restore_checkpoint slot3 #Cancel return
else
You have yet to save your game.
*return
The problem is, when a player dies I give them these options. This comes up as an error using quicktest- that a choice must end in a *goto to *finish.
*choice #Reload an earlier save.
*gosub_scene savegame load #Restart.
*ending
I am sure I’m missing something very basic- I didn’t think I should put a *goto under the *gosub line for fear that this would mess with the location of the restore point. I have no idea how the *restore_checkpoint command operates.
Any ideas on what I should do?
Many thanks to you all!
-sorry the formatting is a bit messed up, I didn’t know how it would show and put it all in italics to distinguish it- that’s why there’s all those excess asterisks all over the place
Assuming your code works as intended when you playtest it, try using *fake_choice instead of the *choice for the reload/restart thing that’s throwing the error?
Thanks for the reply. The code works when saving and restoring a game so far (as much as I have tested)- but it doesn’t when I use the restart or reload choice, after a player dies (so usually the choice would be for saving or reloading with no restart option).
I’ll give the *fake_choice a go tomorrow- (bit late for me to start a new mission right now) and post how it goes.
yeah this had me also thinking a bit and honestly pre-named checkpoints like you said might be for the best, on the plus side you have more control over what gets saved and loaded
Making a game knowing that you’ll use the player-named checkpoints would be doable, but shoving it inside a game like mine, without neat chapters, seems very difficult.
What is helpful is that a player can still save over a pre-made checkpoint to keep the restore point up to date on their adventures. This seems a good fit for my game.