Howdy, Stranger!

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

Links available depending on values

I want certain possibilities and messages to only appear if you have the item in question. For example; let's say you have a locked gate and need a hammer to get past it. If you don't have a hammer it just says: "There's a locked gate. You can't get past right now; maybe if you had something to break the lock...". If you do, it gives you the option to smash the lock and get through; and from then on the gate will be open. I checked the wiki and I can't find any way to do so.

Comments

  • You want variables!

    When the player gets the hammer, do this:
    <<set $gothammer = 1>>
    Then you can do this:
    <<if $gothammer eq 1>>You have a hammer! [[smash stuff]]<<else>>If only you had something to smash stuff with...<<endif>>
  • What mostly useless said! Also, check the wiki (the Twine Reference, specifically) again; check out the adjacent sections "Remembering Things With Variables" and "Displaying Text Conditionally" in the Adding Code to Your Stories section. It's also reviewed in the "HOW TO MAKE GAMES WITH TWINE" tutorial, about 3/4 of the way down (it's a pretty short, concise, 1-page tutorial).
  • Thanks, guys. Locking up this thread.
Sign In or Register to comment.