Conditional Branch Points
Last updated
Last updated
Conditional Branch Points are inserted to the document at points where the script branches out, with the branches being dependent on certain conditionals.
Conditional Branch Points can be generated through the selecting Insert Conditional Branch Point under the Segment button on the top right corner of the screen.
It is also possible to generate a CBP through the Menu Bar under "Document ▸ Insert ▸ Conditional Branch Point".
It is possible to add multiple conditions through the Condition (if
) button on the top right corner of the screen, which appears when the CBP box is selected.
Conditions can be written in the dotted boxes that are marked alphabetically. The letter of each conditional is connected to the segment that follows in the script on the condition that it is realised. (ex. A: MayLikesMatt == true
, in this case the Button marked A goes to the script where this condition is true).
It should be noted that in conditions with a text value Variable, the value should be given in quotation marks (ex. A: MayThinks == 'loser'
, unlike setting a variable. Both quotation marks ("…" and '…') can be used.
Relational operators are used to define the condition of the variables as listed below:
~= true
if values are different
>~= true
if A is bigger than B
< true
if A is smaller than B
>= true
if A is bigger or equal to B
<= true
if A is smaller or equal to B
A specific condition in a CBP can be set as the default condition (functions in the same way as a default action is set for Buttons by clicking the box "Use as default condition" under the Condition box in the right tab.
It is also possible to combine two variables in one conditional, making it dependent on the realisation of both variables. Logical operators are used for this: and
, or
(ex. MayLikesMatt >= 5 and earnedRespect == true
). The logical operators must be all lowercase. For more information on the coding language of Complex Variables see the Lua reference manual.