Super Easy Checkpoint Saving [Updated]

All's cool here (kinda)

Okay, you’ll hate this. I spent like 4 hours today driving to my grandparent’s and another 4 back so I couldn’t really work on it today but while I was in the pool it took me three second of thinking over what you said in your last post and I found the solution/problem (hopefully)

long story short:

But in the function it takes save_num and changes it.

end of long/short story. I’ll have to test using a new *temp instead of save_num so it doesn’t get changed but I think that’s it.


@Szaal That did it! Whoo. Go swimming! I’ve updated the link with the fixed version of twiger_functions (now you can go back to setting the save_num only once). But as I’m testing @Nonvita’s banana thing I get the error bananas line 20: invalid @{} at letter 49; ‘bananas’ is equal to 4 but there are only 3 options
You probably need to check if bananas is above 3 and then end the thing before doing the @{} thing.
Someone needs to explain to me what in the world banana@{bananas |s|s} is/does I’ve never seen @{} or |s|s

Edit: I’m look at the annoncement that explains it here. I kinda understand it but I’m still really confused on the syntax.


Changing the code to this:

2018 Best Seller "Bananas"

*label check_1
*set bananas +1
*set save_num “bananas”
*set save_bananas “~bananas”
*gosub_scene twiger_functions save
*if (bananas < 4)
This is checkpoint 1. You have ${bananas} banana@{bananas |s|s}.

*choice
#Continue.
*goto check_2
#Start over.
*gosub_scene twiger_functions load
*goto check_1

*label check_2
*set bananas +2
*set save_num “morebananas”
*set save_morebananas “~bananas”
*gosub_scene twiger_functions save
*if (bananas < 4)
This is checkpoint 2. You have ${bananas} banana@{bananas |s|s}.

*choice
#Finish.
*if (bananas < 4)
You have ${bananas} banana@{bananas |s|s}. No more bananas for you!
*finish
#Go back.
*gosub_scene twiger_functions load
*goto check_2
#Start over.
*set save_num “bananas”
*gosub_scene twiger_functions load
*goto check_1

I get the error twiger_functions line 243: Non-existent variable ‘’
So I’m back to T_F being goofed.

*set {holder} saves_string is now line 243 which is the one causing the error above so maybe it’s not so perfect.

Welllllll taking out the {} on L243 fixes the error and randomtest passes. (quicktest doesn’t tho. Man I hate quicktest sooo much) HOWEVER the load function stops working.
note: Deleting line 243 (the *set holder after label load7) doesn’t seem to really change anything)

Explanation of why 4 and 7 are different

4 sets holder to the variables name, then by the time 7 happens, 7=the variable’s value. #7 sets the variable in the list to it’s original value which is why 7 must have {} so there must be another solution to the error I’m getting.

haaalllpppp please

@Szaal I think it might have something to do with this:

*if (letter = "") or (letter = "~")
 *goto load4
*else
 *set saves_string (saves_string & letter)
 *goto load3

That might make it so the saves_string (which holder is set to) never gets a value past the initial value of “”
So I added this:

*if holder != ""
 *set {holder} saves_string

But that seems to bring up the problem of the load function not doing anything. I’m still just testing the bananas thing so maybe it’s just that? maybe at least two variables need to be used in the save.