Beginner problem with (else:)

Hi, I think I’m missing something fairly simple here, but I’ve tried every alternative phrasing I can see and nothing seems to work. Basically, I can’t get else: or if-else: statements to work for some reason. I’ve got

(if: $status is ‘Command’ or ‘Computer’ or ‘RecRoom’)[Unlock the radio and contact control->Something odd is happening][[Unlock the radio station and contact control->Radio code]]

Every time I run it the error comes up

There’s nothing before this to do (else:) with.

What do I need to do to get the else to recognise the if? I know it must be something simple and obvious but all the examples and such that I’ve tried fail in the same way.

I think I’ve figured it out, is this right?

{
(if: $status is ‘Command’)[
[[Unlock the radio and contact control->Something odd is happening]]
](else-if: $status is ‘Computer’)[
[[Unlock the radio and contact control->Something odd is happening]]
](else-if: $status is ‘RecRoom’)
[[Unlock the radio and contact control->Something odd is happening]]
[[Unlock the radio station and contact control->Radio code
]]}

Please use the New Topic form’s Optional Tags field to state the Name and Version number of the Story Format you are using, as answers can vary based on this information. Based on the macro syntax of your example I will assume you are using Harlower, I will also assume you are using the latest series of that story format which is 3.x

Please use the toolbar’s Preformatted Text option when supplying a code example, it makes them easier to read and to cut-n-paste. It also stops the standard single & double quotes in your code example being converted into topographical (curly) quotes, which are invalid when used to delimit a String value.

As you have discovered each instances of either the (if:) macro, the (else-if:) macro or the (else:) macro needs to have its own associated hook.
eg.

(if: $variable is "value")[ do something when variable equals "value" ]
(else-if: $variable is "other value")[ do something when variable equals "other value" ]
(else:)[ variable equals neither "value" or "other value" ]

So assuming that you want the “Unlock the radio station and contact control” link to only appear when $status is not equal to either ‘Command’, ‘Computer’, or ‘RecRoom’ your code would look something like…
(untested example)

{
(if: $status is 'Command')[
	[[Unlock the radio and contact control->Something odd is happening]]
]
(else-if: $status is 'Computer')[
	[[Unlock the radio and contact control->Something odd is happening]]
]
(else-if: $status is 'RecRoom')[
	[[Unlock the radio and contact control->Something odd is happening]]
]
(else:)[
	[[Unlock the radio station and contact control->Radio code]]
]
}

note: You don’t have to line-breaks and tabbing to format your code like I have, however doing so can make it easier to see if your code is missing things like open or close square brackets. (like your last code example was)