Howdy, Stranger!

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

Save / Load game in 2.0 and Harlowe

I've found somewhere the macros to save and load (not here at this forum).
They are working fine, so to have two saving slots:

[Save A]<savea| (click: ?savea)[(save-game: "FileA", "Passage1")]
[Save B]<saveb| (click: ?saveb)[(save-game: "FileB", "Passage1")]


And to load, I've put on a "Load Game" passage:

[Slot A]<loada| (click: ?loada)[(load-game: "FileA")]
[Slot B]<loadb| (click: ?loadb)[(load-game: "FileB")]


Great, tested and 100%. BUT it's a little crude, since the user can't see any info about the file. How could I get a data stamp, or better, the level player was when game was saved? Example: if I have a level system stored in $yourLevel, would be possible to display this, something like:

Slot A (XP 100, MP 50, level 5)
Slot B (XP 250, MP 0, level 12)
Slot C (empty)


Any better approach/ideas would be fine, too.

Comments

  • edited October 2015
    Nevermind, easier than I thought:

    [Save A]<savea| (click: ?savea)[(save-game: "FileA", "$yourName, lvl $yourLevel")]
  • Other question: I want to show all available save slots, but hide those empty.
    With:

    (print: (saved-games:)'s "A")

    ...I can display the slot A filename, like "under the castle". How to use conditions to don't show a slot if it's empty?
    Example (NOT WORKING, OF COURSE):

    (if: (saved-games:)'s "B" is empty)[EMPTY]
    (else: )(print: (saved-games:)'s "B")


    Harlowe docs says: "The expression (savedgames:) contains "Slot name" will be true if that slot name is currently used." How to check if it's true or false?
  • l3m35 wrote: »
    Other question: I want to show all available save slots, but hide those empty. ........
    Harlowe docs says: "The expression (savedgames:) contains "Slot name" will be true if that slot name is currently used." How to check if it's true or false?
    You actually answered your own question.

    Try the following:
    note: in your original example you named the first save slot as "FileA" so I will use that in the example.
    (if: (savedgames:) contains "FileA")[(print: (saved-games:)'s "FileA")]
    (else:)[EMPTY]
    
  • edited October 2015
    I'm curious about this too. Pardon my newbie-ness, but is there some type of documentation for saving macros in Harlowe?

    What I want is to possibly set up save and load buttons on the sidebar, and potentially export and import saves (because of data clearing). If not, I'll settle with a better explanation of saving/loading datamaps as pointed out above.
  • Official information about Harlowe can be found in two places, it's documentation and it's project overview.
    Information about save/load is currently only available on the overview.
  • Sorry for the bump, but I still wanting to know how to save a slot in a structure like:
    Slot A (day 520, level 5).

    If I try:
    [Save A]<savea| (click: ?savea)[(save-game: "FileA", "LVL $yourLlv, DAY $yourDay")]
    

    ...to save, and
    {(if: (saved-games:) contains "Slot A")[
      (link: "Load game A")[(load-game:"Slot A")]
    ]}
    

    to load, it will show: "Load game A LVL 1, DAY 1" and not the saved data for level and day.
  • I did it. If anyone need:
    [Save A]<savea| (click: ?savea)[
      (if:(save-game:"Slot A",$day+", " + $hour+ ", " + $place + ", LVL " + $level))[Saved!](else: )[Sorry, not saved.]
    ]
    (set: $day to (current-date:)) 
    (set: $hour to (current-time:))
    (set: $place to (passage:)'s name)
    (set: $level to (text: $yourLvl))
    

    It gives me a save file with this name format:

    Slot A: Thu Mar 31 2016, 4:45 PM, First Floor, LVL 1

Sign In or Register to comment.