Vǫrðr Forge Steam page

Scripting with Rûn

Rûn Tools

The Rûn Console

Press the key, or choose **Tools > Rûn Console**, and the console opens as the **Rûn Console** tab beside the [[The Content Drawer|Content Drawer]]. While the game runs, the key drops it over the screen instead. Type a line and it happens at once: any verb, any block script line, or a call to a program's objects.

give healdraught 3
Camera.Zoom (2) over 1s
print(Player.Stat("might"))
run ambush
check ambush

run <event> [section] starts an event from assets/events: a block script whole, a line script at the section named, or at its first section with a line in it; World.Fire("barn_door") runs any event, line scripts and programs included. check <event> proofreads any event script without running it, and help lists what the console takes. An exported game (full version) carries the console too, unless the project file (<Name>.vdr) says feature console off.

The Rûn Console tab after check barn_door.
The Rûn Console tab after check barn_door.

The Text Editor

The Text Editor edits any of the project's text: scripts, dialog, data tables. Double-click a text file in the Content Drawer, then press Open in text editor in the asset manager.

  • In an event script it completes verbs as you type and offers lists of villagers, items and the like where a verb wants one. Tab takes the offered word; Enter takes it only after you moved through the list with the arrows.
  • The line under the caret shows its verb's signature and what it does.
  • A broken line is marked in the gutter with the fix spelled out, the moment you type it.
  • It watches its file: when the file changes on disk it reads it again if you have no unsaved changes, and tells you if you do.

The asset manager's Edit Rûn view is the same editor, inside a tab.

The node board

Tools > Rûn Nodes... shows scripts as a board of connected cards. Drag to arrange and to pan, use the wheel to zoom, right-click to add, and type on a card to edit it. The rail lists Events, Verbs and Vars. Open as text opens the same file as text. A block script is drawn on the board, but you edit it as text.

Rûn Nodes on a line script with two sections. The outlined lines carry warnings.
Rûn Nodes on a line script with two sections. The outlined lines carry warnings.

While the Rûn Nodes window is the window on top, the board takes these keys and gestures:

Ctrl+Z, Ctrl+Y (or Ctrl+Shift+Z)
Undo and redo, one step for each thing you did: a card typed, a section carried, several sections deleted at once. An undo puts the script file back exactly as it was. If the file was changed somewhere else since (in the Text Editor, say), the board leaves it alone and says so. The history starts again each time the window opens.
Delete, Ctrl+C, Ctrl+X, Ctrl+V, Ctrl+D
Delete, copy, cut, paste and duplicate the picked card, or the picked section when no card is picked. Ctrl+V pastes a card after the picked card, and a section beside the picked section.
Shift or Ctrl and a click on a section's header
Adds that section to the picked ones, or takes it out.
Shift or Ctrl and a drag on empty board
Draws a band; every section it touches is picked. A plain drag still pans.
Ctrl+A
Picks every section on the board.
Carrying a picked section's header
Carries every picked section with it. Delete, Ctrl+C, Ctrl+X and Ctrl+D act on all of them.
The arrow on a section's header
Collapses the section to its header, with the number of its lines beside its name, and opens it again. Save layout keeps it collapsed.
The map
The small map in the lower right corner shows every script and section, with the part you are looking at framed. Click or drag on it to move the view there.

The asset manager's Node Graph view is the same board for one event or script. The two share one model, so while the Rûn Nodes window is open the asset manager's graph waits for it.