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

  1. Your first script — set a script on a mob, trigger it, watch it run.
  2. Reacting to commands — command handlers, filters, $actor, $args.
  3. Variables and control flowlet, set, if, each.
  4. Persistent statestore, recall, making mobs remember things.
  5. Working with entities — creatures, objects, rooms, finding things.
  6. Defining functionsdef, const, blocks as values.
  7. Advanced handlers — multiple handlers, require/unless, phases, interception.
  8. Debuggingolc 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:

  1. olc medit <vnum> to start editing a mob.
  2. olc mset script to open the script editor.
  3. Type or paste the script, then @ on a new line to save.
  4. olc mload <vnum> to load the mob into your room.
  5. Trigger the event (say something, enter the room, wait for a tick).
  6. 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.