Is there a way to only trigger code if an autosave is available in sugarcube?
I have a load autosave button on my start screen that I only want to do stuff if the autosave is there, like e.g. stop the start screen music.
I tried just putting this code in the autosave passage but I realised that the autosave would reset any variables to their states at load so that didn't work too well since I couldn't control it with a variable from the start screen.
EDIT: The second thing would be more useful as then I can activate code immediately after any autosave load. Is there a way to have a persistent variable across an autosave trigger?
EDIT: I just read about "if (SaveSystem.autosaveOK()) { /* Code to manipulate the autosave. */ }" though still need to work out how to use this.
Comments
Is what you probably want.
As in:
What else exactly to do you want to add in?
looked weird, and that's because that's sugarcube 1 syntax. If you're running sugarcube 1, you should upgrade if you can. If you can't (like your project is already done or something), I think
Is the sugarcube 1 equivalent.
Also. I'm assuming the code you're referring to is TwineScript, but I'll give examples of both.
Using it in TwineScript:
Using it in JavaScript: