Howdy, Stranger!

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

Choices

Hey guys I like using Twine 2.0 very much, but I've met a problem yesterday...
I am currently making a story about a dungeon adventure an it involves traps. There two choices, dodge left and dodge right. I know how to set up the health variable, but I need to take away four health points from the player when they choose dodge right, and move on to another passage. The maximum health of the player is 15. Any help would be super appreciated. Thanks guys XD

Comments

  • You need to state which Story Format (and possibly the version) you are using when you ask a question, as answers can be different for each one.

    You have two basic options:

    1. You can modify the value of your health variable with the dodge right passage.
    <!-- Harlowe syntax-->
    (set: $health to it - 4)
    
    <!-- SugarCube syntaxs-->
    <<set $health to $health - 4>>
    <<set $health -= 4>>
    

    2. You can convert your dodge right markup link into what is common called a Setter Link.
    <!-- Harlowe syntax-->
    (link: "dodge right")[
    	(set: $health to it - 4)
    	(go-to: "dodge right")
    ]
    
    <!-- SugarCube syntaxs-->
    [[dodge right][$health to $health - 4]]
    [[dodge right][$health -= 4]]
    
  • I'm currently using the default story format of the online version of Twine 2.
  • Thanks for reminding ☺
  • The default is called Harlowe
Sign In or Register to comment.