Howdy, Stranger!

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

Disable Saves and Enable Saves in Certain Passages(Sugarcube)?

I have been trying to disable saves in certain passages in Sugarcube, but can't seem to figure it out. I have read the Sugarcube documentation on the .config scripts, but still no luck. Basically what I need is saves to be disabled until a certain passage appears and when that passage appears saves are then enabled. Just like a save point in games.

Thank You
InsertCoin25

Comments

  • You want the config.saves.isAllowed property.  My suggestion would be to use passage tags to denote which passages players may save on.

    For example, put the following in a script tagged passage:

    config.saves.isAllowed = function () {
    return tags().contains("savable");
    };
    Then you simply add the tag savable to each passage where you want saving to be allowed.
  • Works perfect TheMadExile!!! Another question entered my mind as I was doing this. Is there a way to hide the saves menu, until the passage comes up that is savable. I used this code in a style sheet:

    #menu-save
    {
      display: none;
    }

    The problem I am having is that I don't know how to reinstate the menu-save, when the savable passage is loaded. I tried adding this code to the savable passage using a stylesheet tag, but it doesn't seem to recognize the code. Here is the code I used:


    #menu-save
    {
      display: true;
    }

    Any help would be greatly appreciated. Thanks TheMadExile!!

    InsertCoin25
  • I wouldn't recommend it since the Saves menu handles both saving and loading.
Sign In or Register to comment.