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
kernighan
Novice


Joined: 14 May 2004
Posts: 37

PostPosted: Wed May 25, 2005 5:08 am   

Multiple SUBS
 
In playing with subs, both as #sub, and #pcol/#psub, it seems that if you want to perform multiple actions on an item of text, you must do them in order.

For example, I do distance subs like:

#TRIGGER {immediate area, %1} {#sub {immedate area, %1 %ansi(bold,yellow)(0-1)}}
#TRIGGER {close by, %1} {#sub {close by, %1 %ansi(bold,yellow)(2-5)}}
#TRIGGER {not far from here, %1} {#sub {not far from here, %1 %ansi(bold,yellow)(6-10)}}
#TRIGGER {, off in the distance, %1} {#sub {, off in the distance, %1 %ansi(bold,yellow)(11-15)}}
#TRIGGER {several miles away, %1} {#sub {several miles away, %1 %ansi(bold,yellow)(16-25)}}
#TRIGGER {, far off in the distance, %1} {#sub {, far off in the distance, %1 %ansi(bold,yellow) (26-50)}}
#TRIGGER {tens of miles away in the distance, %1} {#sub {tens of miles away in the distance, %1 %ansi(bold,yellow)(51-75)}}
#TRIGGER {many miles away, %1} {#sub {many miles away, %1 %ansi(bold,yellow)(76-100)}}
#TRIGGER {a great distance away, %1} {#sub {a great distance away, %1 %ansi(bold,yellow)(101+)}}

Sometimes, there might be a campfire nearby, which I want to highlight in red, so I also have the following trigger:

#TRIGGER {rising from a campfire} {#PCOL bold,red %x1}

This will only work if it comes after all of the distance subs.

I played with using #PCOL in the distance subs, and hit the same problem in that things were order dependant.

How can I modify these so that they are not order dependant?

Thanks,
Kernighan
_________________
Kernighan's Medievia Scriptorium
http://www.geocities.com/mishikal
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