|
Keoteka Beginner
Joined: 06 Sep 2004 Posts: 10
|
Posted: Sun Mar 20, 2005 1:44 am
Room Description matching inside a trigger |
ok on my mud as i said in a previous post it will put the room name after the prompt without a linefeed
i.e.
* HP:Healthy MV:Strong > Bend in the Road
I got a trigger working to split it, but when it splits it, the mapper doesn't match the room description.
trigger i use is as follows
#tri {(?) HP:(%w) MV:(%w) > (*)} {#subst {%1 HP:%2 MV:%3 > %{cr}%4}} {notrig}
How can i get the mapper to try and match %4 as the room name? Is the fact that I have Trigger on Trigger turned off making %4 not be parsed?
Keo
Keo |
|
|
|
Spartacus Wanderer
Joined: 23 Apr 2001 Posts: 53 Location: USA
|
Posted: Sun Mar 20, 2005 6:58 am |
You need to add:
To your trigger action.
But if your map was created with all that other stuff in the room names, you may have to go through and remap it or correct it. You might be able to script it if you have a lot of rooms like that. |
|
_________________ Spartacus
rm -rf .* |
|
|
|
Keoteka Beginner
Joined: 06 Sep 2004 Posts: 10
|
Posted: Sun Mar 20, 2005 11:08 am |
I got it mapped properly, what i am having trouble with is when that line is split the #find command doesn't work and i have to do it multiple times to find the room i'm in because it doesn't recognize the room inside that trigger.
keo
p.s. as i mapped i had a macro for #look so i checked every room as it was made to make sure it was ok....pain in the butt, but it worked hehe |
|
|
|
Spartacus Wanderer
Joined: 23 Apr 2001 Posts: 53 Location: USA
|
Posted: Mon Mar 21, 2005 5:45 pm |
If %4 matches the room name in your maps (case sensitive, very strict match) then adding #TAG name {%4} should make #Find work for you. If it doesn't, then you probably need to turn off the mapper's room name parsing (in the mapper window, select cong->configuration settings, then under properties, select configuration->room name and uncheck the very first check box - at least, that's how you do it on v7.05 - not sure if it's changed, this is the first version I've used the mapper for). The #TAG command will work in both mapping and follow mode, so if your #trigger matches every room name you see, then your mapper should work right regardless of mode.
Another benefit to doing this is that you can assign %4 to a variable and then use that variable (I call mine @RoomName) as the basis for a #find replacement that does not require looking - after all, we already know the RoomName, if we haven't moved, why look for it again? That just creates spam. Here's that alias - note that I use room exits and description in my matching - you would need to capture this or eliminate that. Lots of possibilities here.
Code: |
#var MatchedRooms {%mapquery( {[NAME] = '@RoomName'})} _nodef Mapping
#if %numitems( @MatchedRooms)=0 {#echo No matching rooms in map.} {#if %numitems( @MatchedRooms)=1 {#TELE @MatchedRooms} {#forall @MatchedRooms {#if %replace( @RoomDesc, " ", "")=%replace( %roomdesc( %i), " ", "") {#tele %i}}}} |
|
|
_________________ Spartacus
rm -rf .* |
|
|
|
Keoteka Beginner
Joined: 06 Sep 2004 Posts: 10
|
Posted: Fri Mar 25, 2005 3:21 pm |
anyway i can tag room name only if %4 starts with a capital letter?
Keo |
|
|
|
MattLofton GURU
Joined: 23 Dec 2000 Posts: 4834 Location: USA
|
Posted: Sat Mar 26, 2005 2:26 am |
#if (%proper(%4)) {#TAG name {%4}} {#message %concat(%4," -- not a room name")}
I added that last block just so you can see what wrong thing it's firing on. If you don't care about those, you can take it out unless your mud has room names that sometimes don't follow guidelines (ie, don't end in a period, aren't properly capitalized, etc). |
|
_________________ EDIT: I didn't like my old signature |
|
|
|
|
|