|
Erasmus Wanderer
Joined: 04 Aug 2004 Posts: 82 Location: Philadelphia
|
Posted: Wed Jun 15, 2005 3:06 pm
Trigger Design |
This is really a conceptual question, and not one about a specific trigger.
I've been wriing some scripts for a MUD I currenlty play, and notice a lot of situations where I need to trigger off of several possible outcomes. For example, if I move in a direction with no exit there are 3 or 4 possible messages I could get. Or, a mob could enter a room 3 or 4 different ways. You get the idea.
My question is: Is it better design to create several different triggers, one for each possibility, or try to combine them all into 1 trigger where possible with pattern matching? |
|
_________________ Erasmus |
|
|
|
Maelstrom Apprentice
Joined: 10 Feb 2005 Posts: 158
|
Posted: Wed Jun 15, 2005 4:06 pm |
It would be better, design wise, to combine the ones which serve the same function into a single trigger were appropriate.
Like a mob entering the room from four different directions is a good example. It does not really matter from which direction the mob is entering from as you will need to do the exact same processing regardless of the direction and this is where I would draw the line. If the processing is the same try and combine them. If you need to do different things depending on the trigger make them seperate from each other. This also comes with the added benefit of being easier to maintain. |
|
|
|
shalimar GURU
Joined: 04 Aug 2002 Posts: 4692 Location: Pensacola, FL, USA
|
Posted: Wed Jun 15, 2005 4:16 pm |
#TR{{output1|output2|output3}} {stuff to do for all said outcomes}
|
|
_________________ Discord: Shalimarwildcat |
|
|
|
|
|