DG Scripts
Build worlds that respond.
A code-backed guide to triggers, variables, commands, and TRIGEDIT in LuminariMUD.
set gender one
if %actor.sex% == male
set gender lad
elseif %actor.sex% == female
set gender lady
end
wait 2 s
emote looks up and peers at you keenly as she smiles in greeting.
wait 2 s
say Why hello little %gender%.
wait 2 s
say Have a look around if it pleases you.
wait 2 s
say I hope you find what you are looking for.
wait 2 s
emote smiles strangely at you as she turns back to her work.
From event to behavior
A DG Script is a trigger prototype attached to a mobile, object, or room. The runtime supplies event variables; your command list decides what happens next.
-
1
Choose an owner
Put the behavior on the mobile, object, or room that owns the event.
Owner rules -
2
Choose an event
Command, greet, speech, load, timer, combat, and time events expose different data.
Trigger matrix -
3
Set arguments
The Numeric Arg may mean chance, hour, threshold, or an object location mask.
Argument semantics -
4
Write behavior
Combine variables, control flow, waits, and commands from the owner's interpreter.
Command reference -
5
Attach and prove
Attach through OLC, load a fresh instance, exercise both branches, and inspect state.
Testing workflow
Five parts, one trigger
TRIGEDIT stores the prototype as five essential decisions. The event hook and owner type determine which variables and commands are safe to use.
- ANameA searchable builder-facing description.
- BIntended ownerMobile, object, or room.
- CTrigger typesOne or more event flags for that owner.
- DNumeric Arg and ArgumentsEvent-specific configuration, not generic parameters.
- ECommandsThe script body run by
script_driver().
A (70) Hiding girl beckons
B Intended for: Rooms
C Trigger type: Enter
D Numeric Arg: 100
Arguments: (empty)
E if %direction% == west
wait 1 s
%send% %actor% You hear a shuffling sound from under the bed.
end
The complete builder shelf
Use the tutorial when you are learning the execution model, then keep the reference pages open beside TRIGEDIT.
The Dollhouse, opened
Zone 118 is a production-scale case study: room transitions, staged dialogue, persistent quest state, object timers, indirect variables, and cooperating owners.
- VNUM range
- 11800-11899
- Trigger prototypes
- 95 in
lib/world/trg/118.trg - Zone lifespan
- 8 minutes
- Player level range
- 5-10
shop 11804
threshold 11822
arrival 11870
bedroom 11871
under bed 11896
focus
Accuracy is part of the workflow
This guide distinguishes source-defined behavior from builder convention and links each reference area to the implementation that governs it.
Trace the event hook
Know exactly when a trigger fires and which values the hook injects.
Use real UIDs
Take them from event variables or makeuid; never invent them.
Cache before movement
Save next_in_room before teleporting while iterating characters.
Test fresh instances
TRIGEDIT refreshes matching trigger nodes, but attachment sets, aggregate flags, and owner-global state are not rebuilt with the owner.
Validate world files
Use wtool to catch malformed records and broken references.
Inspect both state layers
Local variables die with a run; owner globals and remote player state can persist.