Register to post in forums, or Log in to your existing account
 

Play RetroMUD
Post new topic  Reply to topic     Home » Forums » zMUD General Discussion
Erasmus
Wanderer


Joined: 04 Aug 2004
Posts: 82
Location: Philadelphia

PostPosted: 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
Reply with quote
Maelstrom
Apprentice


Joined: 10 Feb 2005
Posts: 158

PostPosted: 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.
Reply with quote
shalimar
GURU


Joined: 04 Aug 2002
Posts: 4692
Location: Pensacola, FL, USA

PostPosted: Wed Jun 15, 2005 4:16 pm   
 
#TR{{output1|output2|output3}} {stuff to do for all said outcomes}
_________________
Discord: Shalimarwildcat
Reply with quote
Display posts from previous:   
Post new topic   Reply to topic     Home » Forums » zMUD General Discussion All times are GMT
Page 1 of 1

 
Jump to:  
You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum

© 2009 Zugg Software. Hosted by Wolfpaw.net