0 votes
ago by (120 points)
Hey friends!

I use SugarCube 1

Well my problem is basically in the title, it's exactly what i want with the saving system, but i can't figure it out how should i make the restart button actually erase the saves and start from the beginning of the story, instead of course it's restarts from the last passage.

i tried every available methods that i saw in the forums and stuff.

Thanks for the help in advance!

1 Answer

0 votes
ago by (144k points)

note: The 1.x series of SugarCube is no longer being developed and only recieves security/bug fixes, I strongly suggest you switch to using the 2.x series of SugarCube which is still being actively developed. Information about installing the latest release of SugarCube 2 can be found here.

Off hand I can't think of a way to interupt the Restart process so that you can delete the Autosaved slot, so I suggest you change your configuration to use the "prompt" variation of the config.saves.autoload setting which will allow the end-user to choose if they want to load the autosaved slot or not.

config.saves.autoload = "prompt";

 

ago by (120 points)
@greyelf Thank you for your reply, but for me Sugarcube 1 is more flexable, and would be perfect for the story i make.

But there's a way to do it right?
ago by (35.5k points)

I don't see how SugarCube v1 is more flexible than SugarCube v2, considering that v2 can do everything v1 can do and more.

Regardless, you'd probably have to do it using jQuery to remove the event from the "Restart" button, and then add your own event to it which erases the autosave first and then restarts.  This jQuery documentation should help:
jQuery .off() method

jQuery .on() method

You'll need to figure out how to do that with SugarCube v1, because I've never needed to use it.

Hope that helps!  :-)

Welcome to Twine Q&A, where you can ask questions and receive answers from other members of the community.

You can also find hints and information on Twine on the official wiki and the old forums archive.

See a spam question? Flag it instead of downvoting. A question flagged enough times will automatically be hidden while moderators review it.
...