Howdy, Stranger!

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

How to make a hub option disappear?

In my game I have a hub with different activities for the player to do, but once they return to the hub after completing an activity I want that option to disappear. How do I program this to happen? I'm using Twine 2.08 with Harlowe format if that helps.

Comments

  • If the activity starts with or contains a specific passage, which is only part of that activity, then you could check for the existence of that passage within the story history. Alternatively, you could simply set a flag (e.g. a boolean $variable) denoting that the activity has been done.

    Checking the history example
    In your hub passage, you'd do something like the following:
    <!-- The parenthesis around the "… contains …" bit are required. -->
    (if: not ((history:) contains "Haunted Mansion Start"))[\
    [[Explore the old mansion on the hill->Haunted Mansion Start]]
    \]
    

    Setting a flag example
    First, set the flag in a passage tagged "startup":
    {
    (set: $exploredSchoolCaverns to false)
    }
    
    Then, in your hub passage, you'd do something like the following:
    (if: not $exploredSchoolCaverns)[\
    [[Explore the cave underneath the school->School Caverns Start]]
    \]
    
    Finally, somewhere within your "School Caverns Start" passage, you'd do something like the following:
    (set: $exploredSchoolCaverns to true)
    


    I've attached an example Twine 2 archive (for importing) which contains examples of both of the above. (n.b Ensure you download the attachment, if you plan to, before accepting this answer, if you plan to, as the forums currently throw away attachments on posts which are accepted as answers.)
Sign In or Register to comment.