Need help with saves!
Posted: Wed Aug 10, 2022 6:07 pm
Hi all,
Big favor to ask.
I am trying to add saves to my tease and failing miserably. If any of you have the time and expertise, would you be so kind as to look at my effort and tell me how to fix whatever is going wrong.
My save strategy is:
CHECKPOINTS
- Create a dozen or so checkpoints. At each checkpoint, save all variables. This seems to be failing spectacularly. I'm sure I've messed up the phrasing, but I'm not sure how. Current format of those EVAL commands:
MC NAME: teaseStorage.setItem('yourname',yourname)
SAMPLE VARIABLE: teaseStorage.setItem('bi',bi)
Assign a value "checkpoint" which saves the location. This seems to work? It doesn't crash. But it doesn't work for the jump. See below:
checkpoint="morning1"
morning1 is the name of the page of the first checkpoint.
START
- On open, load all variables, starting with a counter that tells the player how many times they've played and the player's MC name. The counter seems to be working. The MC name doesn't.
COUNTER: var counter = teaseStorage.getItem("counter") ||0
MC NAME: yourname=teaseStorage.getItem('yourname')
- Load all other variables. I can't tell if this is working or not.
TYPICAL VARIABLES:
bi=teaseStorage.getItem('bi')
sub=teaseStorage.getItem('sub')
ass=teaseStorage.getItem('ass')
- Allow returning player to jump to their last saved checkpoint. Doesn't work. Freezes game. Command I'm using is:
pages.goto('checkpoint')
Can anyone tell me what I'm doing wrong? If you want to look at the entire tease:
https://milovana.com/webteases/showteas ... fe3c5d1f3a
Thanks in advance!
Big favor to ask.
I am trying to add saves to my tease and failing miserably. If any of you have the time and expertise, would you be so kind as to look at my effort and tell me how to fix whatever is going wrong.
My save strategy is:
CHECKPOINTS
- Create a dozen or so checkpoints. At each checkpoint, save all variables. This seems to be failing spectacularly. I'm sure I've messed up the phrasing, but I'm not sure how. Current format of those EVAL commands:
MC NAME: teaseStorage.setItem('yourname',yourname)
SAMPLE VARIABLE: teaseStorage.setItem('bi',bi)
Assign a value "checkpoint" which saves the location. This seems to work? It doesn't crash. But it doesn't work for the jump. See below:
checkpoint="morning1"
morning1 is the name of the page of the first checkpoint.
START
- On open, load all variables, starting with a counter that tells the player how many times they've played and the player's MC name. The counter seems to be working. The MC name doesn't.
COUNTER: var counter = teaseStorage.getItem("counter") ||0
MC NAME: yourname=teaseStorage.getItem('yourname')
- Load all other variables. I can't tell if this is working or not.
TYPICAL VARIABLES:
bi=teaseStorage.getItem('bi')
sub=teaseStorage.getItem('sub')
ass=teaseStorage.getItem('ass')
- Allow returning player to jump to their last saved checkpoint. Doesn't work. Freezes game. Command I'm using is:
pages.goto('checkpoint')
Can anyone tell me what I'm doing wrong? If you want to look at the entire tease:
https://milovana.com/webteases/showteas ... fe3c5d1f3a
Thanks in advance!