Skip to content

Branches

Branches are entities that carry conditional statements. They can have one or more conditions, in the form of:

  • if condition 1 → Connection 1
  • elseif condition 2 → Connection 2
  • ...
  • elseif condition n → Connection n
  • else → Connection n+1

A 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.

Creating branches

To create a branch, do either of the following:

  • Right click on an empty board area and select Create branch from the menu.
  • Drag and drop the new branch icon from the bottom menu (left) on a empty board area.

When you create a new branch, it only contains its essential if statement.

Editing branches

Editing a condition's script

To edit a condition double-click on it. Then, you can type in arcscript.

To exit editing mode press esc.

Adding & removing elseif

To add an elseif statement, do either of the following:

  • Right-click the branch and choose Add elseif.
  • Press Ctrl+Enter or Cmd+Enter while editing another condition.

You can add as many elseif statements as you want.

To remove an elseif statement, follow the next steps:

  1. Double-click the elseif condition to edit it.
  2. Click on the (x) icon appearing at the right side of the condition.

Adding & removing else

To add an else statement:

  • Right-click the branch and choose Add else.
  • Press Enter while editing another condition.

❗ A branch can have only one else statement.

To remove an else statement from a branch, right-click on it and select Remove else.

Using branches

You can use a branch to indicate which connection (if any) will be rendered as an option in Play Mode.

if-only branches

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.

✅ Read more about variables and arcscript on their respective pages.

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.

elseif conditions

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:

  1. If the player has the key, they only get the option to unlock the door.
  2. If they don't have the key, but have the potion, they only get the option to smash the door.
  3. If they have neither, they get no option at all.

else conditions

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:

  1. If the player has the key, they only get the option to unlock the door.
  2. If they don't have the key, but have the potion, they only get the option to smash the door.
  3. If they have neither, they only get the option to weep inconsolably.

✅ It's up to you to decide which options you want your player to have and how they are produced.

Deleting branches

To delete a branch, do either of the two following actions:

  • Select it and press Delete or Backspace.
  • Right click on it and select Delete selection from the menu.

Changing theme

To change the colour theme of a branch right click on it and select one of the available colours from the menu.