Branches are entities that carry conditional statements. They can have one or more conditions, in the form of:
if condition 1
→ connection 1elseif condition 2
→ connection 2elseif condition n
→ connection nelse
→ connection n+1A branch can have an infinite number of incoming connections, but the number of its outgoing connections equals that of its conditions. Branches connect with elements, jumpers, and other branches.
Logic dictates that there can be only one (mandatory) if
and only one (optional) else
condition, but a branch can hold an infinite number of (optional) elseif
conditions.
Branches use arcscript, Arcweave's scripting language.
On Play Mode, depending on which conditional statement gets satisfied (if any), a branch sends the game flow to the corresponding connection.
There are 2 ways to create a branch:
or:
When you create a new branch, it only contains its if
statement.
To edit a condition double-click on it. Then, you can type in arcscript.
To exit editing mode press esc.
To add an elseif
statement:
You can add as many elseif
statements as you want.
To remove an elseif
statement, click on the (x) icon appearing at the end of the condition during editing.
To add an else
statement:
You can add only one else
statement.
To remove an else
statement from a branch, right-click on it and select Remove else.
You can use a branch to indicate which connection (if any) will be rendered as an option in Play Mode.
For example, let's say you have Element A: "Finding a locked door", which you connect to Element B: "Unlocking the door" via a branch that carries the condition if player_has_key
.
During Play Mode, when the player reaches Element A, the game will check the value of the player_has_key
variable. If it holds the value of true
, then the option "Unlock the door with your key" will be available. Otherwise, the option will not render.
You can add as many if-only branches as you want, to cover the cases you need.
In the case above, if the player carries both the key and the potion, they will get both options to choose from on Play Mode.
If you want the player to get only one option, you must use only one branch. That branch carries an elseif
statement for every option you want.
In the case above:
If you want the player to get only one option but to always have a fall-back option as well, you must use a branch that includes an else
statement. It will cover all cases and always produces exactly one option to the player.
In the case above:
{primary} It's up to you to decide which options you want your player to have and how they are produced.
To delete a branch, either:
or:
To change the colour theme of a branch right click on it and select one of the available colours from the menu.