Howdy, Stranger!

It looks like you're new here. If you want to get involved, click one of these buttons!

Purging saves in sugarcube

Hello everyone. I'm very new to all of this so it may be a silly question but here it goes: I'm wondering the extent of the control you can exercise over the save system in sugarcube. I have managed to get the game to purge saves on start-up (SaveSystem.purge() in the javascript window) but I am struggling to get the same thing to happen when the player finds themselves on the "You are dead" passage in my story. I don't want to disable saving all together I just want saves to be deleted when the player dies.

That said for future projects: Can you disable saves altogether in sugarcube?

Thanks in advance for anyone who tries to answer my query :)

Comments

  • edited February 2016
    I have managed to get the game to purge saves on start-up (SaveSystem.purge() in the javascript window) but I am struggling to get the same thing to happen when the player finds themselves on the "You are dead" passage in my story. I don't want to disable saving all together I just want saves to be deleted when the player dies.
    You could call SaveSystem.purge() via the <<script>> macro on your death passage. For example:
    <<script>>SaveSystem.purge()<</script>>
    

    Can you disable saves altogether in sugarcube?
    Not as such, no. That said, you don't have to provide players with a way to access the subsystem, which amounts to the same thing.

    You may remove the "Saves" menu item from the UI bar in SugarCube v1 by doing something like the following: (goes in Story JavaScript)
    $("menu-saves").remove();
    
  • Brilliant! Thank you very much! Fingers crossed my first game will hit v 1.0 in the next few hours :)
  • edited February 2016
    Can you disable saves altogether in sugarcube?
    Not as such, no. That said, you don't have to provide players with a way to access the subsystem, which amounts to the same thing.

    You may remove the "Saves" menu item from the UI bar in SugarCube v1 by doing something like the following: (goes in Story JavaScript)
    $("menu-saves").remove();
    
    [/quote]

    Looking for a way to disable the save option so I tried this (adding that to the Story Javascript) but the "Saves" option remains. Using Sugarcube 1.0.32. Also tried publishing to file to see if final product was different but no change. Something else I should be doing?
  • edited February 2016
    Whoops. I missed a character there in the selector (the ID sigil, #). It should actually look like the following (I'll include the equivalent for v2 as well, in case anyone comes looking for that).

    SugarCube v1.x
    $("#menu-saves").remove();
    

    SugarCube v2.x
    $("#menu-item-saves").remove();
    

    Sorry about that.
Sign In or Register to comment.