3J is correct about folks not being likely to use a Restart Link vs. the Back Button (that’s why so few have ever finished the Jurassic Fairview Park game, hehehe). If you really want to try it though, it might be doable without too much trouble if you use a Global Script.
Hint – Don’t worry about creating all the New Saved Variables in the Variables Page. You can skip that when using Scripts.
Let’s try this with an example list of Variables:
%HEALTH
%AGE
%FRIENDS
%ENEMIES
%DRAMA
%GOLD
At the start of each new Chapter, I want to take a snapshot of these and have them reset when I click on a ‘Restart’ Link that takes me back to the Chapter in Question.
First, I’ll make a note of the Page# of the Staring Page of all the Chapters I want ‘Restartable’. Let’s say:
Chapter 1: Page 1; Chapter 2: Page 200; Chapter 3: Page 300; & Chapter 4: Page 400
Next, I create a Global Script: (where ZZVARIABLE is the Saved version of the Variable I want to reset)
IF $PAGEID = 1 THEN
BEGIN
%ZZHEALTH := %HEALTH
%ZZAGE := %AGE
%ZZFRIENDS := %FRIENDS
%ZZENEMIES := %ENEMIES
%ZZDRAMA := %DRAMA
%ZZGOLD := %GOLD
END
IF $PAGEID = 200 THEN
BEGIN
%ZZHEALTH := %HEALTH
%ZZAGE := %AGE
%ZZFRIENDS := %FRIENDS
%ZZENEMIES := %ENEMIES
%ZZDRAMA := %DRAMA
%ZZGOLD := %GOLD
END
IF $PAGEID = 300 THEN
BEGIN
%ZZHEALTH := %HEALTH
%ZZAGE := %AGE
%ZZFRIENDS := %FRIENDS
%ZZENEMIES := %ENEMIES
%ZZDRAMA := %DRAMA
%ZZGOLD := %GOLD
END
IF $PAGEID = 400 THEN
BEGIN
%ZZHEALTH := %HEALTH
%ZZAGE := %AGE
%ZZFRIENDS := %FRIENDS
%ZZENEMIES := %ENEMIES
%ZZDRAMA := %DRAMA
%ZZGOLD := %GOLD
END
Then with that in place, I use a Link Script on my Reset Chapter Pages: NOTE – do not use a RESET GAME LINK – Use a Standard Link to the Page or by $DEST := @PXX (as a RESET GAME link will reset the ZZVARIABLE to 0, while a Standard Link will retain the Value).
%HEALTH := %ZZHEALTH
%AGE := %ZZAGE
%FRIENDS := %ZZFRIENDS
%ENEMIES := %ZZENEMIES
%DRAMA := %ZZDRAMA
%GOLD := %ZZGOLD
This should work for Links in the Current Chapter back to the Beginning of the Current Chapter. Links back to Previous Chapters are also possible, but each would require its own set of Save Variables in the Global Script.
For Example:
IF $PAGEID = 1 THEN
BEGIN
%C1HEALTH := %HEALTH
%C1AGE := %AGE
%C1FRIENDS := %FRIENDS
%C1ENEMIES := %ENEMIES
%C1DRAMA := %DRAMA
%C1GOLD := %GOLD
END
IF $PAGEID = 200 THEN
BEGIN
%C2HEALTH := %HEALTH
%C2AGE := %AGE
%C2FRIENDS := %FRIENDS
%C2ENEMIES := %ENEMIES
%C2DRAMA := %DRAMA
%C2GOLD := %GOLD
END
IF $PAGEID = 300 THEN
BEGIN
%C3HEALTH := %HEALTH
%C3AGE := %AGE
%C3FRIENDS := %FRIENDS
%C3ENEMIES := %ENEMIES
%C3DRAMA := %DRAMA
%C3GOLD := %GOLD
END
IF $PAGEID = 400 THEN
BEGIN
%C4HEALTH := %HEALTH
%C4AGE := %AGE
%C4FRIENDS := %FRIENDS
%C4ENEMIES := %ENEMIES
%C4DRAMA := %DRAMA
%C4GOLD := %GOLD
END