Howdy, Stranger!

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

Storing the name of the current Passage as a string?

Hello! I am relatively new to Twine and I am still feeling my way around. I've been searching for the answer to this question but I am either missing it, or it simply hasn't been asked before.

Is there any way to store the name of the current passage as a string in SugarCube? The idea I am working on involves storing the name of the passage for later use, and to detect whether or not they're in a specified passage. I know I could just set these variables by hand but I wanted to save myself from having to set a number of variables on each individual passage, and use PassageDone/PassageReady instead.

Thank you for any help! I don't know if I've been searching for the wrong thing, or just blind as a bat, because it seems like such a simple thing and I've found nothing clear on the subject.

Comments

  • So... I eventually did find it, embarrassingly enough. It took a different perspective to alter my searches and I discovered that along with a good number of commands to use in future development.

    In case this topic isn't removed or deleted, the solution to the subject is passage() - It returns the current Passage's title as a string, and can be used in macros, like so:

    <<print passage()>>

    Here's to better investigation skills.
  • I never used SugarCube but I guess you can use basic Twine functions such as "visited".
    See https://twinery.org/wiki/function#visited_string_string

    You probably want to use it this way:
    <<if visited("the_passage_im_interested in")>>
    ...
    <<else>>
    ...
    <<endif>>
    
  • edited August 2016
    Most of the time you're better off visiting SugarCube's own documentation:
Sign In or Register to comment.