![](templates/Classic/images/spacer.gif) |
Neo2121 Beginner
Joined: 28 Dec 2006 Posts: 12
|
Posted: Thu Dec 28, 2006 9:10 am
Achaea ansi colour-based triggers? |
One annoying thing in achaea is that ther's no linebreak between the room description and different items/ppl that exist in the room. What i'm tryin to do is grab the whole room desc+items+ppl etc and divide it up based on what ansi colour the text is..
Is ther a way to make a trigger that looks for different colour texts? like put yellow text in one variable, put white in another etc?
The mud output is like this:
Code: |
<green>Junction of Moon street and Old road.
<white>You stand in the very centre of Moon Street. To your east lies the aptly named Old Road, the oldest road in Hashan, which leads towards the alleyway between the northern and Central Plaza. To the south Moon street continues onwards into the hazy mist which seems to spring up out of nowhere, slightly impairing your vision. To the east you can now hear clearly the noise from the Plaza bouncing down the Old Road's narrow walls. It is rumoured that the Cult of the SerpentLords lies around this part of the town, although no-one has lived to spread the news of its location. <gray>A sprig of mistletoe has been hung here. A rune resembling a horse has been sketched into the ground here. Liirup the Placid stands here, placidly. A cute little humgii is sitting here placidly, attached to a leash. A runic totem is planted solidly in the ground. <light blue>Kelsor is standing here wielding a mop. |
the things in brackets <> aren't really in the output i just put them ther to show wher the colour changes.. [/code] |
|
|
![](templates/Classic/images/spacer.gif) |
Fang Xianfu GURU
![](images/avatars/1763170544a2093e7e85da.gif)
Joined: 26 Jan 2004 Posts: 5155 Location: United Kingdom
|
Posted: Thu Dec 28, 2006 3:22 pm |
CMUD has a line colour option for triggers that's very easy to use. zMUD has a similar line=## parameter for triggers that sets them off on line colours (you then just use a trigger * to match anything). You can also use the ANSI option - %e matches the escape character, and then the list of ANSI colour codes to create a trigger on the ANSI control code for the colour.
Once you've got the trigger, you use the #TAG command to tell the mapper which bits are what. |
|
|
![](templates/Classic/images/spacer.gif) |
Neo2121 Beginner
Joined: 28 Dec 2006 Posts: 12
|
Posted: Thu Dec 28, 2006 3:29 pm |
Hmm I'm gonna try that now
what in trying to do is grab the part that lists items and put it in a variable so i can insert linebreaks after each item and make it look more readable so it's like
<description bla bla bla>
A sprig of mistletoe has been hung here.
A rune resembling a horse has been sketched into the ground here.
Liirup the Placid stands here, placidly.
A cute little humgii is sitting here placidly, attached to a leash.
A runic totem is planted solidly in the ground.
Kelsor is standing here wielding a mop.
like it's on most circle-based muds.. way simpler 2 read when you're in a hurry, and i can make different scripts to show|hide different stuff like runes and such.. (when you're a newb or ratting or whatever you dont reaaly need to see 100 descriptions of every rune, totem, guard etc that is standing in each room..) |
|
|
![](templates/Classic/images/spacer.gif) |
Fang Xianfu GURU
![](images/avatars/1763170544a2093e7e85da.gif)
Joined: 26 Jan 2004 Posts: 5155 Location: United Kingdom
|
Posted: Thu Dec 28, 2006 3:39 pm |
I use a multi-state trigger to capture rooms, like so:
#trigger {*} {#tag name} //line colour set to room name line
#cond {*} {#tag exit} //line colour set to exit line
You could insert a #T+ command in the first trigger state to activate a trigger that uses #sub to change ". " into ".%cr ". |
|
|
![](templates/Classic/images/spacer.gif) |
Neo2121 Beginner
Joined: 28 Dec 2006 Posts: 12
|
Posted: Thu Dec 28, 2006 3:41 pm |
omg i never thought of that *slaps himself on the head multiple times*
|
|
|
![](templates/Classic/images/spacer.gif) |
Fang Xianfu GURU
![](images/avatars/1763170544a2093e7e85da.gif)
Joined: 26 Jan 2004 Posts: 5155 Location: United Kingdom
|
Posted: Thu Dec 28, 2006 3:43 pm |
I forgot to mention the matching #T- in the exits to turn it off :)
|
|
|
![](templates/Classic/images/spacer.gif) |
Neo2121 Beginner
Joined: 28 Dec 2006 Posts: 12
|
Posted: Thu Dec 28, 2006 6:45 pm |
bloody hell i cant seem 2 get it to work, ther's no new line between the white part and the gray part.. so that whole line starts with white.. maybe that's messin with it *shrug*
|
|
|
![](templates/Classic/images/spacer.gif) |
|
|