Register to post in forums, or Log in to your existing account
 

Play RetroMUD
Post new topic  Reply to topic     Home » Forums » CMUD General Discussion
kittyfish
Novice


Joined: 20 Sep 2011
Posts: 37

PostPosted: Tue Sep 20, 2011 3:04 am   

[3.34 AUTOMAPPER] How to detect a room name in SQUARE brackets?
 
How can I detect a room name in square brackets?

I read elsewhere that you need to go to Scripting preferences and turn off using [ ] to evaluate things, but that option has been removed - I searched within CMUD's own help and found an explanation titled "[] and <> syntax removed", saying "In the vast majority of cases, a zMUD script that uses [] can just remove the [] characters and it will work fine." implying that [] is still being "recognised" by CMUD for the sake of old scripts, even though it's not officially in use anymore - maybe removing the option to turn it off completely was a bit premature in that case?

I have tried making a trigger with pattern "^~[&{TrigRoomName}~]" that does "#TAG name @TrigRoomName" but it seems to have no effect.

What happens is the room gets saved with the description and exits, but it completely ignores the first line in square brackets and instead makes the first sentence of the description the room name instead. I checked map configuration and made sure room name was on and set to 0 (first) paragraph and 0 (first) line...

:(

Thank you for any help anyone at all!
Reply with quote
MattLofton
GURU


Joined: 23 Dec 2000
Posts: 4834
Location: USA

PostPosted: Tue Sep 20, 2011 3:58 am   
 
Quote:

I checked map configuration


I'll let you in on a little secret: the room name's not located at paragraph 0, it's actually the last paragraph (everything is determined by the prompt so the counting goes in reverse as you progress up into the scrollback buffer). ;)

Generally, as far as corrective configuration goes you want to ignore working with the Map Configuration window and just #tag your stuff. Aside from just being far easier and more straightforward, game designers seem to have this perverse phobia of standardization that stems from simple longterm development and a desire to add things via creative workarounds that aren't really all that supported by the codebase.

Now, there are two possible reasons why your trigger didn't work. The first is that there's nothing really wrong with your trigger but you just failed to activate it by running the reconfigure wizard. The second is that your trigger pattern is wrong and your trigger just plain isn't firing (the wrong part being the inclusion of {}, as this indicates a stringlist).
_________________
EDIT: I didn't like my old signature
Reply with quote
kittyfish
Novice


Joined: 20 Sep 2011
Posts: 37

PostPosted: Tue Sep 20, 2011 6:37 am   
 
Ok it seems to work kinda now thank you, but how do I make it not capture the []s around the name?

Just the name only without square brackets around the name?

I changed the pattern from "^~[&{TrigRoomName}~]" to "^~[&TrigRoomName~]" (with the action still being "#TAG name @TrigRoomName") and captures the room name but with the actual brackets around it still in the room's name, like [Room Name]

I'm wondering if maybe the Map > Configuration > Settings options with the Room Name might be interfering, but when I toggle off the tick box for Room Name entirely the same thing happens when I refresh the room (with "Action" > "Look (reload room info)") :(


Last edited by kittyfish on Tue Sep 20, 2011 2:56 pm; edited 1 time in total
Reply with quote
kittyfish
Novice


Joined: 20 Sep 2011
Posts: 37

PostPosted: Tue Sep 20, 2011 2:55 pm   
 
bump :(
Reply with quote
Arde
Enchanter


Joined: 09 Sep 2007
Posts: 605

PostPosted: Wed Sep 21, 2011 8:36 pm   
 
Does your trigger actually fire? Why not to did it as simple as "^~[(*)~]", comment out your #TAG line and temporary add there "#PRINT %concat("Entering room - ", %1)"
????
After you'll get you trigger to life, comment out debugging #PRINT... line and write "#TAG name %1". Reconfigure the mapper.

One more thing. Does your MUD use something like mxp tags for rooms? It would be way easier to configure the mapper then...
_________________
My personal bug|wish list:
-Wrong Priority when copy-paste setting
-1 prompt trigger for Mapper, Session and General Options, not 3 different!
-#SECTION can terminate threads
-Buttons can't start threads
Reply with quote
kittyfish
Novice


Joined: 20 Sep 2011
Posts: 37

PostPosted: Wed Sep 21, 2011 10:07 pm   
 
It doesn't seem to detect it, even when I change to only need prompt not newline, the weird thing is when I test it with [name] it says pattern matches :

Could you try discworld.imaginary.com port 23?

When you are on there you need to type "options output shortinlong=on" to turn on the room names in descriptions, it's off on there by default

I think something funky might be going on with MXP as you say, because there doesn't seem any reason to me why this room works with the tag but the following room does not:

[livingroom]
tagged
This is a comfortable livingroom. The south wall is papered with dragon print wallpaper, the floor is laid with antique oak in a parquet pattern and the other surfaces are covered with ocean blue paint. Sitting against the east wall is a large wood oven opposite which squats a large wooden chest. Squatting in the southwest corner is a golden ebony wood wardrobe to the left of which stands a cherry bookshelf. Near the golden ebony wood wardrobe is a tall wooden wardrobe. Hanging on the north wall is a pirate flag below which sits a deep blue armchair. Hanging on the west wall is a poster of the Circle Sea area. Standing in the northwest corner is a lava lamp. In front and to your right the kitchen door leads to a kitchen, in front of you the bedroom door leads to a bedroom and the front door leads out.
There are three obvious exits: out, forward and forward-right.

> ne
[kitchen]
This is a small kitchen. The floor is laid with antique oak in a parquet pattern, the east wall is papered with ginko leaf design wallpaper and the other surfaces are covered with forest green paint. Standing in the southeast corner is a wooden barrel on the left side of which stands a large wooden chest. Standing in the northwest corner is a cherry bookshelf on the right side of which stands a tall wooden wardrobe. Sitting in the northeast corner is a stone topped counter. Behind you the kitchen door leads to a livingroom.
There is one obvious exit: backward.
Reply with quote
Arde
Enchanter


Joined: 09 Sep 2007
Posts: 605

PostPosted: Thu Sep 22, 2011 8:53 am   
 
TMC says your mud is MXP-enabled. Go to the Options->General->MXP and turn on there "Debug MXP". Look at a room and check does your MUD send some room-specific tags.


For example, my MUD uses <RName>...</RName> tags pair and my room name trigger is just
Code:
<trigger name="trgMapperRoomName" type="MXP" priority="320" id="32">
  <pattern>RName</pattern>
  <value>#TAG name
</trigger>

It even capture room name automatically
_________________
My personal bug|wish list:
-Wrong Priority when copy-paste setting
-1 prompt trigger for Mapper, Session and General Options, not 3 different!
-#SECTION can terminate threads
-Buttons can't start threads
Reply with quote
kittyfish
Novice


Joined: 20 Sep 2011
Posts: 37

PostPosted: Thu Sep 22, 2011 4:14 pm   
 
no sadly mine is like this:

[Baker Street]<BR>
It is night and the last quarter moon is hidden by the clouds.<BR>
This is Baker Street. There seems to be a clearer-than-usual quality to the air here, and you can smell something refreshing on the breeze. To the south, Baker Street joins up with God Street, while to the north is more of Baker Street. A shop is to the west.<BR>
With few people about, this seems to be a quiet part of the city, perfect for getting mugged.<BR>
<Orange>It is a freezing cold spindlewinter's night with a steady breeze, dense cloud cover and light snow.<BR>
<Green>There are three obvious exits: <Exit>northwest</Exit>, <Exit>south</Exit> and <Exit>west</Exit>.<BR>
Melonhead the giant fruitbat is flying above the ground here and Rachelle is standing here.<BR>
A street lamp is emitting a grimy light here.<BR>
<dest Map></dest><BR>
> <!EN hp 0 publish><!EN xp 208482 publish><!EN gp 55 publish><!EN maxhp 500 publish><!EN maxgp 55 publish>nw
[Baker Street]<BR>
It is night and the last quarter moon is hidden by the clouds.<BR>
This is another segment of Baker Street. It's not the cleanest place in the world. In fact, it's pretty messy, much like the rest of Ankh-Morpork. The bricks in the buildings seem to cling to the dirt.<BR>
With few people about, this seems to be a quiet part of the city, perfect for getting mugged.<BR>
<Orange>It is a freezing cold spindlewinter's night with a steady breeze, dense cloud cover and light snow.<BR>
<Green>There are two obvious exits: <Exit>north</Exit> and <Exit>southeast</Exit>.<BR>
A happy troll is standing here.<BR>
A street lamp is emitting a grimy light here and a tiny waxed paper packet is on the ground.<BR>
<dest Map></dest><BR>
> <!EN hp 0 publish><!EN xp 208488 publish><!EN gp 55 publish><!EN maxhp 500 publish><!EN maxgp 55 publish>n
[Baker Street]<BR>
It is night and the last quarter moon is hidden by the clouds.<BR>
This is a part of Baker Street to the south of Filigree Street and to the north of God Street. The high wall of Thee Olde Morpork Skyttle Clubbe looms over you to the west, while to the east are just more run-down houses.<BR>
With few people about, this seems to be a quiet part of the city, perfect for getting mugged.<BR>
<Orange>It is a freezing cold spindlewinter's night with a steady breeze, dense cloud cover and light snow.<BR>
<Green>There are three obvious exits: <Exit>north</Exit>, <Exit>south</Exit> and <Exit>east</Exit>.<BR>
A watchman is standing here.<BR>
A plaque is on the east wall and a street lamp is emitting a grimy light here.<BR>
<dest Map></dest><BR>
> <!EN hp 0 publish><!EN xp 208491 publish><!EN gp 55 publish><!EN maxhp 500 publish><!EN maxgp 55 publish>e
Queued command: e<BR>
> <!EN hp 0 publish><!EN xp 208491 publish><!EN gp 55 publish><!EN maxhp 500 publish><!EN maxgp 55 publish>
<!EN sp 89 publish><!EN maxsp 89 publish>You ghost through the east door.<BR>
[front room]<BR>
This is a small hallway. The floor is apple white short-pile carpet and the other surfaces are covered with slate grey paint. In the centre of the front room is a low bamboo table. Against the west wall is a spandrelled clothes rack opposite which is a Queen Ptraci wardrobe. Against the south wall is a large ash table facing which is a wooden rain barrel. On the large ash table is a large blue bottle. Near the wooden rain barrel is a pile of white and blue cotton cushions. In front of you the livingroom door leads to a livingroom and the front door leads out.<BR>
<Green><EXPIRE Exits>There are two obvious exits: <Exit>out</Exit> and <Exit>forward</Exit>.<BR>
<dest Map></dest><BR>
e
[livingroom]<BR>
This is a comfortable livingroom. The floor is mint green deep-pile carpet, the ceiling is covered with snowdrop white paint and the other surfaces are covered with mint cream paint. Against the west wall is a tall black bookshelf facing which is an antique rose-pattern wardrobe. In the centre of the livingroom is a black textile covered sofa near which is a low pine table. Hanging from the east wall is a painting of the Ramtops. Against the south wall is a low glass table facing which is a grotesque ebony handchair. An exit leads up and behind you the hallway door leads to a front room.<BR>
<Green><EXPIRE Exits>There are two obvious exits: <Exit>backward</Exit> and <Exit>up</Exit>.<BR>
<dest Map></dest><BR>
> <!EN hp 0 publish><!EN xp 208500 publish><!EN gp 55 publish><!EN maxhp 500 publish><!EN maxgp 55 publish>



the backwards/forward/left/right/forward-left/forward-right/backward-left/backward-right directions you get in houses also seem to confuse the mapper making it randomly add direction tendrils
Reply with quote
kittyfish
Novice


Joined: 20 Sep 2011
Posts: 37

PostPosted: Tue Sep 27, 2011 7:30 am   
 
bump :(
Reply with quote
kittyfish
Novice


Joined: 20 Sep 2011
Posts: 37

PostPosted: Fri Sep 30, 2011 11:19 pm   
 
please anyone I am not really a programmy person but I am trying to do my best :(

I made a support ticket and they just ignore it
Reply with quote
kittyfish
Novice


Joined: 20 Sep 2011
Posts: 37

PostPosted: Tue Oct 04, 2011 5:06 pm   
 
Please anyone? :(
Reply with quote
MattLofton
GURU


Joined: 23 Dec 2000
Posts: 4834
Location: USA

PostPosted: Tue Oct 04, 2011 7:50 pm   
 
Your trigger is the way to do it. If your trigger is firing, then either you did NOT run the reconfigure wizard (as was pointed out to you in my original post) so that the mapper could be made aware of that #tag, or there's something else (ie, MXP) interfering.
_________________
EDIT: I didn't like my old signature
Reply with quote
Arde
Enchanter


Joined: 09 Sep 2007
Posts: 605

PostPosted: Tue Oct 04, 2011 10:05 pm   
 
Have read your messages in this thread and got an idea.
Let me guess... Does your room trigger fire after a n/e/w/s movement command and doesn't fire after diagonal movement?
_________________
My personal bug|wish list:
-Wrong Priority when copy-paste setting
-1 prompt trigger for Mapper, Session and General Options, not 3 different!
-#SECTION can terminate threads
-Buttons can't start threads
Reply with quote
kittyfish
Novice


Joined: 20 Sep 2011
Posts: 37

PostPosted: Thu Oct 06, 2011 6:16 pm   
 
I think it's probably best if you see it yourself I'm not really good at working out what's wrong it works sometimes outside I think it might be because in the player houses it has left/right/forward/back instead of north/east/south/west ?

I literally cannot get room names to match anywehre though and always square brackets everywhere no way to filter out i seems
Reply with quote
kittyfish
Novice


Joined: 20 Sep 2011
Posts: 37

PostPosted: Sun Oct 09, 2011 9:29 pm   
 
please anyone :(
Reply with quote
MattLofton
GURU


Joined: 23 Dec 2000
Posts: 4834
Location: USA

PostPosted: Sun Oct 09, 2011 11:37 pm   
 
I just tried your trigger, and it worked just fine.

1)#trigger {^~[&roomname~]$} {#tag name @roomname}
2)run the reconfigure wizard
3)start mapping

You will indeed need to handle the orange weather text, as it appears the mapper doesn't capture descs when it happens, but otherwise if you're having difficulty then you either have an unhandled nomap/nodir situation that clogs up the mapper queue or Discworld has a bug or typo that needs fixing.
_________________
EDIT: I didn't like my old signature
Reply with quote
kittyfish
Novice


Joined: 20 Sep 2011
Posts: 37

PostPosted: Wed Oct 12, 2011 7:51 pm   
 
for some reason when using that trigger it detects ok when I use reconfigure wizard, highlights room name in blue, description green exits red etc and the room looks ok, it even has the name in the room name without the square brackets and the room description in there properly, as well as the weather! (this is actually good to have in the saved room description since on Discworld rooms can look different depending on what season it is)

BUT as soon as I try make a new room normally outside of the reconfigure wizard, it just doesn't detect anything at all, no new room, whatsoever. I tried making a #nomap trigger for the weather just in case since you mentioned that, but that made no difference :(


without the room name trigger as reconfigured before it does detect rooms and their room descriptions, and if I go to Configure (manually) and tick the Room name box and set it to Paragraph 0 Line 0 it detects room names, but with every room name in square brackets, and as mentioned before just failing to detect rooms sometimes when inside houses with exits that are in a nonstandard format (left right etc) or places that have shorter descriptions :(
Reply with quote
Rahab
Wizard


Joined: 22 Mar 2007
Posts: 2320

PostPosted: Wed Oct 12, 2011 8:27 pm   
 
A suggestion: try using one of those problem rooms as the room you enter when doing the reconfigure. Sometimes the configuration created from a standard room does not work when tried on a less standard room. I've solved several mapping problems that way. This can help as long as the non-problem rooms are a more generalized form of the problem rooms.

Do your #TAG triggers work on the non-standard rooms? Or do you have separate #TAG triggers specifically for problem rooms? It seems likely to me that the configuration wizard will only notice #TAG triggers that actually apply to the room being examined by the wizard, so separate #TAG triggers for different situations might not work. Not sure about that, though.
Reply with quote
kittyfish
Novice


Joined: 20 Sep 2011
Posts: 37

PostPosted: Sat Oct 22, 2011 4:48 am   
 
:(
Reply with quote
Anaristos
Sorcerer


Joined: 17 Jul 2007
Posts: 821
Location: California

PostPosted: Sat Oct 22, 2011 10:38 am   
 
This works for me:
Code:

<trigger name="pattrig" priority="10280" regex="true" id="1028">
  <pattern>^\[([^\]]+)\]$</pattern>
  <value>#TAG name %1</value>
</trigger>

Give this a try.
_________________
Sic itur ad astra.
Reply with quote
Display posts from previous:   
Post new topic   Reply to topic     Home » Forums » CMUD 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