Vǫrðr Forge Steam page

Scripting with Rûn

Rûn Programs

A program is Rûn for logic: variables, arithmetic, if, while, for, functions with typed parameters, and engine objects such as Player, Camera and World. Programs live in assets/scripts/<name>.run. A program with the same name as an event answers that event first.

// the tavern door
on use {
    if (World.Flag("tavern_knocked")) {
        Player.Give("ale", 1)
        print("The keeper waves you in.")
    } else {
        World.FlagSet("tavern_knocked")
        print("Nobody answers. Try again.")
    }
}

Share(text id, number gained, toggle standing) {
    if (standing) {
        return gained * 2
    }
    return 0
}

The language

Comments
// to the end of the line, # to the end of the line, or /* ... */.
Types
number, text and toggle (on or off), plus any struct declared in assets/run/. int, float, string and bool also work.
Variables
number hp = 30 declares; hp = hp - 5 changes. A declaration takes only its own kind of value: number n = "text" is an error.
Lists
[2, 4, 8], up to eight values written out; list[0] is the first.
Operators
+ - * / %, < > <= >= == !=, and && (and), || (or), ! (not). Programs write these as symbols; and, or and not as words are refused with that fix. Dividing by zero, or taking % of zero, is an error.
Sections
on <name> { ... } is the part an event call runs: on use, on enter, on load and so on. Lines outside any section are the program's top level.
Every frame
on update(number dt) { ... } runs once every frame of play, dt the frame's seconds. A program with one stays loaded for the whole play: its top level runs once, and its variables keep their values between frames.
Functions
Name(type a, type b) { ... return value }.
Flow
if (...) { } else { }, while (...) { }, for (i = 0; i < 8; i = i + 1) { }. A single line needs no braces: if (Player.hp < 10) print("Run!").
Objects
New Enemy { name = "Wolf" hp = 40 } makes an instance of a declared struct.

World.Fire(name [, section]) runs another event or program. A program fired this way runs nested, with its own variables, and the caller's are untouched. Programs nest up to eight deep.

Before and after

A program can answer the engine's own events. Write the blocks at the top level of any assets/scripts/*.run file:

before pickup(text item, number count) {
    if (item == "cursed_idol") refuse("It burns to the touch.")
}
before damage(number amount, text by) {
    if (by == "spark") amount = amount * 2
}
after levelup(number level, text who) {
    print(who + " is level " + level)
}

The parameters bind by name, so a block asks only for what it needs. A before block runs before the engine acts: it may change the values shown in bold below, or stop the event with refuse("why"), whose words the player sees, or return false. An after block runs once the thing has happened and changes nothing.

pickup
item, count, from
equip
item, slot
damage
amount, target, source, by, type
xp
amount, who
levelup
level, who
cast
spell, caster, target, cost
death
who, killer
use
type, id, who, cooldown
randomtrigger, randomevent
trigger, type; event, from, forced
rest
way, hours, place, interrupted
lookchanged
from, to
container
action, container, item, count (see Containers)
jump
type, pressed, held, buffer, grounded, coyote, wall, airjumps
dodge
type, x, y, speed
interact
prop, type
flashlight, stamina
state, battery; state, stamina
roll
type, who, target, dice, vs, advantage, disadvantage, natural, total, preview
encounter, round
foes, party, rounds, outcome; round
turn
who, type, round, ap, walk
move
who, type, px, walkleft, ap
reaction
who, type, at, why, take
area
spell, caster, shape, x, y, size, bodies, count
target
foe, was, chance, how
log
line, type, who
note
item, title, first
suspicious, noticed, lost, searching, gaveup, found
enemy, index, x, y (a hunter's senses)
fear
level, value, rising
backstage, nudge
enemy, index, x, y, tension, forced
enterzone, exitzone
zone, who, type, index
tilebreak
x, y, layer, tile, by
tilepush
x, y, dx, dy, layer, tile, by

Taking over the controls

The player's walk, jump, attack, dodge and use keys are presets. Switch one off with Player.Preset and its key stops doing its built-in job, so your program can do it instead, in every camera:

// assets/scripts/stride.run: the walk, done by a script
Player.Preset("walk", false)

on update(number dt) {
    number dx = 0
    if (Input.Held("left")) dx = dx - 1
    if (Input.Held("right")) dx = dx + 1
    Player.Move(dx * 140 * dt, 0)
}

Player.Move takes one step as her own walk would, bumping and sliding along walls. World.Hit strikes foes the way her attack does, Player.Nearest() says what the use key would take, and the before jump, before dodge and before interact blocks can change or refuse each one as it happens. Every preset is back on when a play begins.

Built in

print(...)
Writes to the console.
random(max), random(min, max)
A number in that range.
pick(a, b, ...)
One of its arguments, at random.
round(x), round(x, places)
x to the nearest whole number, or to that many places: n = round(random(0, 50)), then if (n < 10) { print("low") }.
floor(x), ceil(x), int(x)
Down, up, or toward 0 to a whole number: floor(3.7) is 3, ceil(3.2) is 4, int(-3.7) is -3.
abs(x), sign(x)
The size of x without its sign, and its sign as -1, 0 or 1: abs(-5) is 5.
min(a, b, ...), max(a, b, ...)
The smallest or largest of its numbers: max(hp - 10, 0).
clamp(x, low, high)
x held between low and high: clamp(150, 0, 100) is 100.
sqrt(x), pow(x, y)
The square root, and x to the power y: sqrt(16) is 4, pow(2, 8) is 256.
mod(x, y)
The remainder of x over y, never below 0 for a y above 0: mod(-1, 4) is 3.
lerp(a, b, t)
The point t of the way from a to b: lerp(0, 100, 0.25) is 25.
refuse("why")
In a before block: the event does not happen.
roll("1d20+3"), roll("2d6+mod", 2)
Dice, through the d20 rules.
log("words"), loglines(n)
Write a line on the combat log, or read its last lines (see Combat).
ap(), walkleft(), endturn()
In a d20 fight: the acting fighter's action points and walk left, and end its turn.
actions(), bonusactions(), movement()
The same, under Action, Bonus Action and Movement.
useaction(), usebonusaction(), usemovement(px), dash(), disengage()
Spend them.
reaction(who), usereaction(who)
Reactions left, or spend one.
target(), settarget(who), hitchance([type])
The fight's target, a new one ("next", "prev" or a foe's type), and her chance to hit.
pathcost(x, y), gridmode(), cellsize()
What a walk there costs this turn, and the grid.
cover(a, b)
The cover b has from a's attack: none, half, threequarters or full.
areabodies(spell, x, y [, caster])
Who an area spell aimed there would catch.
conditions(who), hascondition(who, id), addcondition(who, id, rounds), removecondition(who, id)
The conditions on a body.
addmodifier(tag, n), modifiers(), modifier(tag)
In a before roll block: add to the roll, or read what was added.
rule(name), setrule(name, value)
Read or change a d20 rule for this session.
driven()
Is the acting fighter one the player plays?

A body is "player", a companion's id, "target" or a foe's type.

Declarations

assets/run/*.run declares the shapes of your game's data with enum and struct, and named instances of them. Programs make instances of them with New, and the console's completion offers their fields.

enum Element { None, Fire, Frost, Storm }
enum EnemyType { Foe }

struct Character {
    text   name = "Unnamed"
    number hp   = 100
}

struct Npc : Character {
    text greeting = "..."
}

struct Enemy {
    text      name   = "Unnamed"
    EnemyType type   = Foe
    number    attack = 5
    Element   deals  = None
}

EnemyType lists your enemy types, one value for each type in assets/enemies. An object whose struct has an EnemyType type field appears with Spawn(x, y) as that type, with the object's own hp when its struct has a number field named hp.

Engine objects

Each object also has fields, read with a dot (Water.depth). The methods, from the interpreter's own table:

Terrain

Terrain.Generate()
Build the floor from .preset and .seed.
Terrain.RandomFloor()
A random standable point on the current floor.

Sound

Sound.Play([volume])
Play the clip named by .path.

Water

Water.Place()
Lay water from .x .y .w .h .depth and the wave fields.
Water.Count()
How many lakes and rivers the map holds.
Water.Bodies()
Every lake and river's name, in the Outliner's order.
Water.Find(body)
A lake or river as an object: .name .kind .liquid .speed .intensity .level .texels .litres .course .from .into; false for none.
Water.At(x, y)
The name of the body whose water stands at a world point, "" for none.
Water.Kind(body)
"lake" or "river".
Water.Rename(body, name)
Give a body the name the Outliner shows.
Water.Liquid(body)
The stem of the liquid it holds, "" for the map's own water.
Water.SetLiquid(body, liquid)
Hold a liquid (Liquid.List() names them), "" for the map's own; a river of a carved course takes it downstream.
Water.Direction(body)
Which way a river runs, as its page says it; "" for a lake.
Water.Reverse(body)
The River tool's river carved again the other way; its name after.
Water.Speed(body)
How fast its surface runs downstream, world units a second (its Flow Speed).
Water.SetSpeed(body, speed)
Set its Flow Speed, 0 to 300.
Water.Intensity(body)
Its white water, 0 to 1 (its Foam).
Water.SetIntensity(body, intensity)
Set its Foam, 0 to 1.
Water.Get(body, property)
Any property of a body (Water.Properties() lists them).
Water.Set(body, property, value)
Set a dial (flow waveshare wavedir wavespeed waveheight foam clarity rain evaporation capacity), its liquid or its name.
Water.ClearDials(body)
Every dial of a body back to its liquid's.
Water.Properties()
Every property a body has.
Water.Level(body)
The height of its surface where it stands deepest, as its page measures it.
Water.Texels(body)
How many field texels its water covers, as its page measures it.
Water.Litres(body)
How much water it holds, as its page measures it (a few frames behind the flow).
Water.Course(body)
The carved course a river was made of, 0 for none.
Water.From(body)
The body a river sets out from, "" for none.
Water.Into(body)
The body a river runs into, "" for none.
Water.Census()
Count every body's water now; how many bodies.
Water.Remove(body [, "drain"])
Take a body out of the map; with "drain" its water goes too.
Water.Spring(x, y, litres [, radius])
A spring at a world point, litres a second (under 0 it drains), kept with the map; its number.
Water.Pour(x, y, litres [, rate [, radius]])
Pour litres at a world point, rate litres a second, then stop; its number.
Water.Springs()
How many springs, drains and pours run now.
Water.RainAmount()
The project's Rain Amount: how much water the rain brings, 1 as the weather says, under 0 a drought.
Water.SetRainAmount(amount)
Set the project's Rain Amount, -4 to 10 (0: rain moves no water; under 0: a drought); kept in game.vdc.
Water.Total()
The litres on land in the flow's window now, read from the card; -1 while no water is stepped.
Water.SpringNear(x, y)
The number of the spring nearest a world point, -1 for none.
Water.SpringGet(index, property)
A spring's x, y, litres, radius or left (a pour's litres still to come, -1 for a spring).
Water.SetSpring(index, litres)
Change a spring's litres a second.
Water.RemoveSpring(index)
Stop a spring and take it out of the map; the numbers after it move down one.
Water.AddRapid(body, from, to [, roughness [, speed [, foam]]])
A rapid on a river from and to metres below where the river's own water starts, the mouth of the lake it leaves (Water.Get(body, "length") is its length from there, Water.Get(body, "origin") how far down its course that lies); roughness 0 to 1 (0.6), speed times its Flow Speed (1.6), foam 0 to 1 (0.5); its number, from 1.
Water.RemoveRapid(body, n)
Take a river's rapid n out; the numbers after it move down one.
Water.Rapids(body)
How many rapids a river holds.
Water.RapidGet(body, n, key)
Rapid n's from, to, roughness, speed or foam.
Water.RapidSet(body, n, key, value)
Set rapid n's from, to, roughness, speed or foam.

Liquid

Liquid.List()
Every liquid's name: the engine's, then the project's own.
Liquid.Find(liquid)
A liquid's stem from its name or stem, "" for none.
Liquid.Define(name, shallow, deep [, cloudiness [, thickness [, density]]])
A liquid of the project's own: its colours (RRGGBB) where shallow and deep, cloudiness 0 to 1, thickness (viscosity, 0 to 400), density (water 1); saved as assets/liquids/<stem>.vfa; its stem.
Liquid.Set(liquid, property, value)
Set a property of a liquid of the project's own and save it (Liquid.Properties() lists them).
Liquid.Get(liquid, property)
A liquid's property.
Liquid.Properties()
Every property a liquid has.
Liquid.Engine(liquid)
Is it one of the engine's own, which a script cannot change?

Light

Light.Apply()
Push .ambient into the scene.
Light.Group(group, action [, level [, seconds]])
Every light in a group at once: on, off, dim to a level, flicker, or fade to a level over seconds.
Light.GroupLevel(group)
A light group's level now, 0 to 1, its flicker left out.
Light.Player(field [, value])
Her own light: radius, height, intensity, colour, flicker, regularity. With a value it is set, and in play it holds for the rest of that play.

Time

Time.Scale(rate [, blend])
Run the clock faster or slower.
Time.Stop([blend])
Hold time still.
Time.Resume([blend])
Let time run again.

Fields: .scale (set it too), .target (where a blend is heading), .frozen.

Sky

Sky.SetHour(hour)
Move the sun to an hour of the day.
Sky.Set(property, value)
Set a sky or cloud property (Sky.Properties() lists them).
Sky.Get(property)
A sky or cloud property's value.
Sky.Properties()
Every sky and cloud property.
Sky.Bodies()
How many suns and moons the sky holds.
Sky.AddBody("sun"|"moon")
A new body; its index.
Sky.RemoveBody(index)
Take a body out of the sky.
Sky.BodySet(index, property, value)
Set a body's property (Sky.BodyProperties() lists them).
Sky.BodyGet(index, property)
A body's property's value.
Sky.BodyProperties()
Every property a body has.
Sky.Constellations()
How many constellations the sky holds.
Sky.AddConstellation(name)
A new constellation; its index.
Sky.RemoveConstellation(name)
Take a constellation out of the sky.
Sky.AddStar(constellation, az, el [, brightness])
Place a star in a constellation, in degrees.
Sky.Use(sky)
Wear a sky document (a name in assets/skies, or a path).
Sky.Asset()
The sky document being worn.
Sky.Save()
Write the sky as it stands into its document.
Sky.Preset(layer, name)
Give cloud layer 1 or 2 a whole look, like Sky.Preset(1, "Storm front").
Sky.Presets()
Every cloud preset's name.

Fields: .hour, .dayLength, .sunrise, .sunset, each one set as well as read.

Weather

Weather.Set(type [, density])
Clear rain snow embers fog glitch clouds hail sand.
Weather.Clear()
Back to clear sky.
Weather.Change(type, seconds [, density])
Change the weather over that many seconds: the clouds build or clear, the rain follows.
Weather.Progress()
How far through a change of weather the sky is, 0 to 1.
Weather.Now()
The weather the sky is under, or on its way to.
Weather.ChangeTime(seconds)
How long a change of weather takes on this map.
Weather.Cycle("on"|"off"|"restart")
Run, stop or begin again the map's weather cycle.

Fog

Fog.Use(preset [, seconds])
Blend to a fog preset (off, mist, valley, dense, night) over the seconds.
Fog.Release([seconds])
Back to the map's and the zones' own fog.
Fog.Set(value, to [, seconds])
Set colour (RRGGBB), density, falloff, height, start or opacity, easing over the seconds.
Fog.Get(value)
A fog value in effect now.
Fog.Clear([value])
Drop Fog.Set's hold on a value, or on all of them.
Fog.Preset()
The fog preset in effect, custom while Fog.Set holds a value.
Fog.Presets()
Every fog preset.
Fog.MapPreset()
The map's own fog preset.

World

World.Fire(event [, section])
Run a world event by name (a section, or its use).
World.FlagSet(name)
Raise a story flag.
World.FlagClear(name)
Lower a story flag.
World.Flag(name)
Is that flag raised?
World.SpawnEnemy(type, x, y)
An enemy of a baked type at a place.
World.Enemies([type])
How many enemies are alive (of a type, or all).
World.Slay(type)
Every living enemy of a type (or "all") dies.
World.EnemyDef(type, key, value)
Set an enemy type's hp dice fame xp tier behavior.
World.Enemy(index)
One foe as an object: .x .y .hp .maxHp .type .alive.
World.EnemyCount()
How many foes World.Enemy reads, living or not.
World.Hit(shape, x, y, size, amount [, type])
Strike foes the way her attack does: "arc" ahead of her from x y, "circle" round x y, or "ray" ahead; the damage block hears it; how many were hit.
World.Noise(x, y [, loudness])
A noise enemies with hearing hear at a place; 1 carries as far as their hearing.
World.Tune(key)
A tuning dial's value now: jump_buffer, coyote_time, hop_buffer, walk_speed and the rest of tuning.vfa.
World.SetTune(key, value)
Set a tuning dial for this session.

Camera

Camera.PanTo(x, y [, seconds])
Glide the view to a place.
Camera.Follow()
Give the view back to the character.
Camera.Zoom(mult [, seconds])
A multiple of the authored zoom; 1 is home.
Camera.Shake([hard [, secs]])
Knock the view about.

Player

Player.Give(item [, count])
Put items in her pockets.
Player.Take(item [, count])
Take items from her pockets, all or nothing.
Player.Count(item)
How many of an item she carries.
Player.Equip(item)
Wear an item she carries.
Player.Unequip(slot)
Take off weapon head chest legs feet trinket.
Player.GrantXP(amount)
Experience, the road a slain monster uses.
Player.LevelTo(level)
Level up to a level; levels only climb.
Player.LearnSpell(spell)
She learns a spell from magic.vfa.
Player.Knows(spell)
Does she know that spell?
Player.LearnSkill(skill)
Bestow a skill: no point spent, no prerequisite.
Player.HasSkill(skill)
Has she learned that skill?
Player.Cast(spell)
Cast: the battle if there is one, else the world.
Player.Stat(attribute)
An attribute's total, everything that adds included.
Player.SetStat(attribute, n)
Set an attribute; "+2" or "-2" adjusts.
Player.Heal(amount)
Mend her (never kills outright).
Player.Effect(id, rounds [, secs])
A status effect from effects.vfa.
Player.SetClass(class)
Her class, or "none".
Player.SetRace(race)
Her race, or "" for none.
Player.Quest(quest, stage)
Finish a stage of a quest.
Player.QuestStage(quest)
How many stages of a quest are done.
Player.Teleport(x, y)
Put her somewhere.
Player.Currency(currency)
How much of a currency she holds (Project Settings > Currencies).
Player.AddCurrency(currency, amount)
Add to a currency; a negative takes, never below 0 or past its cap.
Player.Move(dx, dy)
Her walk's step at her next tick, bumping and sliding as her walk does (the side view takes dx).
Player.Preset(preset [, on])
walk, jump, attack, dodge or interact: is that preset on, or switch it for this play.
Player.Nearest([what])
What the use key would take now: its name ("" for none), or with "type" its type.

Fields: .hp, .maxHp, .mp, .maxMp, .gold, .level, .xp, .xpNext, .points, .fame, .x, .y, .vx, .vy, .facing (0 to 7), .grounded, .class, .race, .weight (pockets and worn gear, see Inventory), .capacity (0 when there is none), .flashlight, .battery, .stamina, .crouched and .hidden. A script can set .hp, .mp, .gold, .points, .battery, .stamina, .crouched and .hidden.

Input

Input.Held(action)
Is the action's key down? up, down, left, right, jump, attack, roll, interact and the rest, or a custom action's word (Controls and Gamepad).
Input.Pressed(action)
Did it go down this frame?
Input.Released(action)
Did it come up this frame?

Party

Party.Count()
How many companions travel with her.
Party.Id(index)
A companion's id, 0 = the first.
Party.Level(who)
A companion's level.
Party.XP(who)
Experience banked toward their next level.
Party.XPNext(who)
Experience their next level wants.
Party.Points(who)
Their unspent points.
Party.HP(who)
Their health; 0 = downed.
Party.GrantXP(who, amount)
Experience to one companion (or "all"), through the level-up path.
Party.SetXP(who, amount)
Set what is banked; enough for a level levels them.
Party.LevelTo(who, level)
Level a companion up to a level; levels only climb.
Party.SetPoints(who, n)
Set their unspent points; "+2" or "-2" adjusts.
Party.SetHP(who, n)
Set their health, 0 to their maximum; 0 downs them.
Party.Control(who)
Who plays their d20 turns: "player" or "ai".
Party.SetControl(who, way)
Who plays their d20 turns from now: "player", "ai" or "project" (the Party control rule).

Faction

Faction.Count()
How many parties the factions data holds (the player is one).
Faction.Id(index)
A party's id, 0 = the player's own.
Faction.Name(party)
A party's display name.
Faction.Standing(party)
What a party thinks of her: esteem minus grievance.
Faction.Rung(party)
The name of the rung she stands on in that party's ladder, "" = no ladder.
Faction.Esteem(party)
A party's esteem for her.
Faction.Grievance(party)
A party's grievance with her.
Faction.Regard(holder, about)
What one party thinks of another, esteem minus grievance.
Faction.Member(party)
Does she belong to that party?
Faction.Rank(party)
Her rank there, 0 = not a member.
Faction.RankName(party [, n])
The name of her rank there, or of rank n.
Faction.Ranks(party)
How many ranks the party has.
Faction.CanJoin(party)
"" when she may join, else the reason why not.
Faction.Hears(from, to)
How fast word travels from one party to another, 0..100.
Faction.News()
Does word travel between parties on its own?
Faction.Of(who)
The party a placed character (tag or kind) or an enemy kind belongs to, "" = none.
Faction.SetOf(who, party)
Put a placed character or an enemy kind in a party ("none" = none).
Faction.Peaceful(party)
Do its members leave her alone right now (its peace line)?
Faction.Field(party, key)
A party's own field (a component's), "" = unset.
Faction.SetField(party, key, value)
Set a party's own field; "" removes it.
Faction.Word(key)
The project's word for esteem, grievance, standing, rank ...
Faction.Event()
In a component's hook: heard standing joined left rank.
Faction.EventParty()
In a component's hook: the party it is about.
Faction.EventDeed()
In a component's hook: the deed, "" when none.
Faction.EventValue()
In a component's hook: the standing, the rank, or the actor party.
Faction.Witness(deed, party)
A party sees her do a deed and judges it.
Faction.Rumour(deed, party)
A party believes she did a deed; it is not true.
Faction.Set(party, esteem, grievance)
Set a party's view of her outright.
Faction.Join(party)
She joins, if the party takes her.
Faction.Leave(party)
She leaves a party.
Faction.Promote(party)
She rises one rank.
Faction.Demote(party)
She falls one rank, never below the first.
Faction.SetRank(party, n)
Her rank outright, no gate; 0 leaves.

RandomEvents

RandomEvents.Fire(trigger)
Ask a trigger now (or every called trigger with that name); the events drawn.
RandomEvents.Draw(table)
Draw from a table now, obeying every rule; the events drawn.
RandomEvents.Run(event)
Run an event past its conditions, cooldown and limits.
RandomEvents.Try(event)
Run an event only if it can happen now.
RandomEvents.FollowUp(event, delay [, unit])
Try an event later: seconds, minutes, hours or days.
RandomEvents.Cancel(event)
Drop an event's waiting runs and follow-ups; how many.
RandomEvents.Can(event)
"" when it can happen now, else the reason.
RandomEvents.Why(id)
An event's conditions with their values, or a trigger's or table's last result.
RandomEvents.Count(event)
The times it has run this game.
RandomEvents.Since(event)
Game hours since it last ran, -1 never.
RandomEvents.Last(table)
The last event a table drew.
RandomEvents.On(id)
Is the trigger, table, entry, event or group enabled?
RandomEvents.Enable(id)
Switch a trigger, table, entry, event or group on.
RandomEvents.Disable(id)
Switch it off.
RandomEvents.Get(id, field)
Any field of any row, as text.
RandomEvents.Set(id, field, value)
Change any field of any row for this game (saved).
RandomEvents.SetWeight(table, event, weight)
An event's weight in a table; adds the entry when it has none.
RandomEvents.SetCooldown(event, n [, unit])
An event's cooldown.
RandomEvents.Reset(event)
Its count and last time cleared, its row as authored.
RandomEvents.Create(type, id [, copyOf])
A new trigger, table, entry, event, outcome or group for this game (saved).
RandomEvents.Pacing()
The pacing meter now.
RandomEvents.AddPacing(n)
Raise or lower the pacing meter.
RandomEvents.Pause([on])
Hold every trigger (off lets them ask again).
RandomEvents.Paused()
Are the triggers held?
RandomEvents.Pending()
Events waiting to run plus follow-ups.
RandomEvents.Seed()
The generator's state.

Look

Shader effects (see Shader Effects).

Look.Use(look [, seconds])
Switch to a shader effect, blending over the seconds.
Look.Release([seconds])
Back to the level's own shader effects.
Look.Set(option, value [, seconds])
Set any component option ("outline.width", "hatch" for its on), easing over the seconds.
Look.Get(option)
An option's value in effect now.
Look.Clear([option])
Drop Look.Set's hold on an option, or on all of them.
Look.Name()
The shader effect with the most weight here.
Look.Key(option, hour, value)
An option follows the time of day: a value at an hour.
Look.ClearKeys([option])
Drop Look.Key's keys.
Look.MapDefault(map, look)
A map's own shader effect, over its placed Shader Effects ("level" gives it back).
Look.Enable(object)
Switch a placed Shader Effect of this level on.
Look.Disable(object)
...and off.
Look.Objects()
How many Shader Effects this level holds.
Look.Library()
The shader effects the engine ships.
Look.Pulse(strength [, seconds])
One throb: the edges darken and redden and the vignette pushes in.
Look.Heartbeat(bpm [, strength [, seconds]])
A steady throb at a rate, easing over the seconds (0 stops it).
Look.Beat()
The throb on screen now, 0 to 1.

Audio

Sounds by name, layered music, reverb zones and muffling (see Sound and Music).

Audio.Play(name, file [, loop, volume, seconds])
Play a sound by name, fading in over the seconds.
Audio.PlayAt(name, file, x, y [, loop, volume, seconds])
...at a world point, heard from its side.
Audio.PlayOn(name, file, who [, loop, volume, seconds])
...on a prop, a character or the player, following it.
Audio.Start(name [, seconds])
Start a prop's sound or a tagged emitter by its tag; how many.
Audio.Stop(name [, seconds])
Stop every sound of that name or tag, fading over the seconds; how many.
Audio.Fade(name, volume, seconds)
Move every sound of that name to a volume; how many.
Audio.Loop(name, on)
Loop a playing sound, or let it end.
Audio.Muffle(name, on)
A directional sound with a wall between is muffled.
Audio.Playing(name)
Is a sound of that name playing?
Audio.Level(name)
Its level now, fades included; -1 = not playing.
Audio.Track(track [, seconds])
Play a layered music track.
Audio.TrackStop([seconds])
Fade the layered track out.
Audio.Stem(track, file, curve)
Add a stem to a track for this game: always rise early late peak fall calm.
Audio.Curve(index, curve)
Change a playing stem's curve.
Audio.Tension(level [, seconds])
The tension the stems follow, 0 to 1, reached over the seconds.
Audio.TensionNow()
The tension now.
Audio.Duck(source, how)
Voices lower the rest while they sound: off light medium strong hush, or dB.
Audio.Sting(name, file, how [, volume])
A one-shot that lowers the rest while it plays.
Audio.Reverb(zone, field, value)
A reverb zone's preset, wet, blend, sizex, sizey, sizez, x, y, z, on or name.
Audio.ReverbHere()
The reverb preset heard at the listener, "" = none.
Audio.Preset(preset, field, value)
A reverb preset's decay, damp, wet, predelay or size.
Audio.Muffling(field, value)
How muffled sounds sound: cut in Hz, or level 0 to 1.
Audio.Attach(prop, file [, volume])
A prop carries a looping sound, saved with the map.
Audio.Detach(prop)
...and no longer.

Notes

Notes.Open(item)
Open the reader on a note: it is filed and read.
Notes.Read(item)
Has a note been read?
Notes.Found(item)
Has a note been found?
Notes.List()
The notes found, in the order found, by item id.
Notes.Title(item)
A note's title.
Notes.Close()
Shut the reader.
Notes.Archive()
Open the Notes archive.

Zone

Zone.Who()
In a zone's enter or exit: the body, player, an enemy's tag or type, a companion's id, a villager's or a prop's tag.
Zone.Type()
...its type: player, the enemy's type, companion, villager or prop.
Zone.Index()
...its index among its type's bodies, 0 for her.
Zone.Name()
...the zone.
Zone.Entered()
...true going in, false coming out.
Zone.Fires(zone)
Who fires a zone: her, enemy, type <type>, tag <tag>, companion or anybody.
Zone.SetFires(zone, who [, name])
Who fires a zone from now, and the type or tag.
Zone.Last(zone)
The last body that went into a zone, "" = none yet.

Tiles

The open map's tile layers. A cell is its column and row from the world origin; a layer is its name or number, and with none the topmost layer holding a tile there.

Tiles.Get(x, y [, layer])
The tile in a cell, its number in its tileset; -1 = empty.
Tiles.Set(x, y, index [, layer [, tileset]])
Put a tile in a cell; -1 empties it.
Tiles.Break(x, y [, layer])
Break the tile in a cell: its break effect plays, terrain neighbours re-pick, and tilebreak is raised.
Tiles.Move(x, y, dx, dy [, layer])
Slide the tile to the cell dx dy away when that cell is free; tilepush is raised.
Tiles.Is(x, y, flag [, layer])
Does the cell's tile carry the flag: solid, climbable, moveable or breakable?
Tiles.Cell(n [, layer])
The column or row a world x or y falls in.
Tiles.Size([layer])
A layer's cell in world units.
Tiles.Layers()
How many tile layers the map has.

Fear

The fear meter, when the project has one (Project Settings > Fear). While an enemy with senses has her in sight, the source "seen" adds 5 a second times the Seen by an enemy row; it adds nothing until that row is set.

Fear.Value()
The fear now, 0 to 100.
Fear.Set(level)
Set the fear, 0 to 100; it holds while frozen.
Fear.Add(amount [, source])
Raise or lower the fear by a named source ("seen", "scare" or any name), scaled by its row; nothing while frozen.
Fear.Freeze()
Hold the fear where it is.
Fear.Unfreeze()
Let the sources move it again.
Fear.Frozen()
Is the fear held?
Fear.On()
Does this project have a fear meter?
Fear.Thresholds()
The threshold levels.
Fear.Level()
The highest threshold the fear stands at or above, 0 for none.
Fear.Light()
How lit she stands, 0 to 100.
Fear.Source(source)
What a source moved the fear by over the last second.
after fear(number level, number value, toggle rising)
Answers each threshold crossed, up or down.

Needs

The survival needs, when the project has them (Project Settings > Needs). A need is named by its word: hunger, thirst, tiredness, cold or heat. See Needs.

Needs.On([need])
Does this project have needs; with a need, is that one on?
Needs.Value(need)
The need now, 0 to 100 (100 is met).
Needs.Set(need, value)
Set a need, 0 to 100.
Needs.Add(need, amount)
Give back (plus) or take (minus); answers what moved.

Tension

The tension director, when the project has it on (Project Settings > Project > Tension). One value from 0 to 1 built from the hunters, the enemies whose type has senses keys: how near the nearest-pressing one is, whether it sees her, how far its path to her is, and its state (chase most, then search, investigate and return), plus scares. It rises and falls at the page's rates. Held above Send away above for Held for seconds, the director sends that hunter backstage: it walks out past the reach and stands there for Away for seconds, then walks back to its route. Held below Nudge below for Quiet for seconds, it sends the nearest hunter on its route to look about a place near her, never on her. With Drives the music on the value is the sound scene's tension; with Drives the pacing meter on the random events' pacing meter reads at least the value times pacing_limit.

Tension.Now()
The tension now, 0 to 1 (0 while the director is off).
Tension.Target()
Where it is heading before the rise and fall rates.
Tension.Part(part)
A part of it now: near, sight, path or state of the pressing hunter, or scare.
Tension.State()
The director's state: off, build, peak, relax or quiet.
Tension.Hunter()
The index of the hunter pressing hardest, -1 for none.
Tension.On()
Is the tension director on?
Tension.Add(amount)
A scare: raises the tension, fading at the fall rate.
Tension.Backstage([enemy [, seconds]])
Send a hunter away now (the pressing one, or by index, placed tag or type); true if it went.
Tension.Nudge([enemy])
Send a hunter on its route to look about a place near her; true if it went.
Tension.Get(setting)
A setting now: on, rise, fall, reach, high, highfor, away, low, lowfor, hint, music, pacing, and the weights near, sight, path and state.
Tension.Set(setting, value)
Change a setting for this game.
before backstage(text enemy, number index, number x, number y, number tension, toggle forced)
Before a hunter is sent away: move x and y to send it elsewhere, or refuse. After: where it went.
before nudge(text enemy, number index, number x, number y, number tension, toggle forced)
Before a hunter is hinted toward her: move x and y, or refuse. After: where it was sent to look.

Ocean

Ocean.Add([x, y [, level]])
A new ocean: over the terrain at its waterline, or at x, y; its name.
Ocean.Remove(ocean)
Take an ocean out of the level.
Ocean.Set(ocean, property, value)
Set any property (Ocean.Properties() lists them), or "name".
Ocean.Get(ocean, property)
A property's value.
Ocean.Move(ocean, x, y [, level])
Move an ocean, and its surface height.
Ocean.Enable(ocean)
Switch an ocean on.
Ocean.Disable(ocean)
...and off.
Ocean.Objects()
How many oceans this level holds.
Ocean.Name(index)
The name of the ocean at an index.
Ocean.Find(ocean)
An ocean's index, -1 for none.
Ocean.Properties()
Every property an ocean has.
Ocean.HeightAt(x, y)
The surface height with its waves at a point.
Ocean.Under(x, y, height)
Is a point under an ocean's surface?

Steam

Steam.Running()
Is Steam up for this game?
Steam.Name()
The player's Steam name, "" without Steam.
Steam.Unlock(achievement)
Unlock an achievement by its API name and store it; did it take?
Steam.Achieved(achievement)
Has the player unlocked it?
Steam.SetStat(stat, value)
Set a stat by its API name (stored by Steam.StoreStats); did it take?
Steam.Stat(stat)
A stat's value, 0 without Steam.
Steam.StoreStats()
Send the stats and achievements to Steam.
Steam.Overlay([page])
Open the Steam overlay: achievements friends stats store, or a web address.

Every method is checked against its signature above before it runs. Too few or too many arguments, a word where a number goes, a name the game does not have (an item, a spell, a party, an event), and an impossible request are errors that name what was wrong, and nothing is changed. Taking more than she holds is one of those: Player.Take("iron_sword", 999) with one sword takes nothing and says she carries one. Readings that answer a question about a name (Ocean.Find, Player.Knows) answer rather than refuse.

Some methods need a running game: a player to give things to, a camera to move, a fight to be in. In the editor they refuse and say so. Readings (Player.Count, Player.Knows, Player.Stat and the like) work in both.