One of TBA's strong points is that I expect people to learn trigedit IN GAME. That is why the only current trigedit resource (outside of TBA and its donated help files) is Welcor's outdated webpage. But, I can understand how some people prefer a searchable webpage. So, for them, here is TBA's trig.hlp as of SEP2007. But I still recommend people log into TBA so they can TSTAT and test triggers the right way. Please comment if you have any feedback or additions. Thanks.
-Rumble
sorry for the bad formatting, this is just a cut and paste.
TRIGEDIT-TYPES TYPES TRIGGER-LIST TRIGGER-TYPES TRIG-TYPES OBJ-TRIG-TYPES TRIGEDIT-ROOMS TRIGTYPES TRIGEDIT-VALUES TRIGEDIT-NUMERICARG TRIGEDIT-MOBILE-TYPES TRIGEDIT-OBJECTS TRIGEDIT-OBJECT-TYPES TRIG_TYPES
Triggers are broken up into three types by what they are attached to:
| ROOMS | OBJECTS | MOBS |
=============================================================================
| TRIGEDIT-ROOM-GLOBAL | TRIGEDIT-OBJ-GLOBAL | TRIGEDIT-MOB-GLOBAL |
| TRIGEDIT-ROOM-RANDOM | TRIGEDIT-OBJ-RANDOM | TRIGEDIT-MOB-RANDOM |
| TRIGEDIT-ROOM-COMMAND | TRIGEDIT-OBJ-COMMAND | TRIGEDIT-MOB-COMMAND |
| TRIGEDIT-ROOM-SPEECH | TRIGEDIT-OBJ-TIMER | TRIGEDIT-MOB-SPEECH |
| TRIGEDIT-ROOM-ZONE | TRIGEDIT-OBJ-GET | TRIGEDIT-MOB-ACT |
| TRIGEDIT-ROOM-ENTER | TRIGEDIT-OBJ-DROP | TRIGEDIT-MOB-DEATH |
| TRIGEDIT-ROOM-DROP | TRIGEDIT-OBJ-GIVE | TRIGEDIT-MOB-GREET |
| TRIGEDIT-ROOM-CAST | TRIGEDIT-OBJ-WEAR | TRIGEDIT-MOB-GREET-ALL |
| TRIGEDIT-ROOM-LEAVE | TRIGEDIT-OBJ-REMOVE | TRIGEDIT-MOB-ENTRY |
| TRIGEDIT-ROOM-DOOR | TRIGEDIT-OBJ-LOAD | TRIGEDIT-MOB-RECEIVE |
| TRIGEDIT-ROOM-TIME | TRIGEDIT-OBJ-CAST | TRIGEDIT-MOB-FIGHT |
=========================| TRIGEDIT-OBJ-LEAVE | TRIGEDIT-MOB-HITPRCNT |
| TRIGEDIT-OBJ-CONSUME | TRIGEDIT-MOB-BRIBE |
Further help can be =========================| TRIGEDIT-MOB-LOAD |
accessed by typing: | TRIGEDIT-MOB-MEMORY |
@RHELP @n. | TRIGEDIT-MOB-CAST |
i.e. @RHELP TRIGEDIT-MOB-ACT@n | TRIGEDIT-MOB-LEAVE |
| TRIGEDIT-MOB-DOOR |
| TRIGEDIT-MOB-TIME |
See also: TRIG-COMMANDS, VARIABLES, EXPRESSIONS =========================
#31
TRIGEDIT-COMMANDS TRIG-COMMANDS TRIGGER-COMMANDS TRIGEDIT-COMMANDLISTS %COMMANDS% MUD-COMMANDS TRIGEDIT-COMMANDLIST TRIGEDIT-COMMAND-LIST TRIGEDIT-MENU-COMMANDS TRIGEDIT-MOBILE-COMMANDS TRIGEDIT-MOB-COMMANDS TRIG-COMMANDLIST TRIGEDIT_COMMANDS TRIGEDIT-OBJECT-COMMANDS ROOM-COMMANDS OBJECT-COMMANDS TRIG-MOB-COMMAND TRIGEDIT-MUDCOMMANDS
| Trigger Commands | Mobile Commands | Object Commands | Room Commands |
=============================================================================
| * (comment) | %send% | %send% | %send% |
| nop | %echo% | %echo% | %echo% |
| attach | %echoaround% | %echoaround% | %echoaround% |
| global | %door% | %door% | %door% |
| context | %force% | %force% | %force% |
| eval | %load% | %load% | %load% |
| set | %purge% | %purge% | %purge% |
| unset | %teleport% | %teleport% | %teleport% |
| detach | %damage% | %damage% | %damage% |
| extract | %zoneecho% | %zoneecho% | %zoneecho% |
| if | %asound% | %asound% | %asound% |
| halt | dg_affect | dg_affect | dg_affect |
wait | dg_cast | dg_cast | dg_cast |
| makeuid | %at% | %at% | %at% |
| rdelete | %transform% | %transform% |==================|
| remote | mhunt | otimer |
| return | mremember | osetval |
| switch | mforget |===================|
| case | %goto% |
| break | mkill |
| done | %junk% | Further help can be accessed by
| while | %follow% | typing: @RHELP @n.
=======================================|
See also: TRIG-TYPES, VARIABLES, EXPRESSIONS
#31
%DAMAGE% ODAMAGE MDAMAGE WDAMAGE TRIGEDIT-DAMAGE TRIGEDIT-ROOM-DAMAGE TRIG-DAMAGE
%damage% %victim% amount
Cause amount points of damage to victim. The amount can be negative, to
create a healing effect.
%damage% %actor% -20 - cause 20 points of healing
%damage% %actor% 20 - cause 20 points damage
%damage% %actor% %random.20% - cause 1-20 points damage randomly
eval stunned %actor.hitp% - evaluate all hitpoints and then damage
%damage% %actor% %stunned% - leaving the player stunned, but will recover
eval num_hitp %actor.hitp%/2 - calculate half of hitpoints and then damage
%damage% %actor% %num_hitp%
Example: @RTSTAT 16, 51, 3008@n
See also: DAMAGE, GUNS, DEATH
#31
%DOOR% WDOOR ODOOR MDOOR TRIGEDIT-EXIT TRIG-EXIT TRIGEDIT-DOORS TRIGEDIT-MENU-DOORS SECRET-DOORS TRIG-DOOR %EXIT%
%door% < direction> < field> [value]
Used for adding, deleting, and modifying doors in room vnum. Direction
determines which door is being changed, and can be north, south, east, west,
up, or down. If the door does not exist first, a new door will be created.
Field is what property of the door is being changed. Valid fields are:
purge - remove the exit in the direction specified - no value needed
description - value will become the new exit description
flags - value will be the new door flags bitvector as defined here:
a - Exit is a door that can be opened and closed. Default is open
b - The door is closed.
c - The door is locked.
d - The door is pick-proof.
key - value is the vnum of the key to the door in this direction.
name - value is the name of the door in the specified direction.
room - value is the vnum of the room this direction leads to
Example: @RTSTAT 17, 23603@n
#31
%ECHO% %ECHOAROUND% %SEND% TRIG-SEND %ZONEECHO% ZONEECHO ZONECHO %ZONECHO% ZECHOAROUND ECHOAROUND OECHO WECHO MECHO OECHOAROUND WECHOAROUND MECHOAROUD OSEND WSEND MSEND ZONECHO RECHO %ZECHO% ZSOUND MECHOAROUND MZONEECHO MRECHO
%echo%
Message is sent to all non-sleeping characters in the same room that this
trigger is executing in.
%echoaround%
Message will be sent to all characters in the room with victim, except for
the victim.
%send%
Message will be sent to the victim only.
%zoneecho%
Zoneecho echoes message to the entire zone. room vnum should be any vnum in
the zone you wish to echo to. 13400 would echo in zone 134.
To send a blank line use: %send% %actor% \
NOTE: When used with mobs make sure the mobs can see the players.
i.e not blind, set INFRA, DET_INVIS.
Example: @RTSTAT 18@n
See also: %ASOUND%
#31
FINDOBJ FINDMOB TRIG-FINDOBJ TRIG-FINDMOB %FINDOBJ% %FINDMOB%
Usage: findobj.()
- counts the number of objects in room with this name/id/vnum.
Usage: findmob.()
- counts the number of mobs in room with vnum.
For example if you want to check how many fido's are in room 1204
use %findmob.1204(3011)%. To find out how many objects of vnum 1234
are in room 453 use %findobj.453(1234)%.
See Also: SPEC-VAR
#31
%FORCE% OFORCE WFORCE MFORCE TRIGEDIT-FORCE TRIG-FORCE
%force%
Force the victim to perform a particular command. Cannot be made to force
level 32 and above.
This little trigger teleports the actor to another place when he enters the
room. It then makes him look to see the description.
Trigger Intended Assignment: Rooms
Trigger Type: Enter , Numeric Arg: 100, Arg list: None
Commands:
wait 1 s
%echo% A powerful force drags you down.
%teleport% %actor% 3001
%force% %actor% look
#31
%LOAD% OLOAD MLOAD WLOAD
%load% [name [position]]
This command loads a mob or object into the game. No-take objects loaded to
an actor will load to the room. NO_RENT objects can not be loaded.
load an object to room: %load% obj 1300
load a mob to room : %load% mob 1300
load obj to player inv: %load% obj 1300 %actor% inv
equip obj to player : %load% obj 1300 %actor% waist
Obj Example: @RTSTAT 94@n
Mob Example: @RTSTAT 81@n
See also: POSITIONS, CHAR-VAR
#31
%PURGE% OPURGE MPURGE WPURGE
%purge%
Purge removes objects or mobs from the game. If no argument is given, then
all objects and mobs in the room will be removed. If there is an argument,
only that mob or object will be purged. Players can not be purged.
Examples:
%purge% %self%
%purge% %actor.inventory(1300)%
%purge% %actor.eq(hold)%
When purging objects make sure the object exists. If it does not the room will
be purged:
if %actor.inventory(700)%
%purge% %actor.inventory(700)%
end
Example: @RTSTAT 1375, 6300@n
See also: POSITIONS
#31
%TELEPORT% WTELEPORT OTELEPORT MTELEPORT PORTALS %TRANSPORT% TRIG-TELEPORT
Stock tbaMUD does not have an object type portal. This is instead done with
trigedit.
%teleport%
Teleport moves the victim to the target. The victim does not need to be in
the same room as the mob. If the victim is 'all', all the characters in the
room will be teleported to the target room. No messages are generated by this
command.
%teleport% all 17401
%teleport% %actor% 1300
PORTAL EXAMPLES:
OBJ: @RTSTAT 100@n
ROOM: @RTSTAT 101@n
MOB: @RTSTAT 102@n
See also: MGOTO, TELEPORT
#31
DG_CAST TRIG-CAST TRIGEDIT-CAST TRIGEDIT-SPELLS DG-CASTS %CAST% %SPELLS% %dg_cast%
dg_cast 'spellname' [target]
This allows the holder of a trigger to cast spells. Spells will work for
rooms and objects, as well as mobiles. Players and mobs will still be allowed
saving throws against these spells.
This simple example allows the mob to cast poison 10% of the time while fighting.
Trigger Intended Assignment: Mobiles
Trigger Type: Fight , Numeric Arg: 10, Arg list: None
Commands:
dg_cast 'poison' %actor%
Example: @RTSTAT 132@n
See also: SPELLS
#31
%ASOUND% OASOUND MASOUND WASOUND ASOUND
%asound%
The message is sent to all surrounding rooms.
Trigger Intended Assignment: Rooms
Trigger Type: Random , Numeric Arg: 10, Arg list: None
Commands:
%asound% You hear a blood chilling howl from nearby.
See Examples: @RTSTAT 7505, 154@n
#31
%AT% WAT MAT OAT %MAT% %WAT% %OAT%
%at%
Using %at% will perform the command in the room where target is found.
Example: @RTSTAT 19, 20@n
#31
MFORGET MREMEMBER %FORGET% %REMEMBER%
mremember [command]
The victim is placed into this mobile's memory list. The next time the
victim is seen by the mobile, the mobile will perform command if set, or
execute the memory trigger if no command was provided. When the command is
carried out or the trigger executed, the victim is forgotten.
NOTE: Any mob using the mremeber command MUST have a MEMORY trigger attached.
It doesn't matter if the Memory trigger is never called (Narg 0).
Only Mobs may use mremember.
mforget
Remove victim from this mobile's memory list.
Example: @RTSTAT 74, 75@n
#31
MGOTO %GOTO% %MTELEPORT% MTELEPORT
%goto%
This command moves the mob to the given target. The target may be an object,
room, or character, as long as it is not in a private room occupied with two
or more characters, or godroom. No message is given.
%goto% 1233
%goto% Rumble
%goto% fountain
#31
MJUNK %JUNK%
mjunk
The object in the mobs inventory specified is removed from the game.
'Mjunk all' removes all of the objects in the mobs inventory. No message
is sent by this command. Only mobs may use this command.
#31
%FOLLOWER% TRIG-FOLLOW MFOLLOW %MASTER% MASTER %SELF.FOLLOWER% %SELF.MASTER% %FOLLOW%
mfollow
The mobile will begin following the victim without the revealing "starts
following you" message. A silent follow.
mfollow %actor%
Examples: @RTSTAT 57508, 40, 39@n
See also: GROUPS
#31
MHUNT %HUNT% HUNT
mhunt
The mobile will begin to hunt for victim, and engage in combat upon finding
them. Only Mobiles may use this command. Hunting mobs will ignore STAY_ZONE and
SENTINEL flags. They will also walk through NOMOB rooms. %kill% may be used for
mobs attacking mobs.
Examples: @RTSTAT 19596, 19595@n
See also: TRIGEDIT-MOB-BRIBE
#31
MKILL WKILL OKILL %KILL%
mkill
Mkill will force the mob to attack the victim. It is the same as kill,
except mkill works for low level mobs attacking PCs, where kill might not.
Examples: @RTSTAT 23613@n
#31
%TRANSFORM% MTRANSFORMS OTRANSFORMS TRANSFORMS MORPHS MTRANSFERS TRIG-MOB-TRANSFORM
%transform%
This command causes the executing mob or object to transform into another
mob or object, based on the vnum argument supplied. The transformation is
permanent, though additional transformations may be performed. No message
regarding the transformation is sent to the room. The new mob or object will
have the same trigger as the original, rather than any trigger normally assigned
to the new, and no load trigger will be executed.
Mobs - The hit points, max hit points, position, gold, and experience value
will remain those of the original mob but all other statistics and descriptions
will be those of the new mob. (The new mob can be made to have all of its normal
statistics by using a negative vnum.) Only mobiles may use this command (naturally).
Objects - Based on the vnum argument supplied. The four basic values will
remain those of the original mob but all other statistics and descriptions will
be those of the new object. The transformation is permanent, additional
transformations may be performed. No message regarding the transformation is
sent to the room. The new object will have the same trigger as the originating
object, rather than any trigger normally assigned to the new object, and no
load trigger will be executed.
Example: @RTSTAT 21, 1370@n
#31
OTIMER %TIMER% %OTIMER%
otimer
Set the countdown timer of this object to value. Useful for objects with
timer triggers. Timers are reset on copyover and reboot.
Example: @RTSTAT 82, 11894@n
See also: TIMER, TRIGEDIT-OBJ-TIMER
#31
OSETVAL %SETVAL% VAL0 VAL1 VAL2 VAL3 %VAL0% %VAL1% %VAL2% %VAL3%
osetval
Osetval lets you alter the object values of an object. The meaning of the
values depends on the object type (@RHELP OEDIT-VALUES@n). "osetval 3 50" will
set the objects 3rd value to 50.
Example: @RTSTAT 42@n
#31
COMMENT *
* This is an example of a comment in trigedit. Because of the *'s the lines
* are not parsed, so the trigger still works even if it has a lot of
* explanations built in. All triggers should be heavily commented.
* The below line sends the text 'Trigger firing' to the room.
%echo% Trigger firing
Comments are useful in triggers to document what is happening, for future
reference, and for others to see what the trigger does. If you want a * in your
trigger text try /*.
See also: REDIT-ROOM-FLAGS
#31
NOP NO-OPERATION NON-OPERATION TRIG-EXPERIENCE %ACTOR.EXP% ACTOR.EXP TRIG-GOLD ACTOR.GOLD %ACTOR.GOLD% %NOP% %POSITION% %POS% %ACTOR.POS% ACTOR.POS TRIGEDIT-NOP
Almost a no-operation. Certain variable/subfield combinations for characters
change some attribute about the character. nop allows those changes to be used
legally on lines that do not need to process the result.
* this returns the amount of gold on the actor
%echo% %actor.name% has %actor.gold% gold coins.
* this will award the actor with 10 gold
nop %actor.gold(10)%
* this takes away 10 experience
nop %actor.exp(-10)%
* or you can use a defined variable
set number %random.40%
nop %actor.exp(%number%)%
* Experience can be modified up to 1000 Xp.
Can also be used to turn flags on or off:
nop %actor.is_killer(on)%
nop %actor.is_thief(off)%
Player positions including sleeping, resting, sitting, fighting, and standing
can be set by:
nop %self.pos(sleeping)%
nop %actor.pos(sitting)%
Examples: @RTSTAT 1399, 20997@n
See also: MEDIT-POSITIONS
#31
GLOBALS GLOBAL-VARIABLES GLOBAL-VARS GVARS TRIGEDIT-GLOBALS
Usage: global
Global variables allow a room/mob/obj trigger variable to be used by another
trigger on the same room/mob/obj. i.e. a bribe trigger could global that the mob
has_been_bribed then when a player tries to leave the mobs leave trigger would
check the global variable to allow or prevent passage accordingly.
* To make a variable 'reachable' from other triggers it has to be made 'global'.
* In this case I make a local known var %has_bribed_guard% and make it global.
* It is a good idea to use this in conjunction with context.
set has_bribed_guard 1
global has_bribed_guard
Globals can be checked by varexists: if %actor.varexists()%
Global variables should not be used when you want to remember something about a
player. To save something to a players file for future use always use REMOTE.
Examples: @RTSTAT 23612, 23613, 23614@n
See also: REMOTE, VARIABLES, CONTEXT
#31
CONTEXT %CONTEXT%
Usage: context
* This little trigger will make sure one %has_said_hello% exist for each player.
context %actor.id%
set has_said_hello 1
global has_said_hello
* now only triggers running with context = %actor.id% can access this particular
* variable. however - it is a better idea to use vars set on players: help remote.
Changes the "context" of a trigger to this value. When first run, a trigger's
context is 0. When a variable is made global, it is given the current context.
When a variable is accessed, if it must be searched for globally, a "found"
variable must either have context 0 or the current context. The net result of
this is you may have many global variables in a single trigger, with the same
name, differing only by context. Players may have variables; this mostly
removes the need for variable context. Previously, a player's ID could be used
as variable context to allow a trigger to service multiple players at once.
Example: @RTSTAT 23612@n
See also: REMOTE
#31
EVALUATE TRIG-EVALS EVALS
Usage: eval
* this example immediately evaluates the expression below and stores the result
* in %result%
eval result %self.hitp% * 100 / %self.maxhitp%
say My hitpoint percentage is %result%
* this result will not change after the evaluation even if %self.hitp% changes.
The eval command is used to set (or create) the specified variable equal to
the result of the immediate evaluation of the provided expression. There also
exists a "set" command, with the same syntax. Set differs in that the expression
is not evaluated until the variable is accessed.
Example: @RTSTAT 49@n
See also: TRIG-SET
#31
TRIG-SET %SET% MSET
Usage: set
Set creates a variable without evaluating it. For example:
set foobar 15 - 5
Sets the variable foobar to the string "15 - 5"
* this example sets the value of result to '%self.hitp% * 100 / %self.maxhitp%'
set result %self.hitp% * 100 / %self.maxhitp%
* The %result% var now works as a 'function' every time it is accessed.
say My hitpoint percentage is %result%
%damage% %self% 30
say My hitpoint percentage is %result%
The set command is used to set (or create) the specified variable equal to
the provided expression, which will be evaluated when the variable is accessed.
There also exists an "eval" command, with the same syntax. Eval differs in that
the expression is evaluated immediately.
Example: @RTSTAT 49, 41005@n
See also: EVAL, OSETVAL
#31
UNSET
Usage: unset variable
* in this example we have a var %testvar% we no longer need:
set testvar hops happily along
%echo% %self.name% %testvar%
unset testvar
* please note - if we had made the var global, it'd be gone instead.
Remove the variable from the global variables of this trigger, or if not
found there, from the trigger.
See also: SET, EVAL
#31
EXTRACT
Usage: extract to-variable word-number from-text
* could be used to do strange things to what people say:
extract testvar1 1 %speech%
extract testvar2 2 %speech%
extract testvar3 3 %speech%
extract testvar4 4 %speech%
say do you mean %testvar4% %testvar3% %testvar2% %testvar1% ?
Place a specific word from the 'from-text' into a new or existing variable
'to-variable'. Do not enclose the name of the to-variable in %'s.
#31
IFS ELSEIF END TRIGEDIT-END TRIGEDIT-IF TRIG-END TRIG-IF ENDIF TRIG-ELSE ELSE-IF IF-ELSE NESTING
Usage: if (expression)
...
elseif (expression)
...
else
...
end
if %actor.is_pc%
%echo% You are a player
else
%echo% You are a mob.
end
An 'if' must occur before the other three. If expression evaluates to true
(@RHELP EXPRESSIONS@n), the statements between the if statement and the next
elseif, else, or end are executed. If it stopped at an elseif or else, it scans
for the next end, and continues execution at that point. If the expression
evaluated to false, it searches for the next elseif, else, or end. If it finds
an elseif, it checks that expression. If it is true, it executes the statements
between the elseif and the next elseif, else, or end, and then finds the end of
the block. If it is false, it continues searching in the same pattern, until a
true elseif is found, an else is found, or an end is found. There may be 0 or
1 else statements and 0 or many elseif statements in the block.
For anyone having trouble with the format of if/elseif/else/end blocks
@RTSTAT 22@n. Relsqui made this excellent example.
***EVERY IF NEEDS AN END: 2 IF'S NEEDS 2 ENDS....***
See also: EXPRESSIONS, NESTED-IFS
#31
NESTED-IFS
A nested if is an if statement contained within another if or if...else
statement. Nested if's allow the creation of a decision tree or flow chart
of events with multiple conclusions.
Always use /f to format and indent your trigger. This will warn you if you
do not have the correct number of ifs to ends. @RWARNING:@n multiple unmatched
if/ends will crash us. Make sure everything lines up with /f before you test.
Example: @RTSTAT 1490, 41000@n
#31
HALT TRIGEDIT-HALT TRIG-HALT %ACTOR.LEVEL% %HALT%
Usage: halt
Halt terminates the trigger execution.
* This trigger attacks players of level 20 and above. The reason for the use of
* halt and return 0 is to make sure other triggers are checked too.
if %actor.level% < 20
return 0
halt
end
%echo% %self.name% yells a Battlecry and throws himself at you.
mkill %actor%
#31
VAREXISTS %VAREXISTS% %EXISTS% EXISTS
Usage: if %actor.varexists(on_quest_zone_1)%
The above usage checks if the variable on_quest_zone_1 has been saved to the
player file or to a mob (does not work for objects). It can also be used with
!%actor.varexists(on_quest_zone_1)% to mean does not exist. This is useful on
quests or other complex triggers that need to save variables to a player file
by using remote.
Example: @RTSTAT 138, 139@n
See Also: REMOTE
#30
MAKEUID UID UNIQUE
Usage: makeuid variable id
* We have one mob giving a quest. This mob sets the targets id as a global on
* the player via the 'remote' command, like this:
eval quest_object %obj.id%
remote quest_object %actor.id%
* We then have another mob receiving the quest object, with the following trigger.
if !(%actor.varexists(quest_object)%)
return 0
halt
end
* now we know the player has a quest_object variable
makeuid obj %actor.quest_object%
say Have you brought me %obj.shortdesc%, %actor.name% ?
say You must bring it to me to complete your quest, you know.
Creates a new variable with the name given, whose contents shall be suitable
for referring to a character, object, or room whose id is provided.
#31
RDELETE
Usage: rdelete variable id
* This is used to remove a variable
say Thank you, %actor.name% - your quest is completed.
rdelete quest_object %actor.id%
Delete a remote variable from the trigger referred to by the id of its owner.
See also: VDELETE, REMOTE
#31
REMOTES VSET RSET
Usage: remote
Remoting a variable saves that variable to the player file for future access.
This is used heavily for quests to limit a player to only performing it once.
Here is a quick example from zone 14. The variable must first be set and then
saved to the players file via remote, like:
* setting the variable to 1 means completed.
set solved_example_quest_zone_0 1
remote solved_example_quest_zone_0 %actor.id%
Then in future triggers it is checked if that variable already exists in the
player file. In this example, if it does the player is not allowed to continue.
should always be a unique name. I suggest always including zone #.
can be any value or text you wish to use later.
Create a global variable belonging to a character or player whose id is
specified. The variable must first exist in the trigger that is running.
For more examples @RGOTO 13@n to access the trigedit hallway.
Examples: @RTSTAT 199, 190-192, 23612-23614@n
See also: RDELETE, VDELETE, TRIG-SET, CONTEXT
#31
TRIG-RETURN RETURN-0 CONTINUE %RETURN% RETURN-1
Usage: return 0
Return 0 in a trigger will allow the certain triggers added flexibility. This
is dependent on the trigger type and is explained in each trigger help file under
@RHELP TRIG-TYPE@n. The only way to make two triggers of the same type to both
fire is to have the first one return 0. Other Examples:
Get, Give, Drop, Wear, Leave, and Consume trigs with return 0 prevents the action.
Command trigs with return 0 allow the command to continue to the MUD and not be
stopped by the trigger.
Return does not end the triggers execution. It is returned after all commands have
been executed, or a wait or halt command is called.
Return 1 is rarely used since it just means normal termination of the trigger.
Example: @RTSTAT 1364@n
See also: TRIG-TYPE, HALT, WAIT
#31
TRIG-SWITCH TRIGEDIT-SWITCH CASE DEFAULT BREAK %SWITCH%
Usage: switch expression
switch %random.4%
case 1
emote sings a merry song about someone named Fulbert and Beatrice.
break
case 2
emote booms out loudly, 'Heigh Ho! Heigh Ho! It is home from work we go!'
break
case 3
emote tries to sing falsetto, but his voice doesn't agree.
break
default
sing
break
done
Switch evaluates an expression and looks for a match amongst the case
statements that follow. If none of the following case statements are a match,
and a default statement exists, the default statement is considered a match.
If a match is found, the commands that follow it, up until a break or done
command, are executed.
Break is used to terminate commands in a switch.
Case is used to begin a new conditional group in a switch block.
Default is similar to case but matches any condition not met.
Done is used to terminate a while or switch block.
Example: @RTSTAT 18, 6@n
#31
WHILE DONE %NEXT% NEXT LOOP TRIG-LOOPS TRIG-WHILE TRIG-DONE FOR-LOOP
Usage: while expression
The while command starts a loop, running until the expression becomes zero
or negative. This can make permanent loops - be careful. The switch block must
be terminated by a done. While loops are disabled after looping 100 times.
Room example: @RTSTAT 24, 2201@n
Obj example: @RTSTAT 23@n
Mob example: @RTSTAT 11858@n
#31
WAIT PAUSE TRIGEDIT-TIMING TIMING TRIG-WAIT TRIGEDIT-WAIT
Usage: wait [s]
wait until
* This trigger gives the actor 10 seconds to get out.
say GET OUT! NOW!
wait 10 s
mkill %actor%
The wait statement is used to 'pause' the trigger execution for a period of
time. When a trigger is being executed it will attempt to execute all commands
right away. To get small breaks in, and perhaps give the players time to adjust,
use the wait command.
See also: RANDOM-TIMING, WAIT-UNTIL
#31
WAITUNTIL WAIT-UNTIL
* If you want to synchronize your trigger, you can use the 'wait until' feature.
* This trigger wakes the mob at dawn, and puts him to sleep at night.
wait until 8:00
wake
* wait # without seconds following it will wait 10 ticks, which is very quick.
wait 10
yawn
wait 10
stand
* This one uses wait 10 seconds. Recommend you always use seconds
wait 10 sec
emote looks sleepy.
wait until 21:00
yawn
wait 10 s
rest
wait 10 s
sleep
See also: WAIT, RANDOM-TIMING
#31
TRIGEDIT-VARIABLES VARIABLES TRIG-VARS TRIG-VARIABLES TRIGGER-VARIABLES VARS %VARIABLES% %VARIABLE% %% %TRIGGER% %TRIGGERS% %COMMAND% %WORD% VARIABLES-REFERENCE REFERENCES %VAR% DG-VARIABLES TRIGEDIT-VARS %VARIABLE%
Variables appear as a name surrounded by '%'s, such as %actor%
Before a command is processed, the line is scanned and any variables are
replaced. First the list of local variables are checked to see if the variable
is there. If not, the global variables are checked. A proper global match must
have a zero context or the current context of the trigger. (When a trigger starts
running, its context is 0. The trigger context command may be used to change
context.) If a match is still not found, a list of 'built in' variables (ones
not declared by the trigger) are checked. If no match is found, the variable is
replaced with an empty string (the variable is removed from the line, and
nothing added in its place).
There are two types of variables, local and global. All local variables are
deleted when a trigger finishes executing, and can only be used by the trigger.
Global variables remain until removed with unset, the MUD is rebooted, or the
trigger is removed.
Global variables also have a context associated with them. By default, the
context is 0. Any global being referenced with a context of zero will be seen.
Through the 'context ' command, a trigger may set its context to any
integer; Globals created are always assigned the current trigger context. When a
global is referenced, if its context is not 0 or the current context of the
trigger, it will not be seen. This technique allows, among other things, arrays
of globals to be created by using a series of contexts as indexes. Also, it
allows globals to be associated with a specific character, room, or object in
the game, by using the id of the target as the context.
Variable Fields
A field of a variable can also be retrieved, based on their type. To get a
field, a notation of %variable.field% is used. The valid fields are listed in
the help files below.
@RCHAR-VAR@n - Variables for characters. @RTSTAT 27@n
@ROBJ-VAR@n - Variables for objects. @RTSTAT 28@n
@RROOM-VAR@n - Variables for rooms. @RTSTAT 29@n
@RTEXT-VAR@n - Variables for text. @RTSTAT 30@n
@RSPEC-VAR@n - Variables for special stuff. @RTSTAT 31@n
See also: GLOBAL
#31
MUDCOMMAND CMD.MUDCOMMAND %CMD.MUDCOMMAND% %MUDCOMMAND% CMD.MUDCOMMAND
Used to match text to existing commands in the MUD. This will also match
any abbreviations.
* check for command sit with arg chair. Also matching any abbreviations.
if %cmd.mudcommand% == sit && chair /= %arg% && %arg%
Examples: @RTSTAT 81, 52, 62
#31
MUDCOMMAND %MUDCOMMAND%
See @RHELP TEXT-VAR@n
#31
TRIGEDIT-VARIABLES-TEXTS TEXT-VAR %ARG% CDR CAR ARG.CDR %ARG.CDR% %CMD.CDR% CMD.CDR ARG.CAR CMD.CAR CAR %ARG.CAR% %CMD.CAR% %TEXT% PUSH CMD %CMD% %CDR% %CAR% %TRIM% TRIGEDIT-TEXT-VAR %STRLEN% CDR STRLEN STRING-LENGTH STRINGLENGTH CONTAINS %CONTAINS%
Text Variable Fields
These fields pertain to any variable that contains a string of text. These
are often the variables, such as %speech%, which are provided to a trigger, but
can also be variables that have been created by the trigger, such as
%room.north%
When using field - The variable returns
strlen - Returns the number of characters in the string.
trim - Returns the string without any leading or trailing whitespace.
This is used to trim extra spaces from the beginning or end of a
string.
car - Returns the first word of the string. For %text%="this is the
string"; %text.car% will yield "this". @RTSTAT 53@n
cdr - Returns all but the first word of the string, trimmed. For %text%=
"this is the string"; %text.cdr% will yield "is the string".
contains() - Used to check if a string contains the subfield text.
mudcommand - Returns the mud command the string is shorthand for. Used to make
sure the command you react to is the one you want: For %text%="o"
%text.mudcommand% will yield "open". @RHELP MUDCOMMAND@n
charat - set new variable %text/var.charat(index)% i.e. set phrase testing,
set var1 %phrase.charat(2)% now %var1% == e
Example: @RTSTAT 30@n
#31
TRIGEDIT-VARIABLES-SPECIALS SPEC-VAR %SELF% RANDOM %RANDOM% %TIME% %PEOPLE% TRIGEDIT-SPEC-VAR %RANDOM.CHAR% %SPEECH% DG_LETTER DG-LETTERS TRIGEDIT-LETTERS %HOUR% SPEECH-VAR CHARAT
Special Variables When using field - The variable returns:
- @RHELP GLOBAL@n
asound - @RHELP %ASOUND@n
at - @RHELP %AT@n
damage - @RHELP %DAMAGE%@n
door - @RHELP %DOOR%@n
echo - @RHELP %ECHO%@n
echoaround - @RHELP %ECHOAROUND%@n
findobj.#() - Counts the number of objects in a room. @RHELP %FINDOBJ@N
findmob.#() - Counts the number of mobs in a room. @RHELP %FINDmOB@N
force - @RHELP %FORCE%@n
load - @RHELP %LOAD%@n
people. - This variable returns the number of people in the room
specified via vnum.
purge - @RHELP %PURGE%@n
random.<#> - This returns a number between 1 and the field value.
%random.10% would return a number between 1 and 10.
random.char - This returns a random character in the room.
self - The mob, item, or room running the trigger. Normal fields may be
used with this.
send - @RHELP %SEND%@n
speech - This variable is set to the complete phrase spoken by an actor
that triggers a speech trigger.
teleport - @RHELP %TELEPORT%@n
time. - Field may be hour, day, month, or year. The returned value will
be the current hour in the mud (0-23), day of the month (1-35),
month (1-17), or year respectively. @RTSTAT 36@n
zoneecho - @RHELP %ZONEECHO%@n
transform - @RHELP %TRANSFORM%@n
|%var% - name's, someone's, your
~%var% - name, someone, you
&%var% - it, you, he/she Example: @RTSTAT 91@n
*%var% - it, you, him/her
^%var% - its, your, his/her
Use \ for do not parse, or %% for %.
Example: @RTSTAT 31@n
See also: TRIGEDIT-RANDOM
#31
%ROOM.CONTENTS% ROOM.CONTENTS
See @RHELP ROOM-VAR@n
#31
TRIGEDIT-VARIABLES-ROOMS ROOM-VARIABLES %WEATHER% %ID% %NAME% %DIRECTION% %ACTOR.ROOM% TRIGEDIT-ROOM-VAR %VNUM% CONTENTS %CONTENTS% %ROOMS% ROOM-VARS PEOPLE %PEOPLE% %ROOM% %ROOM.DIR% ROOM.ID ROOM.PEOPLE %ROOM.PEOPLE% ROOM.VNUM RANDOM.DIR %RANDOM.DIR%
Rooms When using field - The variable returns:
contents - The id of the first obj in the room.
- The list of flags affecting the exit in the specified direction:
north Usage: %()% Possible subfields include:
south subfield, (vnum) - vnum of room in direction.
east subfield, (key) - vnum of key to use. %self.north(key)%
west subfield, (bits) - CLOSED LOCKED, etc.
up subfield, (room) - room variable for room in direction
down no subfield: same as (bits).
id - The unique id of the room.
name - The name of the room.
people - The id of the first mob or player in the room, or an empty return.
random.dir - Chooses a random valid direction.
sector - The sector type of the room.
vnum() - The room's vnum. Equality can now be checked with if %self.vnum(#)%
not if %self.vnum% == #
weather - current weather: sunny, cloudy, rainy, or lightning @RTSTAT 41098@n.
Example: @RTSTAT 29@n
See also: RANDOM-THOUGHTS
#31
TRIGEDIT-VARIABLES-OBJECTS OBJ-VAR %SHORTDESC% TRIGEDIT-OBJ-VAR VAL0 VAL1 VAL2 VAL3 %ITEM% %OBJECT% OBJVARS OBJ-VARS %NEXT_IN_LIST% %OBJ% OBJ-COMMAND IS_INROOM WORN_BY NEXT_IN_LIST CARRIED_BY OBJECT-VARIABLES
Objects When using field - The variable returns:
carried_by - The id of the character carrying the object, or an empty return.
contents - Gives the first object in a container. @RTSTAT 32@n
cost() - The cost (not rent cost) of the object. Subfield sets.
cost_per_day - The rent cost of the object
count - The number of the same object.
has_in - True if the container holds the item.
id - The unique id of the object.
is_inroom - Returns true if object is in room.
name - The list of key words of the object.
next_in_list - The id of the next object in the characters inventory, or an
empty return
room - Returns the room id the object is in.
shortdesc - The name of the object that players see.
timer - The timer of the object.
type - The type of object, such as WAND, ARMOR, or KEY.
val0 - Returns the current value 0 of the object, defined here.
val1 - Returns the current value 1 of the object, defined here.
val2 - Returns the current value 2 of the object, defined here.
val3 - Returns the current value 3 of the object, defined here.
vnum() - The object's vnum. Equality can now be checked with
if %self.vnum(#)% not if %self.vnum% == #
wearflag() - Checks if the object has a wearflag. @RHELP EQ, TSTAT 3011@n.
weight() - The weight of the object. Subfield sets.
worn_by - The id of the character wearing the object, or an empty return
Example: @RTSTAT 28@n
#31
ACTOR.INVENTORY %ACTOR.INVENTORY% %INVENTORY% TRIG-INVENTORY TRIGEDIT-INVENTORY
%actor.inventory()%
Returns the id of the first item in the actors inventory or the id of the first
object with vnum in the subfield. If the actor doesn't have the item an empty
string is returned. * checks for any inventory.
Examples: @RTSTAT 94, 19537@n.
See also: TRIG-EQ, %PURGE%, %LOAD%, CHAR-VAR
#31
TRIG-EQUIPMENT ACTOR.EQUIPMENT %ACTOR.EQ% %EQ% TRIG_EQUIPMENT
%actor.eq()%
Returns the identifier for the object equipped in the subfield position, if
if any. The specified position may be either a position number (0-18) or the
name of the location. @RHELP POSITIONS. * checks all positions.
Examples: @RTSTAT 94, 9116@n
See also: TRIG-INV, %PURGE%, %LOAD%, POSITIONS, CHAR-VAR
#31
%NEXT_IN_ROOM% CHAR_VAR TRIG-FIELDS %ACTOR.SEX% ACTOR.SEX %ACTOR.HITPOINTS% %ACTOR.HP% %ACTOR.HITP% %HIS% IS_FIGHTING %FIGHTING% ACTOR.FIGHTING %ACTOR.FIGHTING% IN_ROOM IS_ROOM POS() HISHER %MASTER% %SELF.MASTER% %FOLLOWER.NAME% PVAR %HISHER% %SEX%
See @RHELP CHAR-VAR@n
#31
PLAYER-VARIABLES TRIGEDIT-MOB-VAR %ACTOR.HISHER% %SELF.NAME% %LEVEL% %PLAYER% %MOB% %ROOM% %CHAR%
See @RHELP CHAR-VAR@n
#31
CHAR-VARS TRIGEDIT-VARIABLES-CHARACTERS %TITLE% %ACTOR.TITLE% CHAR-VARIABLES TRIGEDIT-CHAR-VAR %ACTOR.ID% ACTOR.ID ACTOR.VNUM %ACTOR.VNUM% %ACTOR.NAME% %ACTOR% %VICTIM% SELF %SELF% MOBVARS MOB-VARS TRIGEDIT-LEVEL %SELF.ID% SELF.ID NEXT_IN_ROOM ACTOR-VAR
The following fields can be used with %actor%. i.e. %actor.%
Excluding the subfield () returns the value. Adding a subfield modifies it.
@uField@n - @uvariable returns:@n
cha/con/dex/int - Checks the stat. Subfield sets.
str/stradd/wis @RHELP TRIG-STAT@n
alias - The list of aliases of the mob or the player name.
align - The numeric alignment of the actor. @RHELP ALIGN@n
affect() - Checks the actor for the affect. @RHELP TRIG-AFFECT@n
canbeseen - Checks if the the mob can see the actor. @RHELP CANBESEEN@n
class - The actor's class, as a string.
exp() - Checks the actor's XP. Subfield modifies. @RHELP NOP@n
eq() - Returns ID of the first object equipped. @RHELP TRIG-EQ@n
fighting - The unique id of the mob fighting the actor.
follower(name) - The follower of the actor (as an id) with name supplied.
gold() - Checks the actor's gold. Subfield modifies. @RHELP NOP@n
has_item() - Checks if the actor has an object. @RHELP HAS_ITEM@n
heshe - Returns the correct pronoun (he/she/it).
himher - Returns the correct pronoun (him/her/it).
hisher - Returns the correct pronoun (his/her/its).
hitp() - The current hit points of the actor. Subfield sets.
id - The unique id of the actor.
inventory() - Returns the id of the first item in inv. @RHELP TRIG-INV@n
is_killer() - Checks if actor is a KILLER. To modify @RHELP NOP@n
is_pc - Checks if the actor is a player. @RHELP IS_PC@n
is_thief() - Checks if actor is a THIEF. @RHELP NOP@n
level - The actor's current level.
mana() - The current mana points of the actor. Subfield sets.
master - The master of the actor (as an id), or an empty return.
maxhitp() - The maximum hit points of the actor. Subfield sets.
maxmana() - The maximum mana points of the actor. Subfield sets.
maxmove() - The maximum movement points of the actor. Subfield sets.
move() - The movement points of the actor. Subfield sets.
name - The actor's name (the short description for mobs).
next_in_room - The next mob/player in the room as a variable (id) nice to
use for loops, or an empty return @RTSTAT 23@n
pos() - %actor.pos% returns position. Subfield modifies. Sleeping,
resting, sitting, fighting, standing. @RTSTAT 1399, 20997@n
prac() - The actor's number of practices. Subfield modifies.
questpoints() - Checks the actor's questpoints. Subfield modifies. @RHELP NOP@n
race - The actor's race, as a string. (not used in tbaMUD)
ridden_by - Not fully implemented.
riding - Not fully implemented.
room - The room the actor is in as a room variable.
saving_para - Set the actors saving throw for paralization.
saving_rod - Set the actors saving throw for staffs/wands.
saving_petri - Set the actors saving throw for petrification.
saving_breath - Set the actors saving throw for breath weapons.
saving_spell - Set the actors saving throw for spells.
sex - The actor's sex, as a string: MALE, FEMALE, or NEUTRAL.
skill() - The percentage of learnedness in the skill subfield.
skillset("" #) - Set the actors practiced level any skill or spell (1-100).
%actor.skillset("magic missile" 95)%.
title() - The actor's title. Subfield sets. Not used for mobs.
varexists() - Returns 1 if global variable in subfield exists, 0 if not.
Used with remote vars on players. @RHELP VAREXIST@n
vnum() - The actor's vnum. Equality can now be checked with
if %self.vnum(#)% not if %self.vnum% == #
weight - The actor's weight.
Example: @RTSTAT 27@n
See also: VARIABLES, GLOBALS
#31
EXPRESSIONS TRIG-EXPRESSIONS TRIGEDIT-EXPRESSIONS INCREMENTS MATHEMATICAL NUMBERS TRIGEDIT-NUMBERS != <> LOGIC && /= || \ RNUMBERS + OPERATORS OPERATIONS == EQUAL ADDITION SUBTRACTION
A false expression is any expression that evaluates to 0, or an empty string.
A true expression is any expression that evaluates to anything other than a
false expression. The following list are the recognized operators. They are
listed in order of priority higher. Expressions are evaluated from left to
right. Parenthesis can be used to create priority.
|Expr| Name | Common Examples
-------------------------------------------------------------------------------
| || | logical or | if %actor.level% == 34 || %actor.name% == Rumble
| | | (if actor level equals 34 or name equals Rumble)
| && | logical and | if %actor.is_pc% && %actor.sex% == male
| | | (if actor is a player and is male)
| == | equal to | if %actor.hitp% == 1
| | | (if actor hitpoints is equal to 1)
| != | not equal to | if %actor.age% != 1
| | | (if actor age is not equal to 1)
| < | less than | if %actor.dex% < 16
| | | (if actor dexterity is less than 16)
| > | greater than | if %actor.align% > 349
| | | (if actor alignment is greater than 349)
| <= | less than or equal | if %actor.exp% <= 2
| | | (if actor experience is less than or equal to 1)
| >= | greater than or equal | if %actor.mana% >= 1
| | | (if actor mana is greater than or equal to 1)
| /= | contains substring | if wardrobe /= %arg% (will match arg wardrob,
| | | wardro, wardr, ward, etc. @RHELP MUDCOMMAND@n)
| - | subtraction | 15 - 10 = 5
| + | addition | 10 + 15 = 25
| * | multiplication | 10 * 20 = 200
| / | division | 100 / 20 = 5
| ! | negation | if !%actor.is_killer% (if actor is not a killer)
-------------------------------------------------------------------------------
NOTE: += and ++ are not used.
Example: @RTSTAT 63@n
#31
ROOM-TRIGGERS TRIGEDIT-ROOM-TYPES
1) Global @RHELP TRIGEDIT-ROOM-GLOBAL@n
2) Random @RHELP TRIGEDIT-ROOM-RANDOM@n
3) Command @RHELP TRIGEDIT-ROOM-COMMAND@n
4) Speech @RHELP TRIGEDIT-ROOM-SPEECH@n
6) Zone Reset @RHELP TRIGEDIT-ROOM-ZONE@n
7) Enter @RHELP TRIGEDIT-ROOM-ENTER@n
8) Drop @RHELP TRIGEDIT-ROOM-DROP@n
16) Cast @RHELP TRIGEDIT-ROOM-CAST@n
17) Leave @RHELP TRIGEDIT-ROOM-LEAVE@n
18) Door @RHELP TRIGEDIT-ROOM-DOOR@n
#31
OBJ-TRIGGERS OBJECT-TRIGGERS TRIGEDIT-OBJ-TYPES
1) Global @RHELP TRIGEDIT-OBJ-GLOBAL@n
2) Random @RHELP TRIGEDIT-OBJ-RANDOM@n
3) Command @RHELP TRIGEDIT-OBJ-COMMAND@n
6) Timer @RHELP TRIGEDIT-OBJ-TIMER@n
7) Get @RHELP TRIGEDIT-OBJ-GET@n
8) Drop @RHELP TRIGEDIT-OBJ-DROP@n
9) Give @RHELP TRIGEDIT-OBJ-GIVE@n
10) Wear @RHELP TRIGEDIT-OBJ-WEAR@n
12) Remove @RHELP TRIGEDIT-OBJ-REMOVE@n
14) Load @RHELP TRIGEDIT-OBJ-LOAD@n
17) Leave @RHELP TRIGEDIT-OBJ-LEAVE@n
#31
MOB-TRIGGERS MOBILE-TRIGGERS TRIGEDIT-MOB-TYPES
1) Global @RHELP TRIGEDIT-MOB-GLOBAL@n
2) Random @RHELP TRIGEDIT-MOB-RANDOM@n
3) Command @RHELP TRIGEDIT-MOB-COMMAND@n
4) Speech @RHELP TRIGEDIT-MOB-SPEECH@n
5) Act @RHELP TRIGEDIT-MOB-ACT@n
6) Death @RHELP TRIGEDIT-MOB-DEATH@n
7) Greet @RHELP TRIGEDIT-MOB-GREET@n
8) Greet-All @RHELP TRIGEDIT-MOB-GREET-ALL@n
9) Entry @RHELP TRIGEDIT-MOB-ENTRY@n
10) Receive @RHELP TRIGEDIT-MOB-RECEIVE@n
11) Fight @RHELP TRIGEDIT-MOB-FIGHT@n
12) HitPrcnt @RHELP TRIGEDIT-MOB-HITPRCNT@n
13) Bribe @RHELP TRIGEDIT-MOB-BRIBE@n
14) Load @RHELP TRIGEDIT-MOB-LOAD@n
15) Memory @RHELP TRIGEDIT-MOB-MEMORY@n
16) Cast @RHELP TRIGEDIT-MOB-CAST@n
17) Leave @RHELP TRIGEDIT-MOB-LEAVE@n
18) Door @RHELP TRIGEDIT-MOB-DOOR@n
#31
TRIGEDIT-OBJ-GET TRIG-OBJ-GET
Activated any time a character attempts to pick up this object.
Does not work with waits.
Numeric Arg : percentage chance this trigger will activate.
Argument : not used.
If used with a return 0 the character will fail to pick the object up.
Variables:
%actor% - the character trying to get the object.
%self% - the object being picked up.
Example: @RTSTAT 83@n
#31
TRIGEDIT-OBJ-DROP DROP-TRIGGER TRIG-OBJ-DROP TRIGEDIT-OBJ-PUT TRIG-OBJ-PUT
Activated any time a character attempts to drop this object. This includes
junking, donating, putting the object into a container, and dying.
If used with a return 0 the character will fail to drop the object.
Numeric Arg : percent chance this trigger will be activated.
Argument : not used.
Variables:
%actor% - the character attempting to drop the object.
%self% - the object being dropped.
Example: @RTSTAT 84, 1366@n
#31
TRIGEDIT-OBJ-GIVE TRIGEDIT-OBJ-RECEIVE TRIG-OBJ-GIVE TRIG-OBJ-RECEIVE %PUT%
Activated when a player attempts to give this object away or put it
inside a container.
If used with a return 0 the character will fail to give the object.
Numeric Arg : percent chance this trigger will be activated.
Argument : not used.
Variables:
%actor% - the character giving away the object.
%victim% - the potential recipient of the object.
%self% - the object being given.
Example: @RTSTAT 85, 1366@n
#31
TRIGEDIT-OBJ-WEAR TRIG-OBJ-WEAR TRIGEDIT-OBJECT-WEAR TRIG-OBJECT-WEAR
Activated each time a character attempts to wear the object.
Numeric Arg : not used.
Argument : not used.
Variables:
%actor% - the character attempting to wear the object.
%self% - the object the character is attempting to wear.
Example: @RTSTAT 86@n
#31
TRIGEDIT-OBJ-REMOVE TRIG-OBJ-REMOVE
Activated each time a character tries to remove the object.
Numeric Arg : not used.
Argument : not used.
With a return 0 the object is not removed.
Variables:
%actor% - the character attempting to remove the object.
%self% - the object the character is attempting to remove.
Example: @RTSTAT 87@n
#31
TRIGEDIT-OBJ-LOAD TRIGEDIT-OBJECT-LOAD TRIG-OBJ-LOAD TRIGEDIT-TYPE-LOAD
Activated when the object is created. Can be used with the global trigger.
Numeric Arg : percent chance this trigger will be activated.
Argument : not used.
Variables:
%self% - the object being created.
Example: @RTSTAT 88@n
#31
TRIGEDIT-OBJ-CAST
Activated when the obj is targeted by a spell.
Numeric Arg : percent chance this trigger will be activated.
Argument : not used.
Used with return 0 will cause the spell not to be cast.
Variables:
%actor% - the caster of the spell.
%spell% - the number of the spell.
%spellname% - the name of the spell.
%self% - the object.
Example: @RTSTAT 90@n
#31
TRIGEDIT-OBJ-LEAVE
Activated when someone leaves the room the obj is in.
Numeric Arg : percent chance this trigger will be activated.
Argument : not used.
Used with return 0 will prevent the player from leaving the room.
Variables:
%actor% - the character leaving the room.
%direction% - the direction the character is leaving to.
%self% - the object.
Example: @RTSTAT 89, 27108@n
#31
TRIGEDIT-OBJ-CONSUME CONSUME TRIG-OBJ-CONSUME TRIGEDIT-CONSUME
Activated any time a character attempts to consume (eat, drink, or quaff) this
object. If used with a return 0 the character will fail to consume the object.
Numeric Arg : percent chance this trigger will be activated.
Argument : not used.
Variables:
%actor% - the character attempting to consume the object.
%self% - the object being consumed.
%command% - either eat, drink, or consume.
Example: @RTSTAT 1374@n
#31
TRIGEDIT-ROOM-GLOBAL TRIG-ROOM-GLOBAL GLOBAL-RANDOM
Not a trigger type by itself; used in conjunction with Random @RHELP
TRIGEDIT-ROOM-RANDOM@n and @RHELP TRIGEDIT-ROOM-TIME@n. While Random
and Time only trigger if players are in the same room, Global Random
and Global Time will trigger regardless.
Numeric Arg : not used.
Argument : not used.
Variables:
%self% - the room.
Example: @RTSTAT 50@n
#31
TRIGEDIT-ROOM-RANDOM TRIGEDIT-ROOM-WEATHER TRIG-ROOM-RANDOM
No specific event needs to occur for this trigger to be activated. Every 13
seconds this trigger has a chance to run. This trigger is good to add weather,
noise, and other ambience into your zone.
Numeric Arg : 0-100: percentage chance this trigger will run.
Argument : not used.
Variables:
%self% - the room.
Example: @RTSTAT 51, 2202, 2201@n
See also: RANDOM-TIMING, TRIGEDIT-ROOM-GLOBAL
#31
RANDOM-TIMING TIMING TRIGEDIT-RANDOM-TIMING TRIG-RANDOM-TIMING TRIG-TIMING TRIGEDIT-TIMING TRIGGER-TIMING
Since random triggers fire every 13 seconds you can set how often the trigger
fires by modifying numeric arg to the following values:
1% = 22 minutes
2% = 11 minutes
5% = 4 minutes
10% = 2 minutes
20% = 1 minute
50% = 26 seconds
100% = 13 seconds
The actual equation is 100/numeric arg X 13 = time in seconds. 100/20 X 13 = 65 seconds
See also: TRIGEDIT-OBJ-RANDOM, TRIGEDIT-MOB-RANDOM, TRIGEDIT-ROOM-RANDOM
#31
TRIGEDIT-ROOM-COMMANDS TRIG-ROOM-COMMANDS CLIMBING
Activates when commands are performed in the room.
Does not work for level 32 and above.
Numeric Arg : not used.
Argument : text which must be part of the command typed to filter out
uninteresting commands.
If 0 is returned by the trigger, character will receive the same message as
if the trigger did not exist, and any other command triggers will be checked.
Variables:
%actor% - the character issuing the command.
%cmd% - the exact command (without arguments) issued.
%arg% - the arguments, if any, following the command.
%self% - the room.
Example: @RTSTAT 52, 1214@n
#31
TRIGEDIT-ROOM-SPEECH TRIGSPEECH TRIG-SPEECH TRIGEDIT-SPEECH TRIG-ROOM-SPEECH
Activates when matching text is spoken by a character in the room
Numeric Arg : 0: argument is a substring that must be found in the speech to cause a
match.
1-100: argument is a list of words, any of which found in the speech will
activate the trigger.
Argument : a phrase or wordlist to be matched.
Variables:
%actor% - the character whose speech activated the trigger.
%speech% - the entire phrase spoken.
%self% - the room.
Example: @RTSTAT 53, 2776, 63, 153, 1354, 139@n
See also: TRIGEDIT-MOB-SPEECH
#31
TRIGEDIT-ROOM-ZONE-RESET TRIGEDIT-ROOM-ZRESET TRIGEDIT-ROOM-LOAD
Activated when the zone this room belongs to is reset.
Note: %load% obj # will not work if it is NO_RENT
Numeric Arg : percentage chance this trigger will activate.
Argument : not used.
Variables:
%self% - the room.
Example: @RTSTAT 54@n
#31
TRIGEDIT-ROOM-ENTER TRIGEDIT-ROOM-ENTRY TRIGEDIT-ENTRY TRIG-ROOM-ENTRY TRIGEDIT-ENTER TRIG-ENTER TRIG-ROOM-ENTER ENTER-TRIG
This trigger is checked whenever someone enters the room (including GOTO).
The trigger will fire before the player enters the room, so if you want the
actor to see the trigger in the room you must use a wait. This trigger fires
on mobs too so use if %actor.is_pc% to make sure it only fires on players.
This trigger will not fire for people %teleport%'d into the room.
Numeric Arg : percentage chance this trigger will activate.
Argument : not used.
If used with a return 0 the character will fail to enter the room.
Variables:
%actor% - the character entering the room.
%direction% - the direction the character came from.
%self% - the room.
Example: @RTSTAT 55, 133@n
See also: TRIGEDIT-MOB-ENTRY
#31
TRIGEDIT-ROOM-DROP TRIGEDIT-DROP TRIG-DROP TRIG-ROOM-DROP DROP-TRIG DROP_TRIG
Activated any time a character attempts to drop an item in this room.
If used with a return 0 the character will fail to drop anything.
Numeric Arg : percent chance this trigger will be activated.
Argument : not used.
Variables:
%actor% - the character attempting to drop the object.
%object% - the object the character is attempting to drop.
%self% - the room.
Example: @RTSTAT 56@n
#31
TRIGEDIT-ROOM-CAST TRIG-ROOM-CAST
Activated if a spell is cast in the room.
Numeric Arg : percent chance this trigger will be activated.
Argument : not used.
Used with return 0 will cause the spell not to be cast.
Variables:
%actor% - the caster of the spell.
%spell% - the number of the spell.
%spellname% - the name of the spell.
%vict% - the target (mob/player) of the spell, if any.
%obj% - the target (object) of the spell, if any.
%self% - the room.
Example: @RTSTAT 57@n
#31
TRIGEDIT-ROOM-LEAVE TRIG-ROOM-LEAVE TRIG-ROOM-EXIT TRIGEDIT-ROOM-EXIT TRIG-LEAVE
Activated when someone leaves the room.
Numeric Arg : percent chance this trigger will be activated.
Argument : not used.
Used with return 0 will prevent the player from leaving the room.
Variables:
%actor% - the character leaving the room.
%direction% - the direction the character is leaving to.
%self% - the room.
Example: @RTSTAT 58, 1233@n
#31
TRIGEDIT-ROOM-DOOR TRIGEDIT-DOOR
Activated when a player uses the door specific commands:
'close, open, pick, lock, unlock' on a door.
Used with return 0 will prevent the command from executing.
Numeric Arg : percent chance this trigger will be activated.
Argument : not used.
Variables:
%actor% - the character using the command.
%direction% - the direction the command is used on.
%cmd% - the specific command activating the trigger
%self% - the room.
Example: @RTSTAT 59@n
#31
TRIGEDIT-ROOM-TIME TRIGEDIT-TIME TRIG-ROOM-TIME
Activated by MUD hour listed in Numeric Arg. A player must be in the room for
it to work unless you use it in conjunction with @RTRIGEDIT-ROOM-GLOBAL@n.
Numeric Arg : MUD hour to trigger off (0-23).
Argument : not used.
Variables:
%time% - MUD hour trigger fires off.
%self% - the room.
See also: TRIGEDIT-ROOM-GLOBAL, %TIME%
#31
TRIGEDIT-MOB-RANDOM TRIGEDIT-RANDOM TRIG-MOB-RANDOM TRIG-RANDOM
No specific event needs to occur for this trigger to be activated. Every 13
seconds this trigger has a chance to run.
Numeric Arg : 0-100: percentage chance this trigger will run when its time
comes due.
Argument : not used.
Variables:
%self% - the mobile.
Example: @RTSTAT 61@n
See also: RANDOM-TIMING
#31
TRIGEDIT-MOB-COMMAND TRIG-MOB-COMMAND
Activates when commands are performed in the same room as the mobile.
Does not work for level 32 and above.
Numeric Arg : not used.
Argument : text which must be part of the command typed to filter out
uninteresting commands.
If 0 is returned by the trigger, character will receive the same message as
if the trigger did not exist, and any other command triggers will be checked.
Variables:
%actor% - the character issuing the command.
%cmd% - the exact command (without arguments) issued.
%arg% - the arguments, if any, following the command.
%self% - the mobile.
Example: @RTSTAT 153, 1371, 62, 2721, 167@n
#31
TRIGEDIT-MOB-SPEECH TRIG-MOB-SPEECH TRIGEDIT-SPEECH TRIG-SPEECH
Activates when matching text is spoken by a character in the same room as the
mobile. This does not work for tells, gossip, etc.
Numeric Arg : 0: argument is a substring that must be found in the speech to cause a
match.
1: argument is a list of words, any of which found in the speech will
activate the trigger.
Argument : a phrase or wordlist to be matched.
Variables:
%actor% - the character whose speech activated the trigger.
%speech% - the entire phrase spoken.
%self% - the mobile.
Example: @RTSTAT 53, 2776, 63, 153, 1354, 139@n
See also: TRIGEDIT-ROOM-SPEECH
#31
TRIGEDIT-MOB-ACTION TRIG-MOB-ACT ACTIONS TRIGEDIT-ACTIONS TRIG-ACTIONS MOB-ACT
Activated when a matching action is performed by a character in the room.
Actions are any text output via the act() function, and include most output
from the mud. (Notable exclusions are character say's, and immortal echo's.)
Numeric Arg : 0: argument is a substring that must be found in the text to cause a
match.
1: argument is a list of words, any of which found in the text will
activate the trigger.
Argument : a phrase or wordlist to be matched.
Variables:
%actor% - the character causing the trigger to activate.
%victim% - the character, if any, on the receiving end of the action .
%object% - the object, if any, used in the action.
%target% - the target of the action, if any.
%arg% - the entire phrase.
%self% - the mobile.
Example: @RTSTAT 127, 64, 1372@n
#31
TRIGEDIT-MOB-DEATH TRIG-MOB-DEATH MOB-DEATH MOBDEATH MDEATH
Activated when this mobile dies just before the death cry. You can not %purge%
%self% or use waits. You can %teleport% %self%.
Numeric Arg : percent chance this trigger will be activated upon the mobile's death.
Argument : not used.
If used with a return 0 no death cry will be heard from the mobile.
Variables:
%actor% - the character killing this mob, if any.
%self% - the mobile.
Example: @RTSTAT 2, 65, 19537@n
#31
TRIGEDIT-MOB-GREET GREET TRIGEDIT-GREET TRIG-MOB-GREET GREETINGS GREETERS
Activated when a player attempts to enter the room and the character is visible
to the mobile with this trigger. Return 0 prevents the player from entering the
room. Does not work for poofins.
Numeric Arg : percent chance this trigger will be activated.
Argument : not used.
Variables:
%actor% - the character entering the room.
%direction% - the direction the character came from.
%self% - the mobile.
Example: @RTSTAT 1305, 66, 101, 162@n
See also: TRIG-MOB-GREET-ALL
#31
TRIGEDIT-MOB-GREET-ALL GREET-ALL TRIGEDIT-MOB-GREETALL TRIG-MOB-GREET-ALL TRIGEDIT-MOBILE-GREET-ALL TRIG-MOB-GREET-ALL
Identical to greet except the mobile does not have to see the entering character
for this trigger to activate. Does not work for poofins.
Numeric Arg : percent chance this trigger will be activated.
Argument : not used.
Variables:
%actor% - the character entering the room.
%direction% - the direction the character came from.
%self% - the mobile.
Example: @RTSTAT 67@n
See also: TRIG-MOB-GREET
#31
TRIGEDIT-MOB-ENTRY ENTRY TRIGEDIT-ENTRY TRIGGER-ENTRY TRIG-MOB-ENTER TRIGEDIT-MOB-ENTER TRIGEDIT-MOBILE-ENTRY TRIG-MOB-ENTRY TRIGEDIT-MOBILE-ENTER
Activated each time the mobile it is attached to enters a room.
Return 0 will prevent the mob from entering the room.
Numeric Arg : percent chance this trigger will be activated.
Argument : not used.
Variables:
%self% - the mobile.
Example: @RTSTAT 68@n
See also: TRIGEDIT-ROOM-ENTER
#31
TRIGEDIT-MOB-RECEIVE TRIG-MOB-RECEIVE RECEIVE %RECEIVE% TRIG-MOB-RECEIVE TRIGEDIT-RECEIVE TRIG-RECEIVE TRIGEDIT-MOBILE-RECEIVE TRIG-RECEIVES TRIGEDIT-MOB-RECIEVES TRIGEDIT-MOBILE-RECIEVES TRI-RECIEVE TRIGEDIT-MOB-GIVE TRIG-MOB-GIVE
Activated any time an object is given to the mobile.
Numeric Arg : percent chance this trigger will be activated.
Argument : not used.
With a return 0 the object is not transferred to the mobile.
Variables:
%actor% - the character handing the object to the mobile.
%object% - the object being handed over.
%self% - the mobile.
Examples: @RTSTAT 69, 38, 152@n
#31
TRIGEDIT-MOB-FIGHTING TRIG-MOB-FIGHTING TRIGEDIT-MOB-ATTACK TRIG-MOB-ATTACK
Activated each round of fighting, after the mobile has had all of its attacks.
Numeric Arg : percent chance this trigger will be activated.
Argument : not used.
Variables:
%actor% - the character this mobile is fighting.
%self% - the mobile.
Example: @RTSTAT 70@n
#31
TRIGEDIT-MOB-HITPERCENT TRIGEDIT-MOB-HITPRCNT
Activated during combat when the mobiles hit point percentage drops below a
specified percentage.
Numeric Arg : percentage of hitpoints at the threshold of allowing this trigger to
activate.
Argument : not used.
Variables:
%actor% - the character this mobile is fighting.
%self% - the mobile.
Example: @RTSTAT 71@n
#31
TRIGEDIT-MOB-BRIBE TRIGEDIT-BRIBE TRIG-MOB-BRIBE ASSASSINS
Activated when a character gives a specified amount of gold to the mobile.
Numeric Arg : minimum number of gold pieces required to activate this trigger.
Argument : not used.
Variables:
%actor% - the character providing gold to the mobile.
%amount% - number of coins given.
%self% - the mobile.
Example: @RTSTAT 130, 72, 8308, 23612, 19580@n
See also: MHUNT
#31
TRIGEDIT-MOB-LOAD TRIGEDIT-LOAD TRIG-LOAD
Activated when this mobile is created.
Numeric Arg : percent chance this trigger will be activated.
Argument : not used.
Variables:
%self% - the mobile.
Example: @RTSTAT 73@n
#31
TRIGEDIT-MOB-MEMORY TRIG-MOB-MEMORY MEMORY REMEMBERING
Activated when the mobile encounters a character in its memory (mremember)
list and there is no over-riding command. Any mobile making use of mremember
MUST have a memory trigger, even if it will never be called.
Numeric Arg : percent chance this trigger will be activated..
Argument : not used.
Variables:
%actor% - the character being remembered.
%self% - the mobile.
Example: @RTSTAT 74@n, @RTSTAT 75@n
See also: NPC-FLAGS
#31
TRIGEDIT-MOB-CAST
Activated when the mob is targeted by a spell.
Numeric Arg : percent chance this trigger will be activated.
Argument : not used.
Used with return 0 will cause the spell not to be cast.
Variables:
%actor% - the caster of the spell.
%spell% - the number of the spell.
%spellname% - the name of the spell.
%self% - the mobile.
Example: @RTSTAT 76@n
#31
TRIGEDIT-MOB-LEAVE TRIG-MOB-LEAVE TRIGEDIT-MOB-EXIT TRIG-MOB-EXIT
Activated when someone leaves the room the mob is in if the mob can see the person.
Numeric Arg : percent chance this trigger will be activated.
Argument : not used.
Used with return 0 will prevent the player from leaving the room.
Variables:
%actor% - the character leaving the room.
%direction% - the direction the character is leaving to.
%self% - the mobile.
Example: @RTSTAT 77@n
#31
TRIGEDIT-MOB-DOOR
Activated when the mobile is in the same room as someone using the door specific
commands 'close, open, pick, lock, unlock' on a door.
Used with return 0 will prevent the command from executing.
Numeric Arg : percent chance this trigger will be activated.
Argument : not used.
Variables:
%actor% - the character using the command.
%direction% - the direction the command is used on.
%cmd% - the specific command activating the trigger.
%self% - the mobile.
Example: @RTSTAT 78, 33809@n
#31
TRIGEDIT-MOB-TIME TRIG-MOB-TIME
Activated by MUD hour listed in Numeric Arg.
Numeric Arg : MUD hour to trigger off (0-23).
Argument : not used.
Variables:
%time% - MUD hour trigger fires off.
%self% - the mob.
See also: %TIME%
#31
TRIGEDIT-OBJ-GLOBAL TRIG-OBJ-GLOBAL
Not a trigger type by itself; used in conjunction with Random @RHELP
TRIGEDIT-OBJ-RANDOM@n. While Random triggers only trigger if players
are in the same room, Global Random triggers will trigger regardless.
Numeric Arg : not used.
Argument : not used.
Variables:
%self% - the object.
Example: @RTSTAT 79@n
#31
TRIGEDIT-OBJ-RANDOM TRIGEDIT-OBJECT-RANDOM TRIG-OBJ-RANDOM
No specific event needs to occur for this trigger to be activated. Every 13
seconds this trigger has a chance to run.
Numeric Arg : 0-100: percentage chance this trigger will run when its time
comes due.
Argument : not used.
Variables:
%self% - the object.
Example: @RTSTAT 80@n
See also: RANDOM-TIMING
#31
TRIGEDIT-OBJ-COMMANDS TRIGEDIT-OBJECT-COMMAND TRIG-OBJ-COMMAND TRIG-OBJ-COMMANDS
Activates when a command is performed near this object.
Command triggers do not work for level 32 and above.
Numeric Arg : a bitfield to indicate where the object must be in order to cause
the trigger to activate.
Bits: 1: In character's worn equipment.
2: In character's carried inventory.
4: In same room with the character.
These bits can be set at once by adding the values.
7= worn, inv, room. 3 = worn, inv. 5 = worn, room.
Argument : A single word which must be typed to activate the trigger. Look at
the examples for how to use multiple word arguments.
If a return 0 is used the character will receive the same message as if the
trigger did not exist, and any other command triggers will be checked.
Variables:
%actor% - the character issuing the command.
%cmd% - the exact command (without arguments) issued.
%arg% - the arguments, if any, following the command.
%self% - the object.
Example: @RTSTAT 81, 154, 6, 9800, 11859@n
#31
TRIGEDIT-OBJ-TIMER TRIGEDIT-TIMER TRIG-TIMER TRIGEDIT-OBJECT-TIMER
Activated when the timer for this object has expired. The otimer command may
be used in a trigger to set the object's timer. Timer value of 1 equals about
1 minute.
Numeric Arg : not used.
Argument : not used.
Variables:
%self% - the object.
Example: @RTSTAT 82@n
See also: TIMER, %TIMER%, %TIME%
#31
TRIGEDIT-ADVANCED-EXAMPLES
To add life to the worlds tbaMUD uses something called triggers. There are
three things in game that can have triggers attached to them: mobiles, objects,
and rooms. Examples of common triggers include:
Cityguards screaming 'PROTECT THE INNOCENT! BANZAI! CHARGE!', (a mob trigger).
A portal that teleports players when they enter it (an object trigger).
A room that creates a new exit when a player pulls a lever (a room trigger).
Every room, mobile, and object can have one or multiple triggers attached to it.
These triggers are activated by an event such as room entry, speech, commands,
etc.
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 with each triggers help file. @RHELP
TRIG-TYPE@n for a listing of all the trigger type help files.
When an event in the game occurs, each trigger in the room where the event
occurred is checked to see if there are any triggers which are supposed to
react to that event. Only one trigger of each trigger will be run by a single
event. For example, if there are two triggers on a trigger, 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, trigger specific commands and game commands. Triggers
specific commands are those commands that only the trigger 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 such as wake, east, sit, etc.
See also: @RTRIGEDIT-MOB-TUTORIAL@n, @RTRIGEDIT-ADVANCED-TUTORIAL@n
#31
TRIGEDIT-ADVANCED-TUTORIAL TRIG-ADVANCED-TUTORIAL
If you haven't already refer to @RHELP TRIGEDIT-MOB-TUTORIAL@n. The process is
the same:
1. Decide what you want the trigger to do.
2. Make the mobs, objects, and rooms.
3. Split up the quest into simple sections.
4. Decide what trigger types you need.
5. Write the triggers.
6. Attach the triggers - permanently
7. Done ?
Decide what you want the trigger to do.
First determine the type of trigger you want: Room, Mobile, or Object.
Then decide what action you want to activate the trigger. Doing this before
worrying what can be done prevents you from limiting yourself to what you have
seen other triggers do, and allows you to produce a more interesting trigger.
For this example, I want to create a gate guard for a small walled town. The
ruler of the town has decided that each group of people will be charged ten
coins to enter his domain. The gate guard must notify travelers of the cost to
enter, collect the money, allow people who have paid to enter the city, and
close the gate after them. This will be a mob trigger.
Make the mobs, objects, and rooms.
Split up the quest into simple sections.
Decide what trigger types you need. @RHELP TRIG-TYPE@n
Our gate guard needs to react to four different events. These events are what
will cause the triggers to fire. Remember: a trigger requires a "triggering"
action. i.e. speech, command, greet, etc.
1. A character entering the room from the south needs to be told the price for
entrance. This will be a mobile greet trigger. @RHELP TRIG-MOB-GREET@n
2. When the guard is given ten or more coins, the guard must open the gate. This
is done by a mobile bribe trigger. @RHELP TRIGEDIT-MOB-BRIBE@n I also want
the guard to give change and refuse entry for those without the money.
3. When someone passes through the gate, the guard must close and lock the gate
behind them. This is done with a mobile act trigger. @RHELP TRIG-MOB-ACT@n
4. When the gate is opened from the other side, the guard must eventually close
it. This will be another act trigger.
Determine the arguments and the numerical arguments of the triggers from the help
files. For the bribe trigger, the guard must respond whenever someone gives him
some coins, so Numeric Arg should be 1. The Act triggers should fire off "leaves
north" and "the gate is opened from the other side."
Write the body of the trigger.
This is the most complex and time consuming part. The valid commands and
variables are explained in the help files @RHELP TRIG-COMMANDS@n and @RHELP
VARIABLES@n. Expressions are also used: @RHELP EXPRESSIONS@n
For the greet trigger, I want the guard to inform anyone entering from the
south how to get into the city. First, I must check if the character is
entering from the south. If they are then the guard should tell the actor the
cost of entry. @RTSTAT 4@n
Under @RHELP TRIG-MOB-GREET@n we see that the variable %direction% is set to
the direction that the character entered. The percent signs around any word
means it is a variable and it can be found in @RHELP VARIABLES@n. The two equal
signs together compares the value of the variable to the word "south" if these
are equal the lines in the body of the if will be executed. The "wait 1 sec"
pauses the trigger for 1 second to allow the character to enter the room. (The
greet trigger is actually checked before the character enters the room. After
another brief pause, the guard announces the cost to enter the town. The
indentations are not needed, but make it easier to read. You can auto-indent a
trigger by using /f or /fi. This is HIGHLY encouraged. Remember, every if needs
an end!
The guard must open the gate if ten or more coins were given to him. @RTSTAT 5@n
After a brief wait (so everything doesn't happen at once), the guard unlocks
the gate and opens it. The guard will close the gate after 10 seconds, even if
no one passes through it. For the line "give %amount% coins %actor.name%", the
variables amount and actor are both set when the bribe trigger is called, these
variables are automatically substituted.
For the first act trigger, I want the guard to close and lock the gate after
someone passes through the gate. The guard should wait briefly so he isn't
shutting the gate on the character's back, then close and lock the gate. @RTSTAT 7@n
For the last act trigger we want the guard to close and lock the gate when it
is opened from the other side. @RTSTAT 8@n The "wait 5 sec" gives time for
someone on the other side to get through the gate. Next decide the order of the
triggers. The triggers are checked from first to last. If there are two
triggers of the same type, the first one run will be the only one run.
There are is one set of triggers which are the same type, the act triggers.
Since both have arguments that will not occur together the order does not
matter.
Write the trigger.
Simply use trigedit to create your trigger and they will be auto-saved for you
when you exit the editor. @RHELP TRIGEDIT@n, @RHELP TRIGEDIT-MENU@n for help
Attach the triggers.
In the OasisOLC medit, redit, oedit menus, use menu option S to enter the
trigger menu. Then select the triggers that will be part of your trigger. Note,
that order is important! If there are two possible triggers that could both be
executed at the same time, only the first one found in the list will be
activated. In this example. If you require two of the same trigger types to work
you must use a return 0. @RHELP RETURN-0@n
Test the trigger.
You should see how the trigger actually works in the game, and watch other
people interact with it. Often you will see ways you can improve it.
@RGOTO 13@n and work your way north to test these out. Triggers 4, 5, 7, 8
#31
TRIGEDIT-MOB-GLOBAL TRIG-MOB-GLOBAL
Not a trigger type by itself; used in conjunction with Random @RHELP
TRIGEDIT-MOB-RANDOM@n. While Random triggers only trigger if players
are in the same room, Global Random triggers will trigger regardless.
Numeric Arg : not used.
Argument : not used.
Example: @RTSTAT 60@n
#31
TRIGEDIT-MENU TRIG-MENU TRIG-EDIT TRIGEDIT-EDITOR SCRIPT-EDITOR TRIGGER-MENU TREDITOR DG-MENU
Trigger Editor [1300] @RHELP TRIGEDIT-EDITOR@n
1) Name : @ynew trigger@n @RHELP TRIGEDIT-NAME@n
2) Intended for : @yMobiles@n @RHELP TRIGEDIT-INTENDED@n
3) Trigger types: @yGreet@n @RHELP TRIGEDIT-TYPES@n
4) Numeric Arg : @y100@n @RHELP TRIGEDIT-NUMERIC@n
5) Arguments : @RHELP TRIGEDIT-ARG@n
6) Commands: @RHELP TRIGEDIT-COMMANDLIST@n
@csay My trigger commandlist is not complete!@n
Q) Quit
Enter Choice :
See also: TRIGEDIT-TYPES, TRIGEDIT-COMMANDS, VARIABLES, TRIGEDIT-MOB-TUTORIAL,
TRIGEDIT-ADVANCED-TUTORIAL, TRIGEDIT-ADVANCED
#31
TRIGGER-EDITORS
A trigger consists of the type, information on when to execute it, a list of
commands, and a list of variables. Each mobile, object, and room have their
own set of triggers.
#31
TRIGEDIT-NAMES TRIG-NAMES TRIGGER-NAMES
1) Name : @ynew trigger@n
Always use names that explain your trigger and include the VNUM for the
mob/obj/room the trigger is going to be attached to. It is important to give
your trigger a name you and others can understand. This way others can search
"vnum trigger ." This will also make it easier when using tlist and
tstat. Allowing others to quickly comprehend what the trigger does. Here are
some good examples:
Princess Shout for Help - M2229 --> Trigger 2204 attached to mob 2229.
Tutorial Example Quest Offer - M14 --> Trigger 1 attached to mob 14.
No Recall - R0 --> Trigger 1201 attached to room 0.
#31
TRIGEDIT-INTENDED
2) Intended for : @yMobiles@n
This is either Mobiles (the default), Objects or Rooms. While in most cases it
is possible to make a trigger work for either one, it is highly recommended to
only use the correct type.
0: Mobiles, 1: Objects, 2: Rooms:
#31
TRIGEDIT-TRIGGER-TYPES
3) Trigger types: @yGreet@n
This is a bitvector of which kind of events this trigger is triggered by. This
is the most important part of the trigger. It is here you decide if you want the
trigger to react on people dying in the room, dropping objects, saying stuff,
entering, jumping insanely up and down or whatever else you might think of.
This part is also the most important, in the sense that the rest of the triggers'
info means different things, depending on what trigger type the trigger has.
For a full listing of types see: @RHELP TRIGEDIT-TYPES@n
#31
TRIGEDIT-ARGUMENTS ARGUMENTS ARGLISTS TRIG-ARG ARGUMENTS TRIG-ARGUMENTS
Argument: This describes the text argument, if any, which can be used to
filter out matches to the trigger.
See also: TRIGEDIT-MENU
#31
NUMERIC-ARGUMENTS NUMARG NARG TRIGEDIT-NUMERIC-ARGUMENTS TRIGEDIT-ARGUMENTS %NUMERIC% TRIGEDIT-NUMARG NUMERICARGUMENT NUMERIC-ARGUMENT
4) Numeric Arg : @y100@n
Numeric arguments purpose varies depending on the trigger type. For most
triggers it is the percentage chance of firing. But, it can also be the
percentage of hitpoints remaining, location of an object, to match a string
or single word in the argument, or the amount of gold for a bribe. To find
out what numeric arg does for each trig look up that triggers help file.
See Also: TRIG-TYPES
#31
TRIGEDIT-COMMANDLISTS TRIG-COMMANDLIST TRIGEDIT_COMMANDS
6) Commands:
@csay My trigger commandlist is not complete!@n
This is the command list, which contains the actions which take place, when the
trigger is executed. The command list makes use of the @RHELP TEXT-EDITOR@n.
This is often called the 'trigger', and is actually a small program, executed
step by step. In it, you can use different types of commands: trigger - specific
commands, flow control commands - if this is a mobile trigger, you can use
standard mud commands like say or give.
#31
DG-SCRIPTS DG_SCRIPTS DGSCRIPTS
Stands for Death Gate scripts and are named after the original MUD they came from.
See also: TRIGEDIT, TRIGEDIT-MENU
#31
TRIGEDIT-MOB-TUTORIAL TRIGEDIT-TUTORIAL MOB-TUTORIAL
This mini-quest is setup in TBA as an example. @RGOTO 13@n and work your way
north with nohassle off. Be sure you know how to use the @RTSTAT@n and @RSTAT@n
commands.
The following 7 steps should give you a general idea about what to do, and how
to go about making small quests with trigedit. This example concentrates on
quests involving mobs.
The process can be broken down to the following:
1. Decide what you want the trigger to do.
2. Make corresponding mobs, objects, and rooms.
3. Split up the quest into simple sections.
4. Decide which trigger types you need.
5. Write the triggers.
6. Attach the triggers - permanently
7. Done ?
1. Decide what you want the trigger to do.
In this example, we want to make a small mini quest in an area. The quest
will work like this: When you enter the room with the questmaster it will start
to tell a tale. In this tale, you are instructed to perform a task. In this
case kill an ogre that lives nearby. As proof of the kill, you must bring back
the ogre's wings and give them to the questmaster.
2. Make corresponding objects and mobs.
1 Questgiver mob - I've chosen 'the questmaster' - vnum 14
1 Target mob - In this case 'a quest ogre' - vnum 16
1 Quest object - 'a pair of wings' - vnum 14
3. Split up the quest.
Next thing to do is look at the different steps involved with the quest. In
this example, we have three steps:
Player entering room -> tell story
Player finds and kills ogre -> load object
Player gives questmaster the wings -> reward player
4. Find corresponding trigger types.
Having split the quest up it makes it easy to decide which triggers to use
from @RHELP TRIG-TYPE@n:
mob GREET trigger (attached to questmaster) @RHELP TRIGEDIT-MOB-GREET@N
mob DEATH trigger (attached to ogre) @RHELP TRIGEDIT-MOB-DEATH@N
mob RECEIVE trigger (attached to questmaster) @RHELP TRIGEDIT-MOB-RECEIVE@N
5. Write the triggers.
Up to this point trigedit should not have been used. Most people struggle
with triggers because they have not planned what they want to happen or do not
know what trigedit is capable of. Read the help files of each type and ask for
help if you need it. Remember, most of the work required with triggers is
planning! You must know exactly what you want to do before you do it. Now that
we know exactly what we want to do we can use trigedit.
> trigedit 1
Trigger Editor [1]
1) Name : @yMob Tutorial Example Quest Offer - 14@n
2) Intended for : @yMobiles@n
3) Trigger types: @yGreet @n
4) Numeric Arg : @y100@n
5) Arguments :
6) Commands:
@c* we don't want him to tell this to mobs. Check if actor is a player.
if %actor.is_pc%
* only greet players coming from the south.
if %direction% == south
* wait 1 second, always give the player time before you start sending text.
wait 1 sec
say Can you help me, %actor.name%?
wait 1 sec
say An ogre has something of mine.
wait 1 sec
say If you slay him I'll give you all the coins I can spare.
wait 1 sec
say Please, bring me the wings he has stolen.
end
end@n
The trigger above will fire when a player enters the room from the south. If a
mobile enters the if check at the beginning will be false and the trigger will
not execute. Note how I named the trigger. ALWAYS include the VNUM of where you
plan on attaching the trigger. Also, give it a name so it is easy to understand
where it is used. Now for the second trigger:
> trigedit 2
Trigger Editor [2]
1) Name : @yMob Tutorial Example Kill Ogre - 16@n
2) Intended for : @yMobiles@n
3) Trigger types: @yDeath@n
4) Numeric Arg : @y100@n
5) Arguments :
6) Commands:
@csay you got the best of me %actor.name%.
* load the wings
%load% obj 1
* reload the mob for the next questor
%load% mob 16@n
The above trigger will be executed when the mob is killed - just before the
death cry. The last trigger just needs to check if the object handed over is
the correct one. Let's see it, here with vnum 2:
> trigedit 3
Trigger Editor [3]
1) Name : @yMob Tutorial Example Completion - 14@n
2) Intended for : @yMobiles@n
3) Trigger types: @yReceive@n
4) Numeric Arg : @y100@n
5) Arguments :
6) Commands:
@c* check if this was indeed the right object
if %object.vnum% == 1
wait 1 sec
say Thank you, %actor.name%
%send% %actor% %self.name% gives you a gold piece.
%echoaround% %actor% %actor.name% is rewarded for his valor.
nop %actor.gold(1)%
wait 5 sec
%purge% obj 1
else
* this wasn't the right object - don't accept it
say I don't want that - bring me back my wings.
return 0
end@n
First check if the object is the correct vnum, then give the reward, and send
messages to the player and others in the room. If it wasn't the object, reject
it, and use return 0 to prevent the object from leaving the players inventory.
Lastly, and very importantly, 'end' the if. Every if must have an end.
6. Attach the triggers - permanently
Proceed and add the triggers to the two mobiles through medit:
> medit 14
[medit menu]
Enter choice ? S
Script Editor
Trigger List:
N) New trigger for this script
D) Delete a trigger in this script
X) Exit Script Editor
Enter choice :
Here, add the scripts by typing N, then the trigger vnum:
Enter choice : n
Please enter position, vnum (ex: 1, 200): 1
Enter choice ? n
Please enter position, vnum (ex: 1, 200): 3
Enter choice ? x
And add the trigger (vnum 2) to the ogre (vnum 16) in a similar manner.
7. Done ?
The triggers are now attached to the correct mobs, and the players of your
mud can now take the quest whenever they wish. This is a great time for
considering improvements to the little quest:
Balance issues:
Should players get a smaller reward if they perform the quest many times ?
Should it be limited to 1 quest per player or 1 per reboot ?
Gameplay issues:
Perhaps other mobs in town should tell the player to go see the questmaster ?
Should the ogre always load the object, or only when people know he has it ?
Are there other mobs who would like to pay for that object ?
The above list is just a few examples. All of them could be implemented, but
it is beyond the scope of this tutorial.
12DEC01 - original mob tutorial by Welcor
02FEB06 - last updated/modified by Rumble
#31
GAMBLING SLOTMACHINES GAMBLE GAMES
Trigedit can be used to create various games. Feel free to experiment and give
me more examples.
Examples: @RTSTAT 13899, 13420@n
#31
TSTAT EXAMPLES TRIGSTAT TRIGGERSTAT
Usage: tstat
Tstat lets you learn more about a specific trigger.
Be warned that all the triggers on TBA may not work since anyone could
have made them. Ask around for the best examples. Zone 0 are the basic
examples. For more examples check out zones 0, 13, 19, 27, 29, 77, 236 and
237. There are numerous others. Look around, just beware some may not be
"good" examples.
To learn more about any of these just tlist then tstat each
trigger individually. You can always ask Rumble to find you an example.
See also: TLIST, TRIGEDIT, OLC
Other Examples: TRIG-EXAMPLES
#31
ATTACH
Builders working on their trial vnum do not need to learn this command, yet.
Usage: attach mob {trigger vnum/name} {mob name} [location]
attach obj {trigger vnum/name} {obj name} [location]
attach room {trigger vnum/name} {room vnum} [location]
Attach lets you attach a trigger to one instance of a mob/obj/room, for
testing or other purposes. The command only attaches the trigger once,
and will not last over a reboot (or crash).
The 'location' is what number in the triggerlist the trigger will assume.
It is important to first attach a trigger to test before you manually add it
through oedit/medit/redit.
Examples:
attach room 14500 14520 - Attaches room trigger 14500 to room 14520.
attach mob 1332 Santa - Attaches mob trigger 1332 to mob 1308 (Santa).
attach obj 1480 sword - Attaches obj trigger 1480 to a sword.
See also: DETACH, TRIG-ATTACH, TRIG-DETACH, OLC, TRIGEDIT, TSTAT, STAT, ROOMFLAGS
#31
DETACH UNATTACH
Builders working on their trial vnum do not need to learn this command, yet.
Usage: detach [mob | obj] {target name} {trigger name/vnum | 'all'}
detach room {target vnum | '.'} {trigger name/vnum | 'all'}
Detach removes a trigger to one instance of a mob/obj/room, for testing or
other purposes. The command only removes the trigger temporarily, until the
room/obj/mob is reloaded via reboot, zreset, load.
Use the optional arguments 'mob' and 'obj' to differentiate if more entities
with the same alias are in the room.
Examples:
detach room 14500 14520 - remove trigger 14500 from room 14520.
detach room all - removes all triggers from a room.
detach Santa 1332 - detach trigger 1332 from mob 1308 (Santa).
detach mob Santa all - detach all triggers from Santa.
detach Santa all - Same as above.
detach sword 1300 - detach trigger 1300 from sword.
detach obj sword 1300 - You guessed it - same as above.
detach sword all - detach all triggers from the sword.
See also: ATTACH, TRIG-DETACH, TRIG-ATTACH, OLC, TRIGEDIT, TSTAT, STAT, ROOMFLAGS
#31
TRIG-ATTACH %ATTACH% DG_ATTACH TRIG_ATTACH
Usage: attach vnum id
* This small trigger will attach a trigger to the carrier this can for instance
* be used if you want the mob to change attitude by adding another trigger
* (ie - mob was mad - mob got apple - mob gets a 'nicer' trigger attached
attach 3001 %self.id%
This command allows a trigger to attach a trigger (referenced by vnum) to
anything capable of receiving triggers, by id number. (%self.id%, %object.id%,
and %actor.id% are examples of id numbers, for use with this command.)
Example: @RTSTAT 1345@n
See also: ATTACH, DETACH, TRIG-DETACH
#31
TRIG-DETACH %DETACH%
Usage: detach id
* if we - as described in the attach example, want our mob/obj/room to behave
* differently, it is not always enough to just add another trigger with attach.
* it might be necessary to remove some old ones :
detach 3000 %self.id%
or
detach all %self.id%
The opposite of attach, this removes triggers from the specified target.
Example: @RTSTAT 45@n
See also: ATTACH, DETACH, TRIG-ATTACH
#31
TRIGEDIT-ARRAYS ARRAYS TRIG-ARRAYS
Trigedit can use arrays to store information. An array is a variable that
can hold more than one piece of information at a time. Arrays are used to store
a list of variables.
For Example: set textarray[1] a string of text.
Would store "a string of text." in textarray position 1. You can have numerous
positions to an array. See the examples below.
@RTSTAT 150, 41005, 1325, 57715@n
#31
TRIG-EXAMPLES ASSEMBLIES ASSEMBLE ASSEMBLY VEHICLES MAKE BAKE BREW CRAFT FLETCH KNIT MIX THATCH WEAVE ASSEDIT FORGE SMOKE SMOKING CIGARS CIGARETTES PIPES SHOTGUN BLAST SHOOT RANGED-WEAPONS FIRE-WEAPONS BOWS QUIVERS MISSILES GUNS FIREARMS AMMO TRIGEDIT-EXAMPLE
The above list of skills are not implemented since the same thing can be done with trigedit.
Assemblies: @RTSTAT 38, 48, 335@n
Smokables: @RTSTAT 159@n
Furniture: @RTSTAT 1399@n
Weapons: @RTSTAT 1361, 9000, 11840, 13005@n
See Also: @RTRIG-QUESTS@n
#31
DG_AFFECTS DGAFFECT SCRIPT-AFFLICTED AFFLICTED DG-AFFECTS DG-AFFECTS %DG_AFFECT% DG-EFFECT DG_EFFECT DURATIONS AFFECTED_BY TRIG-AFFECTS
Usage: dg_affect
Modifies an affection or apply on the target. Duration should be in hours and
must be non-zero.
dg_affect %actor% sanct on 20 -- Sets sanctuary on actor for 20 hours.
dg_affect %actor% maxhit 100 20 -- Sets maxhit on actor +100 for 20 hours.
To check to see if an actor has an affection use affect(). i.e. if %affect(blind)%
Example: @RTSTAT 1382@n
See also: APPLIES, AFFECT, TRIG-AFFECT
#31
EQUIPMENT POSITIONS EQUIPMENT-POSITIONS WORN FINGERS NECKS BODY HEADS LEGS FEET HANDS ARMS SHIELDS ABOUT WAIST WRISTS WIELDED HELD TRIG-POSITIONS TRIGEDIT-POSITIONS %POSITIONS% EQ-SLOT %EQ-SLOT%
Usage: equipment
Gives you a list of all the equipment you're wearing, holding, and wielding.
You are using: Trigedit positions
[200] a generic light light 0
[201] a generic ring rfinger 1
[202] a generic ring lfinger 2
[203] a generic necklace neck1 3
[204] a generic necklace neck2 4
[205] a set of generic body armor body 5
[206] a generic helm head 6
[207] a pair of generic leggings legs 7
[208] a pair of generic boots feet 8
[209] a pair of generic gloves hands 9
[210] a pair of generic sleeves arms 10
[211] a generic shield shield 11
[212] a generic cape about 12
[213] a generic belt waist 13
[214] a generic wristguard rwrist 14
[215] a generic wristguard lwrist 15
[216] a generic weapon wield 16
[217] a generic staff hold 17
inv 18
AC is modified on some positions as follows: Body X3, Head and Legs X2.
See also: INVENTORY, REMOVE, WEAR, %INVENTORY%, %EQ%
#31
MEDIT-AFF-FLAGS AFFECTIONS AFFECTS
M) AFF Flags : @cNOBITS@n
1) BLIND Mob is blind.
2) INVIS Mob is invisible.
3) DET-ALIGN NOT USED.
4) DET-INVIS Mob can see invisible characters and objects.
5) DET-MAGIC Mob is sensitive to magical presence.
6) SENSE-LIFE Mob can sense hidden life.
7) WATWALK Mob can traverse unswimmable water sectors.
8) SANCT Mob is protected by sanctuary (takes half damage).
Adds text ...it glows with a bright light! to l-desc.
9) GROUP Reserved for internal use. Do not set.
10) CURSE Mob is cursed.
11) INFRA Mob can see in dark.
12) POISON Reserved for internal use. Do not set.
13) PROT-EVIL Mob is protected from evil characters.
14) PROT-GOOD Mob is protected from good characters.
15) SLEEP Reserved for internal use. Do not set.
16) NO_TRACK Mob cannot be tracked.
17) UNUSED Unused (room for future expansion).
18) UNUSED Unused (room for future expansion).
19) SNEAK Mob can move quietly without room being informed.
20) HIDE Mob is hidden; can only be seen with sense life.
21) UNUSED Unused (room for future expansion).
22) CHARM Reserved for internal use. Do not set.
See also: INVIS, MEDIT-NPC-FLAGS, DG_AFFECT, TRIG-AFFECT
#31
TEXT-EDITOR TEXTEDITOR /d /i /h /s /a /c /ra /l /fi /d1 /p WORDWRAP WORD-WRAP FORMATTING REPLACE /e# DELETE-LINE REMOVE-LINE LINES INDENT
The text editor is what you use to write room/mob/obj/extra descriptions,
mudmails, and even boards. It allows you more commands than the typical entry.
To learn the commands while using the text editor, type /h. It will tell you
what all the / commands do. Always use /fi to format, indent, and word wrap.
It looks much better to see writing that is formatted than one that runs all
over the place wrapping around etc. Just simply type /fi on a new line and hit
enter. Before you save type /l to list the buffer and see for yourself how it
looks. Fix as needed.
When entering the text editor for the first time make sure to use /c to clear
the current contents. Indent and format all descriptions by typing /fi (format
with indent) in the text editor. This includes all forms of OLC, mudmails,
boards, and anywhere else you use the text editor. This will indent the line
by 3 spaces and wrap your text at less than 80 characters so telnet users can
read it.
Editor command formats: /
@n/a - aborts the editor and changes are lost.
@n/c - clears the buffer.
@n/d# - deletes line #, or a range #-#.
@n/e# - changes the line at # with .
@n/f - formats text.
@n/fi - indented formatting of text (highly recommended for all desc's).
paragraphs can be formatted by /f 1-4 (first from lines 1-4,
and /f 5-9 (second from lines 5-9).
@n/h - list text editor commands.
@n/i# - inserts before line #.
@n/l - lists buffer.
@n/n - lists buffer with line numbers, or a range #-#.
@n/r 'a' 'b' - replace 1st occurence of text in buffer with text.
@n/ra 'a' 'b'- replace all occurences of text within buffer with text.
usage: /ra 'pattern' 'replacement'
@n/s - saves the text and exits the editor.
NOTE: /f and /fi in trigedit will auto indent your trigger. PLEASE USE IT.
Commands such as /r, /n, /e#, /i#, /d# are invaluable and will make your job
much easier. For example, say you mistype "the" with "teh" in a 10 line
description. Instead of /c (clearing) the text you can /r 'teh' 'the' or if it
was on line 5 you can type /e5 or /d5. Learn
all these options.
Warning: Some clients will give you problems since they use special characters
like the / character (Avplay, Mush, and SimpleMU).
#31
TRIGEDIT TRIGS TRIGEDITOR TRIGGEREDIT TRIGGER-EDIT TRIGGERS DG-SCRIPTS TRIG-HELP SCRIPTS MOBPROGS MPROGS PROGS SCRIPTING TRIGMENU
Builders working on their trial vnum do not need to learn this command, yet.
Usage: trigedit
This command will let you edit a trigger within your designated zone. If you
specify an unused vnum, a new script will be created with that number.
trigedit 3001 -- make a trigger in zone 30, with the vnum 3001
Join the mailing list at: http://groups.yahoo.com/group/dg_scripts/
@RNOTE: You must disable NOHASSLE to test triggers.@n
@RGOTO 13@n to enter the trigedit hallway.
See also: TRIGEDIT-MENU, TSTAT, TLIST, OLC
#31
BOATS SHIPS FERRY TRANSPORTSS
@RTSTAT 13691@n
#31
VDELETE DELVAR DELETE-VARIABLE IDNUM REMOVE-VARIABLES
Usage: vdelete < variablename | all | * >
Use this to remove a Variable from either mob, room, obj, or player.
Examples:
vdelete has_solved_quest 3531
vdelete all 1
To determine the player ID stat player
> stat file Rumble
male PC 'Rumble' IDNum: [ @R1@n], In room [ 0]
See also: REMOTE, RDELETE
#31
TRIG-QUESTS TRIGEDIT-QUESTS AUTOQUEST QUESTS QUESTPOINTS QUEST-POINTS QUESTMASTERS QUEST-MOBS QUESTMOBS QEDIT TRIG_EXAMPLES QUESTSHOP
Many zones have their own quests and examples within them, such as:
Questmaster Example: @RTSTAT 138-144, GOTO 113@n
Assembly Examples: @RTSTAT 38, 48, 335, GOTO 366@n
Questshop Example: @RTSTAT 167, GOTO 265@n
Fizban's Questshop Example: @RTSTAT 57705-57707@n
See Also Examples: TRIG-EXAMPLES, BOATS, PORTALS, GUNS, ASSASSINS
#31
CANBESEEN %CANBESEEN% %ACTOR.CANBESEEN%
Trig Usage: %actor.canbeseen%
True if the actor can be seen by the mob (always true for non-mob triggers).
Example: @RTSTAT 23613@n
#31
TRIG-AFFECTS TRIGEDIT-AFFECTS %ACTOR.AFFECT%
Trig Usage: %actor.affect()%
Checks the actor for the affect in the subfield.
Example: @RTSTAT 166@n
See also: AFFECTS, DG_AFFECT
#31
TRIG-STATISTICS TRIGEDIT-STATISTICS TRIG-STATS %ACTOR.STR% %ACTOR.INT% STRADD
Trig Usage: %actor.(<#>)%
%actor.str% returns the value
%actor.str(18) sets it to 18
Checks the actor's stat. A number in the subfield sets.
Stats include: cha, con, dex, int, str, stradd (only if str is 18).
See also: STATS
#31
HAS_ITEM ACTOR.HAS_ITEM %ACTOR.HAS_ITEM% TRIG_HAS_ITEM
%actor.has_item()%
Checks if actor has item (inventory, equipped and in containers) by subfield name/var/vnum.
@RTSTAT 155@n
#31
IS_PC ACTOR.IS_PC %ACTOR.IS_PC% %IS_PC% ISPC %ISPC% ACTOR_IS_PC %ACTOR_IS_PC% IS_MOB
if %actor.is_pc%
%echo% %actor.name% is a player.
else
%echo% %actor.name% is a mob.
end
Checks if actor is a player. Useful when you want a trigger to fire on players
and not mobs. All Greet triggers should normally fire only on players.
#31
The old webpages (not updated) are available here:http://www.builderacademy.net/Oasis_DG_pages/