Howdy, Stranger!

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

If/Greater than question

Hello!

I'm new to Twine 2.0 and I've been watching tutorials on how to implement variables and conditionals. I'm trying to implement a basic health system where when your Health variable = 0, you get a death message and when its greater than 0 you get the normal, expected text.

The first conditional for checking if health is = to 0 is working perfectly.
However the > 0 returns nothing.

Here's my example:

(set: $health to 5)
Health: $health

(if: $health is 0)[You have died!!]
(if: $health is > 0)[The door slams behind you. Uh oh. This is how horror movies start. What have you done?]

Anyone have any ideas?

Thanks!

Comments

  • First, you want $health > 0 not $health is > 0. Second, it would probably be better to use (elseif:) for the second conditional. For example:
    (if: $health is 0)[You have died!!]
    (elseif: $health > 0)[The door slams behind you. Uh oh. This is how horror movies start. What have you done?]
    
  • Brilliant - thank you! :)
Sign In or Register to comment.