Else and elseif are not vital anymore and you can live without hem both. I think it’s good to understand how they work so you can read your own code better so let’s take a look at examples with and without them.
First, with *else and *else_if
*create fruit "apple"
*create fruit colour "red"
You see two fruit trees, one with delicious apples and another with tasty pears. You pick a fruit. Which one do you take?
*choice
#Apple
Do you pick a red apple or a green one?
*choice
#Red
*goto fruit_story
#Green
*set fruit_colour "green"
*goto fruit_story
#Pear
Do you pick a British green pear or a Chinese yellow pear?
*choice
#British
*set fruit_colour "green"
*goto fruit_story
#Chinese
*set fruit_colour "yellow"
*goto fruit_story
*label fruit_story
You take the
*if fruit_colour = "red"
red apple and take a bite. It is delicious.
*goto last_part
*else_if fruit colour = "yellow"
yellow pear and take a bite. It is delicious.
*goto last_part
*else
green fruit and take a bite. It is delicious.
*goto last_part
*label last_part
Unfortunately it is poisonous, so you die.
Notice that you need to *goto (or *finish) after the condition is met.
Now, only using *if
*create fruit "apple"
*create fruit colour "red"
You see two fruit trees, one with delicious apples and another with tasty pears. You pick a fruit. Which one do you take?
*choice
#Apple
Do you pick a red apple or a green one?
*choice
#Red
*goto fruit_story
#Green
*set fruit_colour "green"
*goto fruit_story
#Pear
Do you pick a British green pear or a Chinese yellow pear?
*choice
#British
*set fruit_colour "green"
*goto fruit_story
#Chinese
*set fruit_colour "yellow"
*goto fruit_story
*label fruit_story
You take the
*if fruit_colour = "red"
red apple and take a bite. It is delicious.
*if fruit colour = "yellow"
yellow pear and take a bite. It is delicious.
*if fruit_colour = "green"
green fruit and take a bite. It is delicious.
Unfortunately it is poisonous, so you die.
This has exactly the same effect except that all of the *goto statements have been removed. The game will only read the relevant ones.
A word of warning though - if none of the if conditions are possible, then at best, nothing will be displayed and at worst, you could have a bug.
A better practice is to only use *if statements but keep the *goto statements. Also, remove the last *if statement like this:
*create fruit "apple"
*create fruit colour "red"
You see two fruit trees, one with delicious apples and another with tasty pears. You pick a fruit. Which one do you take?
*choice
#Apple
Do you pick a red apple or a green one?
*choice
#Red
*goto fruit_story
#Green
*set fruit_colour "green"
*goto fruit_story
#Pear
Do you pick a British green pear or a Chinese yellow pear?
*choice
#British
*set fruit_colour "green"
*goto fruit_story
#Chinese
*set fruit_colour "yellow"
*goto fruit_story
*label fruit_story
You take the
*if fruit_colour = "red"
red apple and take a bite. It is delicious.
*goto last_part
*if fruit colour = "yellow"
yellow pear and take a bite. It is delicious.
*goto last_part
green fruit and take a bite. It is delicious.
*label last_part
Unfortunately it is poisonous, so you die.
This is better because if none of the conditions are met, you have a default outcome. This is essential the same as the *else statement but with less code.
When would errors occur? If instead of giving 2 fruit choices, maybe you add an *input_text command so the player can type a fruit colour. Then, you can personalise the text for the red and yellow fruit, but have a standard reply for other colours. In more practical terms you would be using this with stat numbers where a variable is a number, perhaps a percentage. The more complex the variable, or variables, the more likely you are to get errors. Using the last style for your code is perhaps the best although I tend to use all three.
A final note, the whole example above only uses text rather than numbers so the whole thing could be written much more simply like this:
*create fruit "apple"
*create fruit colour "red"
You see two fruit trees, one with delicious apples and another with tasty pears. You pick a fruit. Which one do you take?
*choice
#Apple
Do you pick a red apple or a green one?
*choice
#Red
*goto fruit_story
#Green
*set fruit_colour "green"
*goto fruit_story
#Pear
Do you pick a British green pear or a Chinese yellow pear?
*choice
#British
*set fruit_colour "green"
*goto fruit_story
#Chinese
*set fruit_colour "yellow"
*goto fruit_story
*label fruit_story
You take the ${fruit} ${fruit_colour} and take a bite. It is delicious.
Unfortunately it is poisonous, so you die.