Howdy, Stranger!

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

Accessing (passage:) object in JS

Is there a way to access the (passage:) object in the JavaScript code? Specifically, I'm building an inventory system and I want each passage to have an items array put into it.

Help would be appreciated.

Comments

  • All the passages of a story are stored in a map constant called Passages. Each passage is stored with the key being the name of the passage and the value is another map storing the name, source and tags of the passage.

    Note, This is an undocumented feature. While it's accessible in the current version of Harlowe, it might not be in future versions.
  • It had better be documented in the next version, or a lot of stuff is going to break in the near future.
  • This constant needs to be a documented feature, because it is very handy.
  • XndrK wrote: »
    It had better be documented in the next version, or a lot of stuff is going to break in the near future.
    Harlowe is currently designed so that an Author has almost no access to the story format's internals without using a supplied macro, and I believe that this is a deliberate design decision. For instance an Author is not able to add their own macros like they can do in other story formats.

    While you can use Javascript scoping to access some internals like Passages it is not encourage because Harlowe has no formal API and thus prof_yaffle's included warning.
Sign In or Register to comment.