TRIGEDIT-ADVANCED

From 4Dimensions
Jump to: navigation, search

TRIGEDIT-ADVANCED

{cRWARNING: long and verbose (wordy){c0


To add life to the worlds circlemud uses something called scripts (or triggers).

There are three major types of game objects which can use scripts. These are

mobiles (mobs), objects, and rooms (world objects). Examples of scripts in the

game are:


Cityguards screaming 'PROTECT THE INNOCENT! BANZAI! CHARGE!', (a mob script).

A portal that teleports players when they enter it (an object script).

A room that creates a new exit when a player pulls a lever (a room script).


Each game item (room, mobile, or object) can have a script. A script is composed

of one or more triggers, which work in collaboration to define complex actions

of the game object. A trigger is a definition of an event that the script watches

for, and list of commands to execute when that event occurs.


There are several different types of triggers. Each trigger type determines

when the trigger will be checked. For example, a mob speech trigger is checked

every time a character who is in the same room as the mob with the trigger uses

the 'say' command. A room enter trigger is checked every time a character

enters the room. There are two parts of the trigger used to determine if the

trigger's commands are executed when it is checked, the argument and numerical

argument (NArg). Some triggers use both; some may use only one of the two; and

some may use neither. The interpretation of these two fields is dependant on

the type, and is described in more detail on the webpage and in the help files.


When an event in the game occurs, each script in the room where the event

occurred is checked to see if there are any triggers which are supposed to

react to that event. A trigger currently running (such as from a 'wait'

command) is skipped. Only one trigger of each script will be run by a single

event. For example, if there are two triggers on a script, and both are the

same type with the same arguments, the second trigger will only be run if the

first one is already running.


Triggers can be of more than one type. For example, to simulate a cursed item,

a trigger on the object could be of types drop, give, and remove. A more common

combined trigger would have both random and global types, so the random trigger

would be checked even when the zone was empty. Combined triggers must have the

same argument and numerical argument.


The other component of a trigger is the command list. This is a series of

commands that are executed when the trigger is run. Commands are chosen from

two groups of commands, script specific commands and game commands. Script

specific commands are those commands that only the script interpreter can

recognize. These include flow control commands (such as if, elseif, else, end,

halt, wait, and return), and commands to manipulate variables (such as set,

eval, unset, and global). Game commands are those commands that a player could

issue from their command line as well as special commands added for mobiles,

objects, and rooms.