Basic Arcweave tutorial | Part 20: Advanced connections & labels
This tutorial covers a few recent additions to Arcweave's connections and labels: a faster way to create new connections, and the ability to use Arcscript inside connection labels to change text dynamically or assign variables.
Video tutorials
Watch this tutorial as a video:
⚠️ This video does not reflect the latest updates to Arcweave's UI.
✅ You can play the finished version of the Tutorial Project here and explore its diagrams and structure here.
Drop connections to create board items
So far you have seen how to connect two existing board items (elements, branches, or jumpers): first create the items and then draw a connection from one to the other.
You can also drag a new connection and drop it directly onto an empty area of the board. This opens a menu where you can choose to create a new element, jumper, or branch.
This removes the extra step of creating the item first and then connecting it, letting you build out your diagram with single actions.
✅ When an element is selected, you can use keyboard shortcuts to instantly create a new connected element. Press Ctrl + Alt/Option/Cmd + an arrow key to create the new element in the direction of the arrow.
Arcscript in labels
You have already seen Arcscript living inside elements and branches. Time to learn that connection labels can also take Arcscript.
This lets you manipulate a label's text based on conditions or make variable assignments directly on a connection.
In Play Mode, the Arcscript in labels executes:
- When the label text is rendered as an option button
This execution does not change the game state. It solely allows the option text to get evaluated accordingly so its button can be rendered. - When the player chooses the respective option (i.e. presses an option button)
This execution changes the game state, as the story flow advances to the next element.
Conditional text in labels
You can use Arcscript to change what a label says depending on how many times the player has passed through it. For example, in the demo project In a tavern (see Part 19), take a label that reads:
Are you sure the skeleton has no money?
To make the label change on repeat visits, split the sentence where you want the condition to apply, then insert a code segment. You can add a code segment the same way you would inside an element:
- Click the Arcscript segment icon, or
- Use the shortcut Ctrl/Cmd+Shift+C
Inside the segment, check how many times the element has been visited using the visits() function:
"Are you
if visits(ask_about_skeleton) > 1
absolutely
endif
sure the skeleton has no money?"With this in place, the first time the player reaches the Ask about skeleton element, the label reads:
Are you sure the skeleton has no money?
Because the visit count is exactly 1 at that point, the condition isn't met. On every subsequent visit, the condition evaluates to true and the label becomes:
Are you absolutely sure the skeleton has no money?
You can also apply formatting — such as italics — to the inserted text to give it extra emphasis.
To test this, run the project from that point using Quickstart Play Mode from here. On the first visit, the label shows the plain version of the question. Selecting the option and returning to it again shows the updated version with "absolutely" included, and it continues to appear on every visit after that.
Variable assignments in labels
You can also use a connection label to change a variable's value when the player picks a specific option.
For example, suppose two connections lead out of the same element with two different responses:
- "Oh, well." — a more accepting response
- "You're all unbelievable." — a more negative response
Since the second option is negative, you might want it to reduce the party's morale. To do this, add an Arcscript segment to that connection's label:
"You're all unbelievable."
morale -= 1For the more accepting option, you could instead reward the player:
"Oh, well."
morale += 1Both connections lead to the same destination element, but different variable assignments happen along the way depending on which one the player chooses.
To test this, run the project from that point using Quickstart Play Mode from here and open the Debugger to watch the morale variable change:
moralestarts at10.- Choosing "Oh, well." increases it to
11. - Clicking Undo last choice in the Debugger and instead choosing "You're all unbelievable." decreases it to
9.
Demo: a quiz
Variable assignments inside labels can be combined to build a multiple-choice quiz.
In the demo project In a tavern, see the board titled Quiz. It has one element per question, and one connection per answer, each assigning a different score to a variable depending on the option chosen.
What's next
You've now seen two ways to speed up and extend your use of connections: drag a connection onto empty space to quickly create new board items and use Arcscript inside labels to change text dynamically or assign variables. Try adding conditional text or a scoring system to one of your own connections to get a feel for how they work together.
The next part of the tutorial will familiarize you with audio assets.