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
saea
Newbie


Joined: 25 Sep 2004
Posts: 4

PostPosted: Sat Sep 25, 2004 1:09 am   

Line Colour
 
I've been trying to make a certain sentence coloured in Evaralyn. My main problem is that it isn't always on one line - sometimes it ends up on two lines. Is there any way I can get it coloured? Here's some examples of the text. The bold is the line I want to have coloured. The person's name in the line, and the direction, are subject to change. Also, how much of the sentence is on each line is also subject to change.

In one line:
Artisans District
Dark flagstones radiate a gentle heat which has been absorbed from the sun
on this narrow road. Small tufts of grass and weed peek between the joins
towards the edges of the road, but the central path has been well trampled
and smoothed by the years of traffic. Bright sunlight beams down glimmering
rays from the clear sky above. A garbage can sits here, ready to dispose of
unwanted items. You sense that Frerin left this area to the west.
There are exits north, northeast, southeast, south, southwest, west and
northwest.


In two lines:
Artisans District
Dark flagstones radiate a gentle heat which has been absorbed from the sun
on this narrow road. Small tufts of grass and weed peek between the joins
towards the edges of the road, but the central path has been well trampled
and smoothed by the years of traffic. Bright sunlight beams down glimmering
rays from the clear sky above. You sense that Frerin left this area to the
west.

The raithe Bhune is here.
There are exits east and west.

Anyone have any ideas? I've already tried using an array-type set up, and also tried something like:
#TRIGGER {You{ |$}... etc.
Reply with quote
LightBulb
MASTER


Joined: 28 Nov 2000
Posts: 4817
Location: USA

PostPosted: Sat Sep 25, 2004 2:14 am   
 
It's simple once you get over the idea that everything has to be in just one trigger. If you're concerned about being able to find all these triggers in the future, use a trigger class.
#CLASS Left
#TR {You sense that %w left this area to the %w.} {#CW white}
#TR {(You sense that %w left this area to the$%w.)} {#PCOL white %x1 1 0}
#TR {(You sense that %w left this area to$the %w.)} {#PCOL white %x1 1 0}
#TR {(You sense that %w left this area$to the %w.)} {#PCOL white %x1 1 0}
#TR {(You sense that %w left this$area to the %w.)} {#PCOL white %x1 1 0}
#TR {(You sense that %w left$this area to the %w.)} {#PCOL white %x1 1 0}
#TR {(You sense that %w$left this area to the %w.)} {#PCOL white %x1 1 0}
#TR {(You sense that$%w left this area to the %w.)} {#PCOL white %x1 1 0}
#TR {(You sense$that %w left this area to the %w.)} {#PCOL white %x1 1 0}
#TR {(You$sense that %w left this area to the %w.)} {#PCOL white %x1 1 0}
#CLASS 0
_________________
LightBulb
Senior member

Most scripts in this forum are written for Command Line entry.
Don't even open the Settings Editor unless its use is specified or obvious.
Reply with quote
saea
Newbie


Joined: 25 Sep 2004
Posts: 4

PostPosted: Sat Sep 25, 2004 3:31 am   
 
Heh, of course it would be so simple. Thanks, LightBulb! I'm using the code, but I'm trying to get it to work with a different colour - originally, I was going to use a hexidecimal code generated by the colour-picker, but when I use it, it seems to only colour one of the two lines, rather than both, and the other line is black. But on other simple colours, like red and white, it colours both. Any ideas as to why this is?
Reply with quote
nexela
Wizard


Joined: 15 Jan 2002
Posts: 1644
Location: USA

PostPosted: Sat Sep 25, 2004 11:54 am   
 
Some Variations to try

Are you trying it with $XXXXXX (the supported way) Or #XXXXXX

or #PCOL %colorname(#XXXXXX) //Also try with $

or any of the colornames in
#HELP %colorname
_________________
Zmud Support Library
Zmud Knowledge Base
Reply with quote
LightBulb
MASTER


Joined: 28 Nov 2000
Posts: 4817
Location: USA

PostPosted: Sat Sep 25, 2004 5:19 pm   
 
The original 16 colors (listed in the helptopic %color) are handled by a different routine than other colors. They are black, blue, green, cyan, red, magenta, brown, and gray plus the high (bright) versions of each. Yellow and white also work but these are just special names for high brown and high gray, respectively. Other colors only seem to work when they are limited to the same line and window as the trigger.

Further testing reveals that the script above actually ends the color-change at the end of the line instead of the end of the sentence. This revision should fix that but you'll still need to restrict your color choices to those listed in %color.
#CLASS Left2
#TR {You sense that %w left this area to the %w.} {#CW white}
#TR {(You sense that %w left this area to the)$(%w.)} {#PCOL white %x1 1 1;#PCOL white 0 %eval( %word( %x2, 2) - %word( %x1, 2) - 2) 0 0}
#TR {(You sense that %w left this area to)$(the %w.)} {#PCOL white %x1 1 1;#PCOL white 0 %eval( %word( %x2, 2) - %word( %x1, 2) - 2) 0 0}
#TR {(You sense that %w left this area)$(to the %w.)} {#PCOL white %x1 1 1;#PCOL white 0 %eval( %word( %x2, 2) - %word( %x1, 2) - 2) 0 0}
#TR {(You sense that %w left this)$(area to the %w.)} {#PCOL white %x1 1 1;#PCOL white 0 %eval( %word( %x2, 2) - %word( %x1, 2) - 2) 0 0}
#TR {(You sense that %w left)$(this area to the %w.)} {#PCOL white %x1 1 1;#PCOL white 0 %eval( %word( %x2, 2) - %word( %x1, 2) - 2) 0 0}
#TR {(You sense that %w)$(left this area to the %w.)} {#PCOL white %x1 1 1;#PCOL white 0 %eval( %word( %x2, 2) - %word( %x1, 2) - 2) 0 0}
#TR {(You sense that)$(%w left this area to the %w.)} {#PCOL white %x1 1 1;#PCOL white 0 %eval( %word( %x2, 2) - %word( %x1, 2) - 2) 0 0}
#TR {(You sense)$(that %w left this area to the %w.)} {#PCOL white %x1 1 1;#PCOL white 0 %eval( %word( %x2, 2) - %word( %x1, 2) - 2) 0 0}
#TR {(You)$(sense that %w left this area to the %w.)} {#PCOL white %x1 1 1;#PCOL white 0 %eval( %word( %x2, 2) - %word( %x1, 2) - 2) 0 0}
#CLASS 0
_________________
LightBulb
Senior member

Most scripts in this forum are written for Command Line entry.
Don't even open the Settings Editor unless its use is specified or obvious.
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