|
VgWizard14 Beginner
Joined: 30 Nov 2008 Posts: 14
|
Posted: Sun Nov 30, 2008 3:18 pm
A Problem involving #TRIGGER |
Quote: |
Stinging sand swirls around you.
Caravan Road [ESW]
Stretching itself out here is a long road, paved in rough yellowy
brown sandstone, covered with reddish dust and sand, and wide enough that at
least four caravans could pass through. The sun-browned backs of slaves
march along, carrying goods. The sky's blood-red glory shines from above
the main gate, highlighting its ominously smooth stones.
To the south, a large wagonyard is filled with activity.
A human soldier of Tektolnes walks along here.
A half-giant soldier of Tektolnes walks along here.
A human soldier of Tektolnes walks along here.
A half-giant soldier of Tektolnes walks along here.
A half-giant soldier of Tektolnes walks along here.
A half-giant soldier of Tektolnes walks along here.
A half-giant soldier of Tektolnes walks along here.
A half-giant soldier of Tektolnes walks along here.
A half-giant soldier of Tektolnes walks along here.
121/121hp 115/115stun 126/138stam sirihish walking >
|
My Issue is this. The "Stinging sand swirls around you" occurs seemingly at random before the area name (as well as other strings of text.) Because of this addition, automapping the MUD I'm in (Armageddon) is becoming difficult and frustrating.
My goal to work around this was simply to make a set of triggers to acquire the area name, desc. and exits.
What I have is this:
Code: |
#TRIGGER {(*) ~[*~]} {#TAG name %1}
#TRIGGER {~[(*)~]} {#TAG exit %1}
|
I let the automapper do it's own thing with the description.
Here's where my problem kicks in. If left completely alone and reconfigured, automapper acquires the "Stinging Sand" bit as the area name, acquires the exits normally (though with an extra bracket at the end) and gets the description correct.
With the above code, the phrase "Caravan Road [ESW]" is considered the exit, the area name is nowhere to be shown, and the description includes everything but "Caravan Road [ESW]" (Which may or may not be a good thing as of yet.)
My guess is there's a problem with the second line of code. If I remove it, everything (but acquiring the exit) works perfectly.
Thank you in advance :) |
|
|
|
charneus Wizard
Joined: 19 Jun 2005 Posts: 1876 Location: California
|
Posted: Sun Nov 30, 2008 5:08 pm |
First of all, consolidate the two triggers. If the room name always happens on the same line as the exits, then use:
#TRIGGER {(*) ~[(*)~]} {#TAG name %1;#TAG exit %2}
Second, adding this trigger may help quite a bit:
#TRIGGER {^Stinging sand swirls around you.} {#NOMAP}
Hope that helps.
Charneus |
|
|
|
Fang Xianfu GURU
Joined: 26 Jan 2004 Posts: 5155 Location: United Kingdom
|
Posted: Sun Nov 30, 2008 6:11 pm |
Also, is the room name always a certain colour? If so, you can use an ANSI trigger to further reduce the number of lines it'll match and hopefully eliminate some false positives.
|
|
|
|
VgWizard14 Beginner
Joined: 30 Nov 2008 Posts: 14
|
Posted: Sun Nov 30, 2008 8:39 pm |
Adding "#TRIGGER {^Stinging sand swirls around you.} {#NOMAP}" may very well be a nice temporary fix, but several lines can occur before the name of the map, not just "Stinging sand swirls around you." I thought I made that clear. For this to be truely helpful, I'd have to play through the game and discover EVERY line that could possibly go above the room name, assuming they don't change anything / it isn't randomized.
Yes, consolidating the triggers into one would work. I just separated them for the sake of ease. The room name shows up right before the exits constantly. Just to make sure, I tested the consolidated trigger and got the same result as above (Name and exits are considered exits, rest is description.)
Still require help..!
EDIT: Nearly forgot. Everything's white, making color matching impossible.
EDIT2: Gah, this is what I get for doing this as soon as I awaken. for using both sets of triggers (consolidated and not), the "swirling sands..." is colorless, the actual room name and exits are red, and the rest is green (the prompt's a different color) |
|
|
|
Fang Xianfu GURU
Joined: 26 Jan 2004 Posts: 5155 Location: United Kingdom
|
Posted: Mon Dec 01, 2008 1:28 am |
This is good news. You could try using a regex (not a zScript pattern) like:
^(.+?) [([nesw]+)]$
As for the colour, check the ANSI trigger box on a trigger and copy the room description text into the pattern box. You'll see something like %e[38m at the start - the number might be different, and might have semicolons in. Copy that into the pattern between the ^ and the (.+?) and, with the ANSI trigger option checked, you should be good.
EDIT: The forums are eating some of the pattern - quote my post to see what it should look like. |
|
|
|
|
|
|
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
|
|