How can i use "if" statement in the text processor?

alright so i wanted to know how can i use an "if" command in a game book...
i want to do a command that starts with "random"... for example {random: they said hi, they didn't respond}
then i wanted to do an "if" command to make an outcome for each random text but i didn't know how...


You have two options in the text processor: {either and {if.

The structure is:

{if attribute=value:Some text that appears if the condition is true.}

In this case, the attribute is can either be an attribute with a dot (such as player.health or page7.visited), or an attribute of the game object (such as Gamebook mode's flags and counters). The value is assumed to be a literal string, and the attribute is converted to a string before comparison. This means that you can't compare two attributes to each other.

You can use =, <=, >=, <>, >, or <. You can also put not in front of the variable name.

The other option:

{either condition:Text to show if it's true.:Text to show if its false.}

In this case, condition can be anything you could use as the condition in a normal if statement. It can be something like player.alias = "Bob", or player.strength > player.intelligence, or even ListContains (player.achievements, "BAMF"). You can use Quest functions in it, and do whatever you want, as long as your condition returns true or false.


O_O oh wow a bit hard to understand but thanks


This topic is now closed. Topics are closed after 60 days of inactivity.

Support

Forums