The Tempus Script Language Specification
A reference for the scripting language embedded in Tempus. It defines the language's syntax and behavior: how source is written and parsed, the type and value model, declarations and scope, expressions and control flow, the catalog of built-in operations, and how scripts are initialized and run in response to game events.
Chapters
- Notation — grammar conventions, terminology, how to read examples.
- Source code representation — characters, lines, comments, the embedded world-file forms.
- Lexical elements — tokens, integer/boolean literals, barewords, separators, the two string forms, sigils.
- Constants — literals, compile-time typing, named values (
const). - Variables — the variable namespace,
let/set, persistent state (store/recall). - Types — the closed type set: scalars, entity references, iterables, blocks, lists.
- Properties of types and values — equality, boolean contexts, string conversion, binding and sharing.
- Blocks — block bodies, parameter forms, arity, block value and return.
- Declarations and scope — the two namespaces,
def/const, lexical scope and lookup. - Expressions — argument forms, command calls, substitution, operators, control flow.
- Built-in functions — the catalog of built-in functions.
- Program initialization and execution — top-level forms, hoisting, handlers, phases, filters.
- Error conditions — compile-time versus run-time errors.
- Run-time — control-flow propagation, suspension, execution limits, and determinism.
Orientation
A complete script is a sequence of top-level forms — def, const, and
event handlers (Declarations and scope,
Program initialization and execution).
Most examples throughout are fragments: read a bare statement as if it sat
inside an enclosing block body.
# a representative handler
after command (say sayto) {
require [keyword $args chat gossip]
store $self 'state' 'gossip'
do ">$actor Let's talk."
}
Examples are drawn from or modelled on working scripts.