Open new window
Last update:

OasisOLC and Deaths Gate script reference

Trigger editor

Trigger edit has the following syntax:

    trigedit <vnum>    - edit the trigger with number <vnum>
                         You can only do this in your own zone.
                       
    trigedit save [num]  - save the triggers in your zone.
                           The optional argument is available to Gods.
                             
    tlist [low high]     - list the triggers in your zone. The optional
                           arguments show all triggers in the range mentioned.

    tstat <vnum>        - gives detailed information about the trigger with
                           number <vnum>.

The trigedit command start the menu based trigger editor.
Here's what it looks like with a new trigger:

Trigger Editor [1200]

1) Name         : new trigger
2) Intended for : Mobiles
3) Trigger types: Greet 
4) Numberic Arg : 100
5) Arguments    : 
6) Commands:
say My trigger commandlist is not complete!

Q) Quit
Enter Choice :
And now for a step by step walkthrough of the menu:
Trigger Editor [1200]

1) Name         : new trigger

It's important to give your trigger a name you can relate to. When using tlist and when statting a mob you'll only see the name and the number. A good, unique name could be 'guard shout for help' or 'mage cast spell' - heck, even 'object dropped in no drop' might do - as long as you can make sense from it. 

2) Intended for : Mobiles

This is either Mobiles (the default), Objects or Rooms. While in most cases it is possible to make a script work for either one, it is highly recommended to only use the correct type.

3) Trigger types: Greet

This is a bitvector  of which kind of events this trigger is trigered by.
A complete list of the triggers are here.
This is the most important part of the trigger. It's 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.

4) Numberic Arg : 100
5) Arguments    : 

Dependant on the trigger type, these values will mean different things. For instance, if you've decided to use a hitpcnt trigger, the numeric Arg is the percent a mobs hit points have to fall to, before the trigger is activated, and the command list is executed.

6) Commands:
say My trigger commandlist is not complete!

This is the command list, which contains the actions which take place, when the trigger is executed.
The command list makes use of the improved editor commands.
This is often called the 'script', and is actually a small program, executed step by step. In it, you can use different types of commands: script - specific commands, flow control commands - if this is a mobile script, you can use standard mud commands like say or give.

Q) Quit

Lastly, Q exits the trigger editor, and asks you if you wish to save your work.

After having finished the trigger, you need to either attach it to a mob, object or room via the script editor, or by help of the attach command.

It is important to first try out the trigger via the attach command before attaching it via the script editor. If you've made a mistake, causing the mud to crash (we've seen it happen), the script will reattach when the mud comes back up, causing another crash, ad infinitum. This will not happen if you 'attach' it.

To the top of the page

© 2005 Thomas Arp (Welcor). All rights reserved.