+1 vote
by (130 points)

I'm a complete fledgling to Twine2 and I can't seem to make an "if -> then" statement for my rudimentary health system.

< !-- header -->

(if: $_player_health is 0) (goto: "death scene")

Can someone tell me if there's a template for "if -> then" with a command for the "then" part?

1 Answer

+3 votes
by (63.1k points)

As explained in the documentation, you have to attach (if:) macros to hooks. Hooks are like JavaScript blocks, except that they use square brackets ( [] ) instead of curly braces. To attach a macro to a hook, just place the hook right after the macro: 

(if: some condition)[(goto: "some passage")]