Staff Commands for Managing Script Variables
DG Script variables are used to store persistent data on game entities (players, mobiles, objects, and rooms). These variables can be set by triggers and persist across sessions for players. Staff members have access to commands for viewing, modifying, and deleting these variables for debugging and administrative purposes.
Many commands require a UID (Unique Identifier). You can find an entity's UID by using
the stat command on it. The UID is displayed in the output and is used to reference that
specific instance of a mob, object, or room.
Commands for inspecting DG Script triggers and variables on game entities.
| Command | Usage | Description |
|---|---|---|
stat scriptvar |
stat scriptvar <target> |
Shows attached triggers, script memory, and all global variables on a mob or player.
LVL_IMMORT act.wizard.c:1398 |
stat |
stat <mob|obj|room> |
Normal stat output includes script/trigger information at the end. Calls the appropriate
do_sstat_* function for the entity type.
|
tstat |
tstat <vnum> |
Stats a trigger prototype by its VNUM, showing trigger type, commands, and configuration.
LVL_BUILDER dg_scripts.c:3357 |
vstat |
vstat { o | m | r | t | s | z } <vnum> |
Stats a prototype by VNUM without loading it into the game. Options: object,
mobile, room, trigger, shop,
zone.
LVL_IMMORT act.wizard.c:1874 |
Commands for creating or modifying DG Script variables.
| Command | Usage | Description |
|---|---|---|
set variable |
set <player> variable <varname> <value> |
Sets a DG global variable on a player or mobile. Creates the variable if it doesn't exist,
or updates it if it does.
LVL_GRSTAFF dg_scripts.c:2563 |
Commands for removing DG Script variables from game entities.
| Command | Usage | Description |
|---|---|---|
vdelete |
vdelete <varname> <uid> |
Deletes a specific variable by name from the entity with the given UID.
LVL_BUILDER dg_scripts.c:2460 |
vdelete all |
vdelete { * | all } <uid> |
Deletes ALL variables from the entity with the given UID. Use with caution!
LVL_BUILDER dg_scripts.c:2460 |
Using vdelete all or vdelete * will permanently remove all variables
from the target. For players, this can break quest progress and other scripted content.
Always confirm the UID and backup if possible before mass deletion.
Commands for dynamically adding or removing triggers from game entities at runtime.
| Command | Usage | Description |
|---|---|---|
attach |
attach { mob | obj | room } <trig_vnum> <target> [location] |
Attaches a trigger to an entity. Shortcuts: mtr, otr, wtr.
The optional location specifies position in trigger list (-1 = end, 0 = beginning).
LVL_BUILDER dg_scripts.c:1061 |
detach |
detach { mob | obj | room } <target> { trig_vnum | all } |
Removes a trigger (or all triggers) from an entity.
LVL_BUILDER dg_scripts.c:1282 |
You can only attach/detach triggers in zones you have edit permission for. This prevents accidental modification of content in other builders' zones.
Summary table of all DG Script staff commands.
| Command | Purpose | Level |
|---|---|---|
stat scriptvar <target> |
View triggers and variables on a mob/player | LVL_IMMORT |
tstat <vnum> |
View trigger prototype definition | LVL_BUILDER |
vstat <type> <vnum> |
View entity prototype by VNUM | LVL_IMMORT |
set <char> variable <name> <val> |
Set a variable on a character | LVL_GRSTAFF |
vdelete <name> <uid> |
Delete a specific variable | LVL_BUILDER |
vdelete all <uid> |
Delete ALL variables from an entity | LVL_BUILDER |
attach <type> <trig> <target> |
Attach a trigger to an entity | LVL_BUILDER |
detach <type> <target> <trig|all> |
Remove trigger(s) from an entity | LVL_BUILDER |
For developers, here are the source file locations for these commands:
| Function | File | Line |
|---|---|---|
do_vstat |
src/act.wizard.c | 1874 |
do_stat_scriptvar |
src/act.wizard.c | 873 |
do_sstat_character |
src/dg_scripts.c | 1020 |
do_sstat_object |
src/dg_scripts.c | 1008 |
do_sstat_room |
src/dg_scripts.c | 996 |
do_tstat |
src/dg_scripts.c | 3357 |
perform_set_dg_var |
src/dg_scripts.c | 2563 |
do_vdelete |
src/dg_scripts.c | 2460 |
do_attach |
src/dg_scripts.c | 1061 |
do_detach |
src/dg_scripts.c | 1282 |