Tempus Script Tutorial
A hands-on guide to writing scripts for Tempus. Each chapter walks through a concept with a working example you can type in and test immediately. By the end, you will be able to write scripts that make NPCs talk, react to commands, track state, and interact with the world.
Prerequisite: You need an immortal character with OLC permissions.
Chapters
- Your first script — set a script on a mob, trigger it, watch it run.
- Reacting to commands — command handlers, filters,
$actor,$args. - Variables and control flow —
let,set,if,each. - Persistent state —
store,recall, making mobs remember things. - Working with entities — creatures, objects, rooms, finding things.
- Defining functions —
def,const, blocks as values. - Advanced handlers — multiple handlers,
require/unless, phases, interception. - Debugging —
olc mtrace, tracing output, common errors.
How to use this tutorial
Each chapter has a script you can paste into the OLC editor. The workflow is always the same:
olc medit <vnum>to start editing a mob.olc mset scriptto open the script editor.- Type or paste the script, then
@on a new line to save. olc mload <vnum>to load the mob into your room.- Trigger the event (say something, enter the room, wait for a tick).
- Observe the result.
Chapter 1 walks through this process in full detail.
Reference
The Script Language Specification is the complete reference. This tutorial teaches the same language, but organized by task rather than by grammar.