Howdy, Stranger!

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

Can't get this simple if macro random event to work. Why?

Hello, I am new to Twine and am trying to make a random 1/3 chance of something happening but I get an error every time when I try to close the following passage, saying that my if macro does not have a matching end tag:


You pick up the pace and sprint as fast as you can.

<<set $tripped to random(2)>>
<<if $tripped is 0>>You trip and fall.<</if>>

I tried with /if and /end if, same thing. The first, opening part of the statement is red. When I put a column after if, then it pretends it's ok but when I actually run it in browser there is a red error stating that there's no macro or passage named "if"

I am very confused :/

(using Twine 1.4.2 Sugarcane)

Comments

  • edited May 2016
    The <</macroname>> closing syntax is only allowed by SugarCube. If you're using any of the Twine 1 vanilla story formats, of which Sugarcane is one, you must use the <<endmacroname>> syntax (e.g. <<endif>>).
  • Thank you TheMadExile. I knew it had to be something incredibly simple... I completely confused SugarCUBE and SugarCANE lol. Works now! :)
Sign In or Register to comment.