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

Play RetroMUD
Post new topic  Reply to topic     Home » Forums » CMUD General Discussion
jed
Adept


Joined: 18 Dec 2005
Posts: 246

PostPosted: Sun Dec 24, 2006 5:34 pm   

Coloring text from multiple stringlist
 
I have two stringlists. call them @string1, @string2. I would like to set up a script that colors the trigger text orange if it matches @string1, Red if it matches @string2, and blue if it matches both @string1 and @string2. I've set up a single trigger for pattern{@string1} then using #cw orange,high, a single trigger for pattern {@string2} then using #cw red,high to color it red. I've also set up a multistate trigger with the first pattern {@string1}, and the second pattern (or state i guess) {@string2} and a script of #cw blue, high. My problem is that I cant get the triggers to fire in the order i'd like (string1 then string2, then the multistate trigger). In Zmud, you could click some little arrows that would move a trigger up or down in the class, which corresponded to it's parsing order. Is this ability somewhere in cmud?
Reply with quote
shalimar
GURU


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

PostPosted: Sun Dec 24, 2006 5:42 pm   
 
i think the priority number would have the same affect here
_________________
Discord: Shalimarwildcat
Reply with quote
Fang Xianfu
GURU


Joined: 26 Jan 2004
Posts: 5155
Location: United Kingdom

PostPosted: Sun Dec 24, 2006 6:09 pm   
 
I'm not sure what you mean by your explanation of your multistate trigger. Shalimar's right, though - the priority number is the setting you want.
_________________
Rorso's syntax colouriser.

- Happy bunny is happy! (1/25)
Reply with quote
jed
Adept


Joined: 18 Dec 2005
Posts: 246

PostPosted: Sun Dec 24, 2006 8:02 pm   
 
Ok the multistate trigger has the main trigger pattern as {@string1} with an empty script, and condition pattern of {@string2} with a script of #cw blue, high. both are set up as pattern triggers. I was thinking maybe changing the condition to a reparse trigger but that didnt work...
I also tested the priority suggestion again (I had done it before I posted, but just wanted to confirm results). I picked the word riffraff and set up two triggers, both with riffraff as the pattern in the same class, but each with a different ID. I used riffraff1 and riffraff2. Riffraff1 has a script of #cw orange,high and riffraff2 has a script of #cw red,high. I check to see that they work, by disabling each, one at a time. When I do this, and see riffraff in the room discription, each fire as they should, so i know the triggers work. I'm not sure how the priority works, but I would think that a trigger with a higher priority would fire before one with a lower priority. Either way, I adjust the priority on one so that it is either higher or lower than the other. Either way, I still keep seeing the text in orange. I would think that if the one with orange highlight had higher priority (indicated by a lower priority number), it would fire first causing the text to be orange, however then the red trigger would fire, coloring the text red as a final result. Again, adjusting the priority doesn't change the outcome... Also, I tried to rename riffraff1 as riffraff3 and move it out of the class, then back in, which graphically places riffraff3 (which was riffraff1) below riffraff2. I thought this might have an effect on the outcome, however it doesnt. riffraff still comes out as orange. I'm kinda thinkin this might be a bug.
Reply with quote
shalimar
GURU


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

PostPosted: Mon Dec 25, 2006 1:09 am   
 
priority works in numerical order... 1 comes before 2 comes before 3, just like your counting, so a lower number is higher priority
_________________
Discord: Shalimarwildcat
Reply with quote
Guinn
Wizard


Joined: 03 Mar 2001
Posts: 1127
Location: London

PostPosted: Mon Dec 25, 2006 1:27 am   
 
but in your case you might want a higher number so that it the multistate one colours last. so the most important with the lowest priority and the highest number. simple eh?
_________________
CMUD Pro, Windows Vista x64
Core2 Q6600, 4GB RAM, GeForce 8800GT
Because you need it for text... ;)
Reply with quote
jed
Adept


Joined: 18 Dec 2005
Posts: 246

PostPosted: Mon Dec 25, 2006 3:59 am   
 
Thanks for the replies, but as I mentioned from my rifraff example, if I have two triggers based on the same trigger pattern "riffraff" in this case, both with #cw scripts changing the priority doesn't make a difference... I've tried with one of the two triggers being higher than the other, then tried changing it to be lower than the other, and it doesn't change the outcome. Please try my riffraff example if u can and let me know if it works.... Thanks for takin the time to look at this, and Merry Christmas!!!
Reply with quote
MattLofton
GURU


Joined: 23 Dec 2000
Posts: 4834
Location: USA

PostPosted: Mon Dec 25, 2006 5:41 am   
 
The priority test worked for me, Jed. What are the specific priority levels you were testing with? You might be seeing differing results either because your priority settings are way too close or because you're suffering from corrupted packages.
_________________
EDIT: I didn't like my old signature
Reply with quote
jed
Adept


Joined: 18 Dec 2005
Posts: 246

PostPosted: Mon Dec 25, 2006 6:52 am   
 

This shows my basic setup. I have riffraff1 set up as priority 30000, and I've tried riffraff2 at 24000 and 35000, the outcome doesnt change. I keep getting Orange. Do I maybe need to change any of the checkbox settings in the lower right?
Reply with quote
MattLofton
GURU


Joined: 23 Dec 2000
Posts: 4834
Location: USA

PostPosted: Mon Dec 25, 2006 5:38 pm   
 
Nope, no need to change any of the options. I used exactly what you did, and I'm not able to get it to fail. Either you need to clean install and rebuild your settings files (or portion thereof), or you're getting a trigger conflict somewhere that makes it look like you have a problem when in fact it's working perfectly. Possibly some new bug elsewhere, but it's not seeming to be an issue with #TRIGGER, #CW or the priority settings.
_________________
EDIT: I didn't like my old signature
Reply with quote
Display posts from previous:   
Post new topic   Reply to topic     Home » Forums » CMUD 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