Rûn Engine Objects
A program reaches the engine through its objects. They are always there: a program calls Player.Give(...) or reads Player.hp without making anything first. Event scripts reach the same engine through verbs (give, say, camera) and readings (hp, gold).
Calling an object
Object.Method(arguments)- Does something or answers a question:
Player.Count("apple"). Object.field- Reads a value:
Player.hp,Sky.hour. Object.field = value- Sets a value the object lets a script set:
Player.gold = 100.
print(Player.level >= 1, Sky.hour >= 0, World.Flag("obj_never_set"))on on offEvery call is checked against the method's signature before it runs. Too few or too many arguments, a word where a number goes, or a name the game does not have stops the program with an error that names what was wrong, and nothing is changed.
print(Player.Count())Player.CountPlayer.Fly(10)Player has no method named FlyThe families
- Rûn Objects: The Player
Player,Party,Input,Needs: her pockets, stats, quests, position and the party; the keys; survival needs.- Rûn Objects: The World
World,Zone,RandomEvents,Faction,Notes,Fear,Tension,Steam: flags, enemies, events, zones, factions, notes and the director.- Rûn Objects: The Scene
Camera,Time,Sky,Weather,Fog,Light,Look,Audio,Sound: what she sees and hears.- Rûn Objects: The Land
Terrain,Tiles,Water,Liquid,Ocean: the ground, tile layers, lakes, rivers and seas.
Every method of every object, with its signature, is listed on Rûn Programs, read from the interpreter's own table; every verb an event script can use is on the Rûn Verb Index. The console completes an object's methods after you type the dot.
Objects of your own
A project declares its own types in assets/run/*.run (struct Enemy { ... }) and makes them in a program with New Enemy { name = "Wolf" }. Their fields read and set with a dot like an engine object's. See the Declarations part of Rûn Programs.