Block Scripts
A block script is written with braces. It reads like a scene: people act (Guard.MoveTo), several things can happen at once (Simul), and a line that takes time finishes before the next begins. It lives in assets/events/<name>.run like a line script, and answers the same calls.
Begin Event "ambush" on enter {
Player.LockMovement
Simul {
Guard.MoveTo (700, 480)
Camera.Shake 0.6
}
Guard.Say "Going somewhere?"
Player.UnlockMovement
}Triggers
The header says what starts it:
- on use, on enter, on exit, on talk, on locked, on destroy
- The same calls as line script sections.
on destroyis a breakable prop breaking. - on death, on respawn
- In
death.runandrespawn.run. - on start [map]
- Once, when its map opens in play.
- on standing every 2s [in <map>]
- A heartbeat while the map is loaded. A standing event must
Waitsomewhere; the checker refuses one that does not. One with noin <map>that takes the camera or the player gets a warning, because it fires on every map.
Who acts
- Player.LockMovement, Player.UnlockMovement
- Take and give back the player's control.
- Player.MoveTo (x, y) [over 2s]
- Walk the character somewhere. The line ends when the walk does.
- Player.Say "words"
- Speech at the bottom of the screen.
- <npc>.MoveTo, .Say, .Face, .PlayAnimation
- Any villager, by its tag (or its kind when it has no tag).
.Face playeror.Face 0to7;.PlayAnimation walk 2stakes idle, walk, talk, attack, roll, hit, death or one of its own clips. - Camera.PanTo (x, y) [over 2s]
- Glide the view away from the character.
- Camera.Follow
- Bring the view home.
- Camera.Zoom (2.5) over 1.5s
- A multiple of the game's zoom: (1) is home, (2.5) a close-up, (0.5) wide. With
overthe line waits for it to land. It stays inside the map's zoom range. - Camera.Shake [secs] [amount]
- Shake the view. Hits add up.
- Wait 2s, Wait 500ms
- Let a moment pass.
- Play Sound <wav>
- A sound from
assets/audio. - Add <character> at (x, y) as <name>
- A villager steps into the world; later lines call them by that name.
- Remove <name>
- And steps out again.
A line with no actor is the world acting, and the verbs on the Rûn Verb Index work there unchanged, apart from the flow verbs (if, while, repeat, run, require and the like), which belong to line scripts. Any method of a program's Player and Camera objects works too (see Rûn Programs).
Blocks
- Simul { ... }
- Every line inside starts at once; the script carries on when the slowest finishes.
- Repeat 3 { ... }
- Run the block that many times.
- If <condition> { ... } Else { ... }
- The same conditions as line scripts.
- { ... }
- A plain group.
Stopping
Stopping a test ends every running block script and gives the camera, zoom and controls back. So does travelling to another map. When the last running scene ends and nobody gave the controls or the camera back, they come back on their own and the zoom glides home. Up to eight scripts run at once; when all eight are busy, a line typed at the console stands the oldest one down.