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
ToyMage
Apprentice


Joined: 01 Sep 2005
Posts: 120

PostPosted: Fri Dec 16, 2005 9:59 am   

COMBINING Triggers?
 
Hi

I was thinking of combining all similar triggers, but I'm not sure if it is advicable or will it slow down my P3 computer.

For example

#TR {You are hungry|You are thirsty|The sun sets in the west|...} #NOMAP

There are about 50 triggers together. Should I merge all trigger into one?

Toy
Reply with quote
shalimar
GURU


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

PostPosted: Fri Dec 16, 2005 2:08 pm   
 
#VAR nomap {item1|item2|ect}
#TR {{@nomap}} {#NOMAP}
_________________
Discord: Shalimarwildcat
Reply with quote
gamma_ray
Magician


Joined: 17 Apr 2005
Posts: 496

PostPosted: Fri Dec 16, 2005 5:07 pm   
 
I would just leave them all in a class together, I don't see a real reason for combining them.
Reply with quote
Vitae
Enchanter


Joined: 17 Jun 2005
Posts: 673
Location: New York

PostPosted: Fri Dec 16, 2005 5:49 pm   
 
shalimar's got the right idea.
tho i have to ask, why would you #nomap being hungry, thirsty or seeing the sun set?
_________________
http://www.Aardwolf.com
Reply with quote
MattLofton
GURU


Joined: 23 Dec 2000
Posts: 4834
Location: USA

PostPosted: Fri Dec 16, 2005 8:58 pm   
 
It probably wouldn't hurt to combine a few, but having to expand a trigger 50 times on every single line probably will show a much more noticeable performance hit. As for why you'd #NOMAP them, it'd be for when you are mapping. All of those are game messages that appear at set intervals and it's possible that sometimes they'd coincide with when ZMud is looking for room information.
_________________
EDIT: I didn't like my old signature
Reply with quote
shalimar
GURU


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

PostPosted: Fri Dec 16, 2005 9:25 pm   
 
So is it easier for it to check 50 different triggers the an a single trigger off an array of 50? (numbers subject to change)
_________________
Discord: Shalimarwildcat
Reply with quote
Vijilante
SubAdmin


Joined: 18 Nov 2001
Posts: 5182

PostPosted: Fri Dec 16, 2005 11:39 pm   
 
The difference in speed is that all 50 triggers are preregistered and can be eliminated very rapidly. When using a variable list the trigger has to be expanded and registered each time it is checked. List elimination is nearly equal in speed to multiple trigger elimination in most REGEX implementations. So if your are looking for both speed and ease of use I would reccommend a few fixed triggers that group the messages, then dump them in the System|Automapper class so they are only active when you are mapping.
_________________
The only good questions are the ones we have never answered before.
Search the Forums
Reply with quote
Vitae
Enchanter


Joined: 17 Jun 2005
Posts: 673
Location: New York

PostPosted: Sat Dec 17, 2005 4:27 pm   
 
MattLofton wrote:
As for why you'd #NOMAP them, it'd be for when you are mapping. All of those are game messages that appear at set intervals and it's possible that sometimes they'd coincide with when ZMud is looking for room information.


Ah, didn't think of it that way. Thanks Matt :)
_________________
http://www.Aardwolf.com
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