Howdy, Stranger!

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

Erasing Saves in Harlowe 1.1

So I'm using the new version of Harlowe (which seems awesome by the way) and I want to add save functionality to the game I'm working on. One thing I'm not sure on, though: is it possible to ERASE a player's save?

Comments

  • Currently the only way to erase a savefile is to save a new file over the same name - but a deletion macro could be added in the future.
  • Hmmm... okay so let's say I have a single save file which I've made with (savegame: "XYZ", "A REAL SAVE"). I can overwrite that save by going (savegame: "XYZ", "DELETED") at some other point, right? If I did that, would I then be able to only display the "Load Game" option if (savedgames:) contains "A REAL SAVE"? In other words, "erasing" the file by preventing the option to load it?

    As in:
    (if: (savedgames:) contains "A REAL SAVE")[blah blah blah link to a passage with loadgame in it]
    

    Or does that contains thing only work with slot names and not filenames?
  • Datamaps consist of key->value pairs. The "contains" operator only checks keys in datamaps, and the datamap produced by (savedgames:) has slotnames in key position, with filenames in value position. So, that won't work.

    HOWEVER, you can use the brand new (datavalues:) macro to put all the datamap's values into an array, and then use "contains" on it:
    (if: (datavalues: (savedgames:)) contains "A REAL SAVE")[blah blah blah link to a passage with loadgame in it]
    

    This should work as you hope.
  • Whee. Thanks.
Sign In or Register to comment.