Vǫrðr Forge Steam page

Scripting with Rûn

Cutscenes

A cutscene is an event that takes the controls, plays timed beats, and gives the controls back. Wrap it in lock and unlock so the player stands still, and time the beats with wait. When a script ends, the controls come back even if it forgot unlock.

[use]
lock
letterbox on
fade out 1
wait 1.2
title The Long Winter
wait 3
cinetext type A cold wind crosses the fjord...
wait 3
fade in 1.5
letterbox off
unlock

The verbs

fade out <secs>, fade in <secs>
Fade to black and back.
fade <0..1> <secs>
Hold at part darkness. fade 1 0 is black at once.
letterbox on|off
Cinema bars slide in and out.
title <words>
A large centred title card that fades in, holds and fades out, 3.6 seconds in all.
cinetext <style> <words>
Styled text for 4 seconds: type (typed out), scroll (drifts up), wobble (letters ride a wave), fade (in, hold, out), title (large, like a title card), static (stays until cleared).
cineclear
Clear all cinema text now.
flash <image> [secs]
A full-screen picture for a moment.
video <file> [skip]
A clip full screen, and the script waits until it ends. With skip, Escape, Enter or a click ends it. Bare names live in assets/video; the clip is VP9 or AV1 in WebM.
shake [secs] [amount]
Shake the screen. Hits add together and fade at shakedecay per second (game.vdc, 1.5 by default); shake trauma 0.3 adds straight to it. The player's Screen Shake setting scales all of it.
sound <wav>, music <file> [vol]
A sound, or cross-fade the music.
move, face, anim
Walk, turn and animate villagers.
timescale
Slow motion (see Time and Vision).

The camera

A line script moves the camera with camera:

camera pan 820 400 2
wait 2
camera zoom 2.5 1.5
wait 2
camera zoom 1 1
camera follow

camera pan <x> <y> [secs] glides the view to a place, camera zoom <mult> [secs] zooms, and camera follow brings the view back to the character. These lines do not wait for the glide, so give each one a wait. End with camera follow, or the view stays where you left it until the next map.

In a block script the camera takes direction by name, and each line waits for its own glide:

Camera.PanTo (820, 400) over 2s
Camera.Zoom (2.5) over 1.5s
Wait 2s
Camera.Zoom (1) over 1s
Camera.Follow

The zoom number is a multiple of the game's own zoom, so 1 is always home, and it stays inside the map's zoom range. A map with its own fixed camera still lets a script pan; following again returns to the room's point.

Map openings

A map runs the [load] section of the script with its own name when it opens in play. So an assets/events/start.run with a [load] section plays when start.map loads. A new Dungeon Crawler, d20, Looter Shooter, jRPG or Sidescroller project starts with one already: a worked opening whose title card wears your game's name. Change the words, or delete the file and the game opens without one.