|
Script Types
The following are the list of possible script types for each mud entity:
MOB SCRIPTS:
- @action
- Action scripts fire off of things that mobs and players do, such as
dropping a mushroom or going to sleep, etc. The parameter that goes
with action is the string that needs to be matched for the action script
to fire. For example:
@action p sits down.~
This script will fire when someone sits down! The 'p' indicates that
it's a phrase and all the pieces of the argument must match someplace
in the action.
@action sits~
This script will fire whenever someone does something that generates
an action string with the word 'sits' in it. As you can see, 'p' actions
are much more exacting.
In general, this is a super-script. When possible, use speech scripts,
give scripts, entry scripts, really, any other script when you can.
The reason is that action scripts fire off of EVERYTHING and then
we need to check if you really care about this particular action.
The other script types fire only when that particular action is taken...
more efficient!
- @speech
- Speech scripts fire off of things that are said by mobs and players.
Again, the 'p' argument as the first character of your script results
in a matching to a phrase:
@speech p I am hungry~
- @give
- Give scripts fire off of when a object is given to the mob with the
script. For example, if you had a mob that you wanted to do something
when a special pink statue was given to him:
@give pink statue~
- @rand
- Random scripts fire for mobs at random intervals.. based on the percentage
value supplied by the variable:
@rand 10~
This script will fire 10% of the time. Note that scripts do not fire
if the area is empty (an optimization for the mud).
- @fight
- Fight scripts fire at random times (based on the percentage you supply
it) during a battle that the mob is involved in. E.g.
@fight 30~
This script will fire 30% of the time while the mob is engaged in
a battle.
- @death
- Death scripts fire when the mob has been killed. Note that there
are limits here.. the mob is going to die, no matter what you do in
the script.. but it will act alive.. at least during the running of
the script. Again, there is a percentage value here.. thus your mob
won't have to do something EVERY time it dies:
@death 50~
This script will fire 50% of the time the mob dies.
- @hitprcnt
- Hit percentage scripts fire when the mob has reached some percentage
of its hit points. For example, you might make the mob try to flee,
or call for help, etc, once it gets below 20% of its hit points:
@hitprcnt 20~
- @entry
- Entry scripts fire (on a percentage basis) when the mob enters a
room.. as opposed to a greet script (see below).
@entry 100~
This script fires every time.
- @greet
- Greet scripts fire (on a percentage basis) when a mob or player enters
the room that the mob with the script is in.
@greet 40~
- @time
- Time scripts fire when the mud advances an internal hour. This script
is often used in conjunction with the hour variable (discussed below).
- @bribe
- Bribe scripts fire when the amount of money specified by the parameter
is met or exceeded when a mob is given cold hard cash.
@bribe 47~
This script will fire when 47 or more gold pieces are given to the
mob.
- @init
- Init scripts fire when the mob is first placed into the world.
@init
- @init_type
- Init Type scripts fire when the mob TYPE is first defined. This is
useful mainly in reference to script variables and creating a 'species'
memory.
@init_type
- @include
- Include scripts (described in the SCRIPTS section) can be imported
this way.
@include <script name>~
-
ROOM SCRIPTS:
- @action
- Action scripts fire off of things that mobs and players do, such
as dropping a mushroom or going to sleep, etc. The parameter that goes
with action is the string that needs to be matched for the action script
to fire. For example:
@action p sits down.~
This script will fire when someone sits down! The 'p' indicates that
it's a phrase and all the pieces of the argument must match someplace
in the action.
@action sits~
This script will fire whenever someone does something that generates
an action string with the word 'sits' in it. As you can see, 'p' actions
are much more exacting.
- @speech
- Speech scripts fire off of things that are said by mobs and players.
Again, the 'p' argument as the first character of your script results
in a matching to a phrase:
@speech p I am hungry~
- @rand
- Random scripts fire for rooms at random intervals.. based on the
percentage value supplied by the variable:
@rand 10~
This script will fire 10% of the time. Note that scripts do not fire
if the area is empty (an optimization for the mud).
- @greet
- Greet scripts fire (on a percentage basis) when a mob or player enters
the room with the script.
@greet 40~
- @time
- Time scripts fire when the mud advances an internal hour. This script
is often used in conjunction with the hour variable (discussed below).
- @look
- Look scripts fire when a character looks at the room or some extra
description in the room.
@look sign~ (Note that the phrase must match the ENTIRE keyword line
of the room's extra description exactly.)
@look~ (for just 'look' or any autolooks)~
- @init
- Init scripts for rooms fire when the room is first created. This
is useful mainly with regards to script variables.
@init
- @include
- Include scripts (described in the SCRIPTS section) can be imported
this way.
@include <script name>~
-
OBJECT SCRIPTS:
- @action
- Action scripts fire off of things that mobs and players do, such
as dropping a mushroom or going to sleep, etc. The parameter that goes
with action is the string that needs to be matched for the action script
to fire. For example:
@action p sits down.~
This script will fire when someone sits down! The 'p' indicates that
it's a phrase and all the pieces of the argument must match someplace
in the action.
@action sits~
This script will fire whenever someone does something that generates
an action string with the word 'sits' in it. As you can see, 'p' actions
are much more exacting.
- @speech
- Speech scripts fire off of things that are said by mobs and players.
Again, the 'p' argument as the first character ofy your script results
in a matching to a phrase:
@speech p I am hungry~
- @rand
- Random scripts fire for objects at random intervals.. based on the
percentage value supplied by the variable:
@rand 10~
This script will fire 10% of the time. Note that scripts do not fire
if the area is empty (an optimization for the mud).
- @greet
- Greet scripts fire (on a percentage basis) when a mob or player enters
the room where there is an object with the script.
@greet 40~
- @time
- Time scripts fire when the mud advances an internal hour. This script
is often used in conjunction with the hour variable (discussed below).
@use
- These scripts, particular to objects, fire when an object is held
by a player and the cmd 'use' is called. The parameters match what the
use cmd is called with. E.g.
@use boil water~
This script would be useful if attached to a pot!
- @init
- Init scripts for objects are run when the object is first placed
into the world... either into a room, given to a person or placed inside
another object.
@init
- @init_type
- Init Type scripts for objects are run when the object is first defined.
This is useful mostly in relationship to script variables.
@init_type
- @wear
-
Wear scripts fire when an object is 'put on'. Note that the script
does not fire when loaded as part of a mob reset.
@wear 100~
- @remove
-
Remove scripts fire when an object is 'taken off'.
@remove 100~
- @eat
-
Eat scripts fire when an object is 'eaten'.
@eat 100~
- @include
-
Include scripts (described in the SCRIPTS section) can be imported
this way.
@include <script name>~
-
AREA SCRIPTS:
- @init
- Init scripts for areas are run as soon as the AREA section has been
loaded. Typically this should be before anything else in the area has
been created... even before the rooms have been loaded or the mobs have
been created. This is used mostly for script variables.
@init
-
-
|
|