*comment The below command stores all your variables in their current state *gosub_scene savegame save [b]Chapter 3[/b] You've reached Chapter 3. Your progress from earlier in the game has been saved. This chapter shows how to place checkpoints within a scene file. When using checkpoints within a scene file, you must declare the variables using [b]*create[/b] in startup, not [b]*temp[/b]. An example selection of choices and checkpoints follows. *page_break *comment If you are loading to anywhere that isn't the start of the scene, use *label as below *label butterfly *comment The below command stores all your variables in their current state *gosub_scene savegame save You walk along a path and see a lovely butterfly. *fake_choice #Catch it. *set butterfly_caught true #Admire it. #Continue. *if butterfly_caught You caught the butterfly! *if (not(butterfly_caught)) You didn't catch the butterfly. *fake_choice #Restart the section about the butterfly. *comment The below command restores your variables to the state they were at line 19: the last time the command *gosub_scene savegame save was run *gosub_scene savegame load *comment The below command moves the player to line 16: *label butterfly *goto_scene chapter_3 butterfly #Save and continue. *comment If you are loading to anywhere that isn't the start of the scene, use *label as below *label meet_dog *hide_reuse *comment The below command stores all your variables in their current state *gosub_scene savegame save This section uses [b]*hide_reuse[/b] to avoid repeated options. *label meet_dog_choice *if met_dog The dog barks happily. *if (not(met_dog)) As you're walking along, you meet a friendly dog. *set met_dog true *fake_choice #Pet the dog. *set dog_petted true You pet the dog. *goto meet_dog_choice #Throw a stick for the dog. You throw a stick for the dog. *if dog_petted He's extra excited because you petted him before. *goto meet_dog_choice #Walk on. You walk further down the path. *fake_choice #Restart the section about meeting the dog. *comment The below command restores your variables to the state they were at line 46: the last time the command *gosub_scene savegame save was run *gosub_scene savegame load *comment The below command moves the player to line 42: *label meet_dog *comment Make sure to use *goto_scene, not *goto. If you use [b]*goto[/b], the commands [b]*hide_reuse[/b] and [b]*disable_reuse[/b] will not work correctly *goto_scene chapter_3 meet_dog #Save and continue. *page_break *label meet_dog_again *comment The below command stores all your variables in their current state *gosub_scene savegame save This section uses [b]*disable_reuse[/b] to avoid repeated options. When you come back, the dog rolls on its back excitedly. *label meet_dog_again_choice *disable_reuse *fake_choice #Pat the dog's head. *goto meet_dog_again_choice #Give the dog a treat. *goto meet_dog_again_choice #Walk on. You carry on your way. *fake_choice #Restart the section about meeting the dog for the second time. *comment The below command restores your variables to the state they were at line 81: the last time the command *gosub_scene savegame save was run *gosub_scene savegame load *comment The below command moves the player to line 79: *label meet_dog_again *comment Make sure to use *goto_scene, not *goto. If you use [b]*goto[/b], the commands [b]*hide_reuse[/b] and [b]*disable_reuse[/b] will not work correctly *goto_scene chapter_3 meet_dog_again #Save and continue. *comment The below command stores all your variables in their current state *gosub_scene savegame save Then you continue on your way. And that's it! To view the code for this template, go *link https://dashingdon.com/play/hannahps/savepoint-example/mygame/scenes here. *ending