|
#SCRIPTS sections
Sometimes, you want to be able to use the same script for several mobs,
objects or rooms. You COULD could cut and paste the script for every room,
for example, but then if you wanted to later tweak the script, you would
have to modify it for every room.
Instead, you could write the script in the #SCRIPTS section, then
use @include for every room you wanted the script to be linked to.
Format:
#SCRIPTS
#<script name>
<destination type (room|mob|object)>
<script>
....
#END
Example:
#6626
Messy Kitchen~
You stand in the kitchen and eating area of the day care center.
Pots and
pans are everywhere, while the toddlers continue to create chaos.
~
66 8 0
D west~
~
You see a large room full of noisy brats.
~
$n returns from the kitchen.~
$n heads back to the daycare.~
0 0 0 -1 6602 0
@include test1~
|
S
#SCRIPTS
#test1
room
@speech hi~
{
say test1 fired!
}
~
#END
Note that there are some limitations. First, you must declare the scripts
in the area you wish to use them... @includes do not work across areas.
Second, you cannot access dynamic variables other than globals declared
at the area level.
|