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
Keoteka
Beginner


Joined: 06 Sep 2004
Posts: 10

PostPosted: 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
Reply with quote
Spartacus
Wanderer


Joined: 23 Apr 2001
Posts: 53
Location: USA

PostPosted: Sun Mar 20, 2005 6:58 am   
 
You need to add:

Code:
#TAG name {%4}


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 .*
Reply with quote
Keoteka
Beginner


Joined: 06 Sep 2004
Posts: 10

PostPosted: 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
Reply with quote
Spartacus
Wanderer


Joined: 23 Apr 2001
Posts: 53
Location: USA

PostPosted: 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 .*
Reply with quote
Keoteka
Beginner


Joined: 06 Sep 2004
Posts: 10

PostPosted: Fri Mar 25, 2005 3:21 pm   
 
anyway i can tag room name only if %4 starts with a capital letter?

Keo
Reply with quote
MattLofton
GURU


Joined: 23 Dec 2000
Posts: 4834
Location: USA

PostPosted: 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
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