Please use the toolbar’s Preformatted text option when including a code example in your comment, it helps to make the code easier to read and stops the forum’s software converting valid standard quotes into invalid Typographical (curvy) quotes.
There are a couple of issues with your example:
- You have an extra close bracket ) after each of your
(goto:) macro calls.
- The second of your
(if:) macro calls should be an
(else-if:) macro, because you only want to action one of those two conditions at any time. Known as mutually exclusive.
The following is a corrected variation of your original example.
(if: $hp < 1)[(goto: "Elose")]
(else-if: $ehp < 1)[(goto: "Ewin")]
You can use variables to store the Name of each of two Passages you want to be visited, those variables can be either Temporary or Story based depending if the code that determined which Passage Names to use is contained within the same Passage as the
(else-if:) related condition checks.
The following example assumes the target Passage Names will be assigned within the same Passage as the condition checking, so Temporary variables are used. If the target Passage Names are determine in a different Passage then you should change the code to use Story variables instead.
(set: _EnermyLose to "Elose")
(set: _EnermyWin to "Ewin")
(if: $hp < 1)[(goto: _EnermyLose)]
(else-if: $ehp < 1)[(goto: _EnermyWin)]