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


Joined: 07 Nov 2012
Posts: 3

PostPosted: Wed Nov 07, 2012 3:34 am   

automapper problem, v7.21
 
Hi Guys,

Been trying to get the automapper going on Crimson 2 mud for a few days now with no luck, anyone able to give me a hand?

Quote:
Inside a corner of the fence.
You are at the corner of the snotling camp.There is grass on the ground,
and the fence is looking rather unsafe...typical snotling construction.
A malicious looking snotling soldier is standing here.
A sickly little snotling dragon is sitting here.

<5894662>xp r[14301] [H1022 M494 V413] ex[N E] >n

Along the inside of the fence.
You are standing next to the shakily built fence surrounding the camp. The
grass on the ground is looking very trampled and is dying away.You can see
a number of tents, constructed to varying degrees of imperfection, most
looking as if a strong wind could blow them over.

<5894662>xp r[14328] [H1022 M494 V411] ex[N E S] >n

Along the inside of the fence.
You are standing next to the shakily built fence surrounding the camp. The
grass on the ground is looking very trampled and is dying away.You can see
a number of tents, constructed to varying degrees of imperfection, most
looking as if a strong wind could blow them over.
An insane snotling madboy is here gibbering senslessly.

<5894662>xp r[14327] [H1022 M494 V409] ex[N E S] >w
Alas, you cannot go that way...

<5894662>xp r[14327] [H1022 M494 V409] ex[N E S] >


To make things easier (maybe?) I have ANSI turned on and the following color codes are used.
Room Name: %e[36m
Room Desc: %e[1;34m
vNum (r[xxxxx]): %e[1;31m
Exits: %e[35m

Mobs standing in the room appear right below the description without a blank line, but they appear in green (no ansi code). To be completely honest, I don't care if they get included in the room description but if they can be excluded even better.

Thanks in advance to anyone who can help!
Reply with quote
shalimar
GURU


Joined: 04 Aug 2002
Posts: 4692
Location: Pensacola, FL, USA

PostPosted: Wed Nov 07, 2012 6:03 am   
 
hmm... did you check 'room descriptions change' in the configuration settings?
that will help it to not care if mobs are in the room or not.
_________________
Discord: Shalimarwildcat
Reply with quote
MattLofton
GURU


Joined: 23 Dec 2000
Posts: 4834
Location: USA

PostPosted: Wed Nov 07, 2012 6:35 pm   
 
Nah, don't do that. Setting that option means any unhandled mismovements always create new rooms as the mapper basically stops verifying for existing rooms. Since you have easily identifiable room info based on ansi color, I would use a multistate trigger with two states (pattern for the room name, within 1 lines for the room desc) and a separate trigger for the prompt.

#trigger "tRoomNameDesc" {^%e[36m(*)%e[0m$} {#noop make sure to turn ansi on for this state;RoomName = %1;RoomDesc = ""}
#condition {^%e[1;34m(*)%e[0m$} {#noop make sure to turn ansi on for this state;#additem RoomDesc %1;#state tRoomNameDesc 1} {withinlines|param=1}

#trigger {^<(%d)>xp r~[(%d)~] ~[H(%d) M(%d) V(%d)~] ex~[([%sNEWSUD])~] >} {#noop ansi not needed for this trigger;#tag name @RoomName;#tag desc %expandlist(@RoomDesc,%cr);#tag vnum %2;#tag exit %6} {nocr|prompt}

I forget if %expandlist() is available in ZMud or not. If not, you might be able to replace it with %replace(@RoomDesc,"|",%cr). Don't forget to run the reconfigure wizard to have the mapper use these triggers.
_________________
EDIT: I didn't like my old signature
Reply with quote
darkscis
Newbie


Joined: 07 Nov 2012
Posts: 3

PostPosted: Thu Nov 08, 2012 1:09 am   
 
Thanks Matt for your superb help! With a little bit of tweeking I got it working perfectly for Room Name, Exits and vNum. Unfortunately it only picks up the first word of each line in the description, which I believe according to this https://zuggsoft.com/forums/viewtopic.php?p=153032 is due to repeat within lines not working for #COND. I am happy with that however, as it still grabs enough of the desc (and no wandering mobs) to verify the room when I am walking around. This is enough to get everything mapped fine!
Reply with quote
MattLofton
GURU


Joined: 23 Dec 2000
Posts: 4834
Location: USA

PostPosted: Thu Nov 08, 2012 2:34 am   
 
Umm, that link is for a trigger option called Repeat Within Line, which means you can write a simple pattern and have that pattern match multiple times on the same line. This feature does not exist in ZMud, and even if it did it would have no bearing whatsoever on this discussion. The withinlines reference is for a trigger state type, which does in fact exist and works perfectly fine in ZMud.

As for only capturing the first word, that was a mistake on my part. In ZMud, system variables like %1 are preprocessed so that they can be inserted into the script code before the script code then gets executed. This means that there then is no real way to tell where one parameter for a command starts and another begins (ZMud divides everything via the space character). To work around this, you put the variable reference inside quotes like so: #additem RoomDesc "%1". Do that and you should magically start capturing the entire description.
_________________
EDIT: I didn't like my old signature
Reply with quote
darkscis
Newbie


Joined: 07 Nov 2012
Posts: 3

PostPosted: Thu Nov 08, 2012 6:32 am   
 
Works perfectly! Once again, thanks for your help Very Happy
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