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


Joined: 07 Dec 2009
Posts: 9

PostPosted: Fri Dec 18, 2009 9:46 pm   

Mapping Aardwolf
 
If anyone out there can spend a little time helping me configure the mapper for Aardwolf I'd greatly appreciate it - I've been tinkering with it to display descriptions but have only gotten frustrated.
I first tried auto-configure and could get the map to follow me around, but the room name and description didn't pass along any useable info. I suspect this is due to Aardwolf's in house map.
This is the mud output:

Academy Courtyard
{coords}-1
Your first glimpse of the academy courtyard leaves you with the impression of
grandeur and sartorial splendor. Trees dot the courtyard, casting shade
across the grass and flagstone paths. The path beneath your feet leads north
around the gurgling fountain, and south to the outside world. If you're new
to the Realm, you should head north to begin your lessons.



--- ---
|. . . . . .|
--- ---
, ` . . (X) . . , `
--- ---
|. . .#. .*.|
--- ---
|[!]|
| |
|<*.|
---



[Exits: north east south west]

[174/174hp 168/168mn 512/515mv 0qt 517tnl] >
{stats}17/15,17/16,19/14,16/15,15/12,13/12,100,100,99,27,23,You are Standing.,9999,174/174,168/168,512/515,187567,0,0,0,517,2,5

This is the room info in the CMud map under the room's properties:
ID: 2 |<*.|
|<*.|
(nothing is listed under 'description')

I played around changing the map configuration settings in CMud (I changed where the line and description started and such, and I got the room name to be 'Academy Courtyard' in the description area, but that is the room name, not the description, and I could not get anything to show when the mouse scrolled over the room other than the room ID number. I tried mapping with Aardwolf's map tags turned off, but that didn't seem to do anything. It's quite frustrating, as I don't know where the hell I am. Also, the map wouldn't follow consistently - I'd move to a new room and the new room wouldn't always get created.

I deleted the old map and started fresh, but I'm looking for guidance before I proceed. Thanks for any help!
Reply with quote
MattLofton
GURU


Joined: 23 Dec 2000
Posts: 4834
Location: USA

PostPosted: Sat Dec 19, 2009 2:55 am   
 
Turn on the rest of the room tags:

TAG ROOMNAMES ON
TAG ROOMDESCS ON
TAG EXITS ON

From there, just make triggers to handle the tags. {rname} and {exits} will be easy, because they appear on the same line as the visible text. For {rdesc} and {/rdesc} use a 2-state multistate trigger using a manual state:

#trigger "trdesc" {^~{rdesc~}$} {rdesc = ""}
#condition {(*)} {
#if (%1 = "{/rdesc}") {
#tag desc %replace(@rdesc,"|",%cr)
#state trdesc 0
} {rdesc = %additem(%1,@rdesc)}
} {manual}
_________________
EDIT: I didn't like my old signature
Reply with quote
Zygote
Newbie


Joined: 07 Dec 2009
Posts: 9

PostPosted: Sun Dec 20, 2009 2:21 am   
 
I'm not following how this is going to get the description into the map. I tried using the description trigger and it showed the description but only in the settings window. I guess I'm a little confused on how and where to implement these scripts. Ultimately I'd like to get the auto mapper configured correctly and walk around in map mode.
Reply with quote
MattLofton
GURU


Joined: 23 Dec 2000
Posts: 4834
Location: USA

PostPosted: Sun Dec 20, 2009 4:00 am   
 
To implement, you have two choices dependant on what you are given:

1)code you can copy-paste to the command line (short scripts) or to the text editor (very long, complex, or bulky scripts). It looks a lot like what I gave you, but it can also look like a bunch of XML. You just copy it, paste to the commandline/editor, and then hit enter/send. The parser will handle everything else, but it's a good idea to look over things to ensure accuracy (for example, if a trigger pattern included a variable then you probably wouldn't want to have the parser expand that variable and create the trigger with the variable contents)

2)notational GUI reference. In this fashion, I tell you what fields to paste code/set values and then you do so from the Package Editor, for example:

trigger pattern: this is a what you paste
trigger code: this is what you want the trigger to do
trigger on newline: on

With regards to the mapper, you either rely on the internal mapper logic (the Configuration Properties) to pick out your data or you use #TAG triggers. #TAG triggers allow you to override the internal mapper logic and tell the mapper what bits of info to use for what purpose. Either way, you have to run the Configuration Wizard to start the process.

Now, if you're lucky enough to have CMud automatically and perfectly detect your room data then, great! You're done with the process and can move on to exploration or whatever other task you wanted to do next.

The rest of us, however, need to build our #TAG triggers. For Aardwolf, we have a bunch of room-info tags that we can use to make trigger detection a whole more useful:

{rname}room name goes here
{coords}coordinate numbers are here
{rdesc}
room desc goes here. It can be formated in any style.

It can be many paragraphs long, and contain any printable character (ie, ascii art).

Or it can be nothing at all.
{/rdesc}
{exits}[Obvious exits: north south east west up down other]
{roomobjs}
all the item descriptions go here.
{/roomobjs}
{roomchars}
A mob is doing something interesting.
Player with annoying and/or funny post title text is here.
{/roomchars}

1)room name and coords trigger that I use (removes the special room tags like (G) and tacks on coordinate info in parentheses--(0,zone name from the map) when in a non-continent zone and (0,29,20) when on the continents)
Code:

<trigger priority="10" ansi="true" id="16">
  <pattern>^%e~[37m~{rname~}(%e~[[%d;]m)(*)%e~[0m(*)$</pattern>
  <value><![CDATA[#gagspace
Rname = %stripansi(%2)
#if (%pos("(G)",@Rname)) {Rname = %remove("(G)",@Rname)}
#if (%pos("[**> PK <**]",@Rname)) {Rname = %remove("[**> PK <**]",@Rname)}
#if (%pos("[**> CMAZE <**]",@Rname)) {Rname = %remove("[**> CMAZE <**]",@Rname)}
#tag name @Rname
]]></value>
  <trigger>
    <pattern>^~{coords~}([%d~,-])</pattern>
    <value>#nomap
#local $x $y $notes
Rcoords.x = ""
Rcoords.y = ""
#if (%1 != "-1") {#call %match(%1,"(%d),(%d),(%d)",@Rcontinent,$x,$y)}
#switch (%zonename() = "The Continent of Mesolar") {
    Rcoords.x = $x
    Rcoords.y = $y
    #if (%concat("0,",$x,",",$y) != %roomnote()) {
      //#location @FindRoomByCoords("The Continent of Mesolar")
    }
    #sub %concat(%t1,%t2,%ansi(8)," (",@Rcontinent,",",@Rcoords.x,",",@Rcoords.y,")")
  }
  (%zonename() = "The Southern Ocean") {
    Rcoords.x = $x
    Rcoords.y = $y
    #if (%concat("1,",$x,",",$y) != %roomnote()) {
      //#location @FindRoomByCoords("The Southern Ocean")
    }
    #sub %concat(%t1,%t2,%ansi(8)," (",@Rcontinent,",",@Rcoords.x,",",@Rcoords.y,")")
  }
  (%zonename() = "Gelidus") {
    Rcoords.x = $x
    Rcoords.y = $y
    #if (%concat("2,",$x,",",$y) != %roomnote()) {
      //#location @FindRoomByCoords("Gelidus")
    }
    #sub %concat(%t1,%t2,%ansi(8)," (",@Rcontinent,",",@Rcoords.x,",",@Rcoords.y,")")
  }
  (%zonename() = "The Dark Continent, Abend") {
    Rcoords.x = $x
    Rcoords.y = $y
    #if (%concat("3,",$x,",",$y) != %roomnote()) {
      //#location @FindRoomByCoords("The Dark Continent, Abend")
    }
    #sub %concat(%t1,%t2,%ansi(8)," (",@Rcontinent,",",@Rcoords.x,",",@Rcoords.y,")")
  }
  (%zonename() = "Alagh, the Blood Lands") {
    Rcoords.x = $x
    Rcoords.y = $y
    #if (%concat("4,",$x,",",$y) != %roomnote()) {
      //#location @FindRoomByCoords("Alagh, the Blood Lands")
    }
    #sub %concat(%t1,%t2,%ansi(8)," (",@Rcontinent,",",@Rcoords.x,",",@Rcoords.y,")")
  }
  (%zonename() = "The Uncharted Oceans") {
    Rcoords.x = $x
    Rcoords.y = $y
    #if (%concat("5,",$x,",",$y) != %roomnote()) {
      //#location @FindRoomByCoords("The Uncharted Oceans")
    }
    #sub %concat(%t1,%t2,%ansi(8)," (",@Rcontinent,",",@Rcoords.x,",",@Rcoords.y,")")
  }
  (%zonename() = "Vidblain, the Ever Dark") {
    Rcoords.x = $x
    Rcoords.y = $y
    #if (%concat("6,",$x,",",$y) != %roomnote()) {
      //Curloc = @FindRoomByCoords("Vidblain, the Ever Dark")
    }
    #sub %concat(%t1,%t2,%ansi(8)," (",@Rcontinent,",",@Rcoords.x,",",@Rcoords.y,")")
  }
  (1) {
    #sub %concat(%t1,%t2,%ansi(8)," (",@Rcontinent,",",%zonename(),")")
  }</value>
  </trigger>
</trigger>


2)room desc trigger I use
Code:

<trigger name="tRoomDesc" priority="20" id="18">
  <pattern>^~{rdesc~}</pattern>
  <value>#gagspace
Rdesc = ""</value>
  <trigger type="Manual">
    <pattern>^(*)$</pattern>
    <value>#switch (%1 = "{/rdesc}") {
    #gag
    #tag desc %replace(@Rdesc,"|",%cr)
    #state tRoomDesc 0
  }
  (1) {#if (@Rdesc = "") {Rdesc = %1} {Rdesc = %concat(@Rdesc,"|",%1)}}</value>
  </trigger>
</trigger>


3)exits trigger I use
Code:

<trigger priority="30" id="20">
  <pattern>^~{exits~}~[Exits: (*)~]</pattern>
  <value>#PSUB "" 0 6
Rexits = %replace(%1," ","|")
#local $color $exits
$exits = %1
#forall "north|south|east|west|up|down|other|none" {
  #switch (%i = "none") {$color = "8"}
    (%i = "other") {$color = "deeppink"}
    (1) {$color = ""}
  $exits = %replace($exits,%i,%concat("",%i,""))
}
#tag exit %1
#PSUB $exits %x1
CurVnum = %roomnum()</value>
</trigger>


4)prompt trigger I use (even though statmon has more info, I can't seem to get the mapper to track consistently when I turn off the prompt via the prompt command in Aard, so I use the prompt prompt for mapping and pull my data out of statmon)
Code:

<trigger priority="35" id="22">
  <pattern>^~[%d/%dhp %d/%dmn %d/%dmv %dqt %dtnl~] >*$</pattern>
  <value>#tag prompt</value>
</trigger>


Works like a charm, except that I can't figure out why a blank description still puts in "{/rdesc}" as a description. It should not even be happening according to the trigger code. After pasting all of that into your settings (I guess it'd be ok to paste directly into the settings tree in the package editor), run the reconfiguration wizard so that the mapper becomes aware of the #TAG commands.

Oh, and there might be references to things I created that are dependant on my mapfile or scripts I didn't give you.
_________________
EDIT: I didn't like my old signature
Reply with quote
C J
Newbie


Joined: 19 Apr 2010
Posts: 4

PostPosted: Mon Apr 19, 2010 4:38 pm   
 
I realize this is a fairly old thread, but I want to clarify something in case someone is referencing this to set up their Aardwolf triggers for mapping. I found Matt's triggers very helpful, and I figured out the reason the below code is loading the room description with a "{/rdesc}" whenever a blank room description is encountered. The reason is that the CMUD code that handles the #tag command will tag the entire line whenever a second argument is not passed in. For instance, "#tag prompt" tags the entire line as a prompt. So if RoomDesc is blank, issuing "#tag desc RoomDesc" is the same as issuing "#tag desc." Therefore the room description is set to the entire line that caused the trigger to fired. To get around this, I use an #if statement to ensure that #tag only gets called if RoomDesc is not blank.
************************************************************************
2)room desc trigger I use
Code:

<trigger name="tRoomDesc" priority="20" id="18">
  <pattern>^~{rdesc~}</pattern>
  <value>#gagspace
Rdesc = ""</value>
  <trigger type="Manual">
    <pattern>^(*)$</pattern>
    <value>#switch (%1 = "{/rdesc}") {
    #gag
    #tag desc %replace(@Rdesc,"|",%cr)
    #state tRoomDesc 0
  }
  (1) {#if (@Rdesc = "") {Rdesc = %1} {Rdesc = %concat(@Rdesc,"|",%1)}}</value>
  </trigger>
</trigger>


Works like a charm, except that I can't figure out why a blank description still puts in "{/rdesc}" as a description. It should not even be happening according to the trigger code.
************************************************************************
Reply with quote
Miloh
Newbie


Joined: 25 Apr 2010
Posts: 1

PostPosted: Sun Apr 25, 2010 4:05 pm   
 
I downloaded CMUD a few days ago and have been trying to get mapping to work on Aardwolf, but am failing miserably. I get the same exact thing as the op for results. So, I realize that with Aard, I must use #TAGs to define the data I want to capture. Likewise, I can use the internal Aard tags to help with this.

I am trying to start with capturing the rdesc. Is it just a matter copying the rdesc snippet above, going into CMUD > Triggers > New, and pasting the snippet code under the Script Text tab on the bottom of the Package Editor, selecting Zscript as the Language, then saving... Then run Reconfigure within the automapper? Every time I try this, reconfigure runs, but doesnt capture the rdesc. I realize I am probably missing something very obvious here.

Does ATCP make a difference? I have tried to both enable and disable it.
Reply with quote
MattLofton
GURU


Joined: 23 Dec 2000
Posts: 4834
Location: USA

PostPosted: Sun Apr 25, 2010 4:43 pm   
 
If you're going to paste my code in through the Package Editor, you will need to only copy in the appropriate parts as dictated by the command syntax. Basically, instead of selecting the entire snippet you'd just copy the exact part you needed (ie, pattern of the first trigger.)

If you want to copy the entirety of my code, you will need to use the command line (it's acceptable to use the commandline for very short stuff) or the CMud text editor (use this for very long stuff) and then click Send to insert the code into your package.

If you are copying XML, you can generally copy the entire thing and do the CTRL-V right there in the treelist. As is usual, this depends on the completeness of the XML.
_________________
EDIT: I didn't like my old signature
Reply with quote
Quit
Wanderer


Joined: 19 Jul 2008
Posts: 59

PostPosted: Sun May 09, 2010 6:17 pm   
 
hi

I am trying to get your code to work, but can't get the room name to work

I have copy and then pasta in the tree list but it said Pattern does not match
if I try to use {rname}The Aardwolf Plaza Hotel (G) in the text field

what does the %d in the pattern do ?

The rdesc and exits works.


and when you look at the xml there is this "![CDATA[", what is that and I think it mess up the color in the script

Reply with quote
Ithilion
Wanderer


Joined: 02 Sep 2005
Posts: 85

PostPosted: Mon May 10, 2010 9:54 am   
 
Copy the value, delete the trigger. Paste directly into settings - that is the xml for the code.. as for %d.. check out Pattern Matching
Reply with quote
Quit
Wanderer


Joined: 19 Jul 2008
Posts: 59

PostPosted: Mon May 10, 2010 5:17 pm   
 
but but as for the %d - %d match any number of digits (0-9)

there are no numbers in the room names on aardwolf, thats why I ask what its for.

and I still curious about the ![CDATA[, cus last time I was playing around with cmud(years ago)
I saw it too and it does mess up the color of the script

and I got the rdesc and exits trigger to work and have done the same thing with the room trigger
but with no luck, as the pattern does not match the room Iam try to enter in the name field under the pattern
like {rname}The Aardwolf Plaza Hotel (G) does not match.

so maybe I need to turn on more tags, got coords, exits, roomdescs and roomnames on
Reply with quote
Zugg
MASTER


Joined: 25 Sep 2000
Posts: 23379
Location: Colorado, USA

PostPosted: Mon May 10, 2010 5:47 pm   
 
![CDATA[ is just an XML tag that allows other XML characters (like < and > etc) to be properly embedded without needing to escape every special character. It has nothing to do with CMUD itself, it's just an XML format that you'll see in the XML tab.
Reply with quote
C J
Newbie


Joined: 19 Apr 2010
Posts: 4

PostPosted: Mon May 10, 2010 5:48 pm   
 
I think the %d is in there because it's an ANSI trigger and the %d is supposed to be a placeholder for the numeric value within the ANSI color code. For starters, until you get a little be more experienced, you can try the following trigger pattern:
~{rname~}(*)
With the above trigger, make sure it's not an ANSI trigger and make sure it fires on a new line. Ideally you would have an up-carret "^" character at the beginning of the trigger pattern to ensure it only fires if "{rname}" is found at the beginning of the line. However, certain settings in Aardwolf will cause "{rname}" not to start on a new line. For instance, even if you configure your Aardwolf prompts to end with a new line character (by adding %c to the end of the prompt), the flags that appear when you enable quiet mode (or deaf mode, or noexp mode, ...) will cause "{rname}" not to occur at the beginning of the line. You can use the PSUB command to strip off items preceeding the "{rname}" to ensure it's the first thing on the line, but that could leads to complications that I don't want to get into here. If you're interested, I could post my {rname} trigger code here whenever I get home to my PC with my Aardwolf package on it. For now, though, I recommend just starting off with the pattern I showed you above and then evolving it from there.
Reply with quote
C J
Newbie


Joined: 19 Apr 2010
Posts: 4

PostPosted: Mon May 10, 2010 6:02 pm   
 
Oh ... and my last post reminded me of at least one reason why the trigger you mentioned (the one with the %d in it) may not be working for you. You need to enable the ANSI trigger option. If the trigger still doesn't fire after enabling the ANSI trigger option, you can try copying the trigger pattern straight from the MUD output window into the trigger pattern field in your editing window. Hope that helps.
Reply with quote
MattLofton
GURU


Joined: 23 Dec 2000
Posts: 4834
Location: USA

PostPosted: Mon May 10, 2010 7:47 pm   
 
In 3.17, a change was made to the interpretation of ANSI codes that strips out any ansi code that matches the default text color in CMud. I believe the default is set by default to silver, which is equivalent to %e[37m, and given that Lasher seems to be in agreement with Zugg with regards to the high/low bit (both don't send the 0; part if the previous color was already low) which is the same color that Aardwolf uses as a default (via the @w code). Since the {rname} and other tags are in this default color, CMud now strips out the %e[37m and sends ^{rname} to the parser to deal with--causing the rname trigger to fail since it's looking for the line to start with an ansi color code. To fix, just remove the beginning ansi pattern OR change the default color to something other than silver (ie, dim green like in ZMud Wink).

Quote:

However, certain settings in Aardwolf will cause "{rname}" not to start on a new line. For instance, even if you configure your Aardwolf prompts to end with a new line character (by adding %c to the end of the prompt), the flags that appear when you enable quiet mode (or deaf mode, or noexp mode, ...) will cause "{rname}" not to occur at the beginning of the line.


Not true, or at least is no longer true and has not been true for at least a year-plus. %c as the last entity in your prompt config is properly moved to the end of special flags like NOEXP
_________________
EDIT: I didn't like my old signature
Reply with quote
C J
Newbie


Joined: 19 Apr 2010
Posts: 4

PostPosted: Mon May 10, 2010 8:08 pm   
 
Not to belabor the point, but I added my {rname} triggers only a few months ago (February, I believe), and the {rname} tag was not showing up at the beginning of the line, even with the newline (%c) added to the end of my prompt. In particular, I remember the *[QUIET]* and *[NOEXP]* flags were causing problems. I also remember mentioning this on the Aardwolf tech channel and remember another player replying that they wished the {rname} tag always had a new line in front of it. It's possible that this was just some kind of temporary behavior that snuck its way into the Aardwolf code for a while and was later fixed. It's also possible that both me and the other player on the tech channel both have other CMUD settings that are causing the lines to get melded togther. :-) Who knows? Regardless, I still recommend leaving off the "^" to begin with, because it's always better (at least for less advanced users like me) to start off with the simplest pattern possible that will cause a unique pattern match and then slowly make the pattern more defensive and complex by add anchors and other features one at a time.

Quote:

Not true, or at least is no longer true and has not been true for at least a year-plus. %c as the last entity in your prompt config is properly moved to the end of special flags like NOEXP
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