Question regarding the use of if/else statements

As far as current implementation goes, think of it this way: *if, *elseif, *else chains are used for redirecting (hence the *goto/*finish requirement); *if, *if, *if chains are used for displaying text/setting variables without redirecting.

As already mentioned, you can just use *if statements to set your variables, though you’ll need to make sure to account for all possibilities.

You can also use *if chains for text in your story:

You are
*if persuasion = 2
    very
*if persuasion = 1
    a little bit
*if persuasion = 0
    not at all
persuasive.

or

*if (persuasion > strength)
    You should really try to talk to them first.
*if (strength > persuasion)
    Forget talking, just hit them with your sword.

Note that if you want to use variables to alter display text, you can also use the new multireplace feature:
You are @{persuasion+1 not at all|a little bit|very} persuasive.
or
@{(persuasion > strength) You should really try to talk to them first.|Forget talking, just hit them with your sword.}

2 Likes