|
malas Newbie
Joined: 21 Jan 2004 Posts: 4
|
Posted: Sat Jan 24, 2004 7:58 pm
problems with triggers |
I have a database with creatures from the mud that are killable. I want to be able to scan the room, if the creature in the room is in the database then add the creature to a kill list. The script I wrote worked fine if there was only one creature in the room. However when there was more than one creature in the room, the triggered fired a second time while still processing the first on the list, which reset the counters, variables etc for the first one and promptly blows up any and all instances of the script running.
The pattern for the trigger is
&mobscan -- right here
but if there is something like
a beggar -- right here
a lady -- right here
it will start proccessing the beggar, get 1/2 done then start processing the lady and fall apart.
How would you set up a trigger so that it can either process one at a time if it fires multiple times quickly or that can match several times over a few lines and add the results to a stringlist before processing all of the items.[?] |
|
|
|
megamog75 Enchanter
Joined: 20 Nov 2002 Posts: 627 Location: USA
|
Posted: Sun Jan 25, 2004 2:07 am |
what you need first is a way to tell when your done with the first kill.
Like so:
a Begger is now dead.
or
the begger falls to the flore dead
You could use this to start the scan room process again
give example of the fight here all the way to the end and I am sure anyone here could help. |
|
|
|
LightBulb MASTER
Joined: 28 Nov 2000 Posts: 4817 Location: USA
|
Posted: Sun Jan 25, 2004 5:38 pm |
Without details of what the trigger does, it's difficult to give any advice on it. Some possible approaches:
1. If the trigger contains looping structures, use #PRIORITY.
2. Give the trigger an ID and then use #T- as the first command in the trigger script. End the script with the #T+ command. This will disable the trigger during the time that it's processing.
3. Use the #ADDITEM command to add targets to a list and the #DELITEM or #DELNITEM command to remove them.
4. Set a variable to a predetermined value to indicate when you are fighting something. Check this variable with the #IF command before attacking. |
|
|
|
|
|