Howdy, Stranger!

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

How do I make it so that you have to visit certain text boxes before other text boxes unlock/open?

I'm sure this question has been answered many times, but I'm new to this site and don't know how to search for the answer.

I recently read Porpentine's "Howling Dogs," and I really like how you first have to go to the nutrient dispensers and eat and drink first before you get to use the visor that's in the activity room.

But how is that done? How can I require a reader to visit certain text boxes before other text boxes become available?

Thank you.

Comments

  • I just want to say one word to you. Just one word……. Variables.

    Okay, a bit more than that. Variables and some logic macros. Depending on how you decide to handle the passages, you may be able to leverage the history instead of using variables, but the end result is much the same.

    Beyond that, the nuts and bolts of how you do so depends on which story format you intend to use, as their syntaxes differ. That should be the first thing you do, learning your preferred story format. By default, Twine 2 offers: Harlowe, Snowman, and SugarCube v1. Story formats which are available, but not built-in: SugarCube v2 and a few Snowman variants.

    Very basic examples, using a variable hasEaten, might go something like the following:
    → Harlowe
    (if: $hasEaten)[ …visor usage… ]
    
    → Snowman
    <% if (s.hasEaten) { %> …visor usage… <% } %>
    
    → SugarCube
    <<if $hasEaten>> …visor usage… <</if>>
    
  • Thanks!

    This is very helpful.

    I was also able to find some YouTube videos about variables, conditionals, and hooks.
  • I wrote a blog post about changing room text using variable in harlow.
Sign In or Register to comment.