Labels
Connections can include labels: text fields that render as option text in Play Mode.
Labels support the following powerful features:
- Rich text formatting: Create option text that includes bold, italics, underline, and links.
- Mentions of components and boards.
- Arcscript:
- Write dynamic option text that changes based on the story state.
- Assign variables or evaluate expressions when the option is selected.
Creating labels
You can add a label to a connection in either of the two following ways:
- Double-click the connection.
- Right-click and choose Create label.
Type your text directly. Format with rich text using the format menu or the following shortcuts:
- Ctrl/Cmd + B for bold.
- Ctrl/Cmd + I for italics.
- Ctrl/Cmd + U for underlined.
Press Esc or Tab to exit.
Editing labels
To edit a label, do either of the following:
- Double-click the connection.
- Right-click the connection and choose Edit label.
Deleting labels
To delete a label, do any of the following:
- Hover and click the x icon on the label.
- Right-click the label and choose Remove label.
- Clear the text and press Esc or Tab.
No labels?
Labels are not required for your story to run in Play Mode, but they give you greater control and flexibility in shaping the player's experience.
When a connection has no label:
- The option text is automatically taken from the title of the target element. If the target element has no title, Arcweave will use the first lines of its content instead.
- If an element has only one outgoing connection without a label, no option button is shown in Play Mode. Instead, a blinking arrow appears at the end of the element's text content. Clicking anywhere in the content will advance the story to the next element.
Arcscript in labels
Connection labels support arcscript, which allows the following features:
- Dynamic option text: The option text changes based on conditions and variable values.
- Code execution: When the player selects the specific connection, arcscript logic gets triggered, e.g. a value gets assigned to a variable.
Adding Arcscript
To add arcscript while editing a label, do any of the following:
- Click the <> icon in the toolbar.
- Press Ctrl/Cmd + Shift + C.
Exit the block with Enter.
Evaluation & execution of arcscript in labels
Regarding evaluation and execution of arcscript in a label during Play Mode, the following two rules apply:
- It is evaluated before displaying the option button text.
- It is executed after the user selects the option and before the target element loads.
This allows for dynamic option text, as in the following example:
Talk to
if name_known
Jefferson.
else
the moustached man.
endif