The following is slightly better formatted (line-breaks & indentation) version of your examine...
|test>[
(link: "Continue")[
(if: $vesselhp is <1)[
(goto: "New vessel")
]
]
(else:)[
(goto: "passage2")
]
]
... as you can now see your (else:) macro is outside the associated hook of you (link:) macro, this causes the (else:) to be executed before the link is clicked.
There are also a couple of minor issues with your example:
- You shouldn't be using the is operator when using the mathematical greater-than or less-than related operators.
- You shouldn't add space characters between a macro (like your (else:) macro) and it's associated.
- It helps readability if you add a space charter between the comparison operator of a condition expression (like that in your (if:) macro) and the value.
The follow is a modified version of your examine with the major and minor issues fixed.
|test>[
(link: "Continue")[
(if: $vesselhp < 1)[
(goto: "New vessel")
]
(else:)[
(goto: "passage2")
]
]
]
Note: You didn't state where you are initialising your $vesselhp variable to its default value (I assume that it equals zero), ideally that initialisation should be done in your story's header tagged special passage like so.
(set: $vesselhp to 0)