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

Play RetroMUD
Post new topic  Reply to topic     Home » Forums » CMUD Beta Forum
Aerious
Wanderer


Joined: 21 Jan 2008
Posts: 62

PostPosted: Thu Mar 25, 2010 8:39 pm   

[bug] cmud 3.16b - non alphanumeric ascii in room descriptions (w/ Workaround)
 
The automapper is failing in creating new rooms about 60% of the times, and correct descriptions 100% of the time, when it encounters a '~' as (at least) the first non blank character if not 'at all' on the first line of the description (( I only have 'first line' in my preferences selected, and suspect if i put multiline description in preferences it would be even more problematic...))

Code:
    ~~~~~       You are at a crossing of two roads. The roads are made
  ~~~~~~~mm     out of hard stone that has been smoothed and shaped into
  ~~~~~~mmm     ovals. Debris from the surrounding area litters the road.
 ~~~~~~pmmmm     Little fluffy clouds drift lazily overhead.
 ~~~~~pmmmm/   
 ~~~pp@---+m   
 ~~pp/mmmmmm   
 ppp/mmmmmmm   
  p/pmmmmmm   
  /pmmmmmmm   
    mmmmm     
        The obvious exits are southwest, north, south, northwest, west, northeast, southeast and east.


any Ideas on how to solve this?

I already went to cmud's general preferences and changed the 'special character' quotes to ` from ~, and that did nothing.

edit>
Also, Bonus Question:... is there a way to have it keep any 'multi' direction collapsed if under '20' rooms? like 6e becomes e e e e e e ... keep it 6 e ? for fast walk ?


Last edited by Aerious on Mon Apr 05, 2010 2:04 pm; edited 1 time in total
Reply with quote
Zugg
MASTER


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

PostPosted: Thu Mar 25, 2010 11:39 pm   
 
Supporting in-game ASCII maps like that which are mixed in with the regular room description is extremely difficult to support in the CMUD mapper right now. You will need to extensively use the #TAG command to override the mapper AI and strip out the ASCII map at the beginning of the text.

Changing the Special Characters for ~ has no effect on this and you should not change that. The Special Characters setting only effects what you type on the command line and not what is received from the MUD.
Reply with quote
MattLofton
GURU


Joined: 23 Dec 2000
Posts: 4834
Location: USA

PostPosted: Fri Mar 26, 2010 1:21 am   
 
EDIT: fixed typo in rdesc assignment
Code:

#trigger {[b]what comes before the description[/b]} {
  minimap = ""
  rdesc = ""
}
#condition {^(&15)(*)$} {
  minimap = %additem(%1,@minimap)
  rdesc = %additem(%2,@rdesc)
} {LoopPattern|param=11}
#condition {^%sThe obvious exits are ($rexits:[%w%s,]).} {
  #tag desc %expandlist(@rdesc,%cr)
  #tag exit $rexits
}


1)May need to throw in a #condition to match your prompt
2)the (*) in the description condition's pattern might not match on zero characters. If it doesn't the pattern can be reduced to just ^(*) but the %1 will need to be processed to remove the first 15 characters.
_________________
EDIT: I didn't like my old signature

Last edited by MattLofton on Fri Mar 26, 2010 4:14 pm; edited 1 time in total
Reply with quote
Aerious
Wanderer


Joined: 21 Jan 2008
Posts: 62

PostPosted: Fri Mar 26, 2010 12:10 pm   
 
Thanks for the Info, Zugg and MattLofton...

The strange part is.. is it seems to handle the ascii map quite well, until it comes upon the water tiles ( ~ ) (they are dark blue)...

but eliminating that part all together, if that is the only way, is a viable solution at this time it seems..

Thanks,
~Aerious
Reply with quote
Aerious
Wanderer


Joined: 21 Jan 2008
Posts: 62

PostPosted: Fri Mar 26, 2010 12:34 pm   
 
MattLofton:

I was looking through your code provided, and while I have not yet got it to work.. it seems that it may try to preserve the minimap for the description?...

Only a few zones have minimap's on this mud.... one is 'outworld' ... I have it set up as a distinct zone on the map..

is there a way to have it only cull out the minimap if it is in a paticular zone?.. 'if zone==outworld then' ?...

Does this just go straight into my 'triggers' or does it need to go somewhere special to deal w/ the map?
Reply with quote
MattLofton
GURU


Joined: 23 Dec 2000
Posts: 4834
Location: USA

PostPosted: Fri Mar 26, 2010 4:42 pm   
 
Quote:

I was looking through your code provided, and while I have not yet got it to work.. it seems that it may try to preserve the minimap for the description?...


I fixed the typo. The %1 in the rdesc assignment was supposed to be %2 instead. Beyond that, I didn't know if you wanted to do anything special with the minimap (ie, put it in a separate window) so instead of just discarding it I stuffed it into it's own variable. You can remove that stuff (and revert the typo fix) if you don't want to save the minimap.

Quote:

Only a few zones have minimap's on this mud.... one is 'outworld' ... I have it set up as a distinct zone on the map..


This part I'm not sure about, since I never had to deal with stuff like an intermittant minimap.

With the minimap incorporating alphabetic characters, there's no real way to capture everything on the line into one single variable and then sift out a minimap that may or may not be there. There's no guarantee that any identifying characters you could look for would be in that line. Perhaps you could convince the coders to put up a wall of unchanging characters?

Perhaps you can build two different sets of #TAG triggers to handle each case separately. You would then use an onZoneEnter event to check the zone name/id to determine if that zone has a minimap or not, and use #T+ and #T- in that event to ensure the proper #TAG triggers were active.

You may even just have to build two different configs and load those. I never had to worry about this, so I'm not familiar with the commands nor any quirks/problems of such.
_________________
EDIT: I didn't like my old signature
Reply with quote
Rahab
Wizard


Joined: 22 Mar 2007
Posts: 2320

PostPosted: Fri Mar 26, 2010 6:53 pm   
 
[edit]
Actually, since you are using the beta version, there is an easy way to do this. The mapper in 3.xx has been rewritten, with several new features. One is a change in how "room scripts" and "zone scripts" work. Simply put the trigger into a class, and in the key of the class put "zone0001", or whatever the correct zone number is. The class will automatically enable when you are in that zone and disable otherwise.

In the current beta version, only a single key is permitted, but eventually it should work with multiple keys, so you could put a whole list of zones to activate on.
Reply with quote
Aerious
Wanderer


Joined: 21 Jan 2008
Posts: 62

PostPosted: Tue Mar 30, 2010 3:21 pm   Still a problem in 3.16
 
I've tested some more.. and found more areas in the mud w/ minimaps that pose problems... especially cities / towns...

The Ascii parts in the map are NOT a problem, UNLESS it is the 'first' character (( not including 'blank characters' )) that the automapper reads in when expecting a room description.

Code:
e
                You are walking on a road going east and west. The road
          #     is made out of hard stone that has been smoothed and
        #p+     shaped into ovals. Debris from the surrounding area
  # ###pp/pp    litters the road.  Little fluffy clouds drift lazily
 pp|pppp/       overhead.
 --+--@+h       You are in the Kingdom of Valkor.
    hhhhh       
     ^Hh       
               
               
               
        The obvious exits are northeast, southeast, southwest, west, northwest, east, north and south.


The Above will create a room into the automapper perfectly, however the room description is stripped of lines that contain the ascii characters... This behavior, is acceptable in the fact that it allows at least the creation of maps using the automapper, if not maps w/ room descriptions.

Code:
n
      |         You are walking on a road going north and south. The road
      |         is made out of hard stone that has been smoothed and
     e|e        shaped into ovals. Debris from the surrounding area
    ee|ee       litters the road.  Little fluffy clouds drift lazily
   eee|eee      overhead.
   eee@eee     
   eee|eeE     
    ee|ee     
     e|e       
      |       
      +       
        The obvious exits are northeast, southeast, southwest, west, northwest, east, north and south.


The above will NOT read in to the automapper automatically (at all) as you can see the '|' character is the first non blank character seen.

The characters ? \ + | * ~ and # all appear to break the automapper... one of / or \ appears to works, while the other does not.. I forget which right now.

Of course, the above characters are the only ones I have encountered thus far, I'm sure there are more, but maybe not more used by this mud.

Is there a way to force a substition on the first character 'seen' on a line BEFORE it is handed off to the automapper?


I do think I'm starting to like the mapper in cmud, however this problem is still nagging... I'm pretty sure there are a few other muds I play that use a very similar outworld minimap if not cities too (lpmuds)...

Why is it only a problem if it is the FIRST character seen on the FIRST line, but does not care if anywhere else?... It just feels like a bug to me.
Reply with quote
MattLofton
GURU


Joined: 23 Dec 2000
Posts: 4834
Location: USA

PostPosted: Tue Mar 30, 2010 7:06 pm   
 
Back to the drawing board, then, to come up with a single set of #TAG triggers that don't need to be enabled/disabled based on zone.

The old trigger
Code:

#trigger {[b]what comes before the description[/b]} {
  minimap = ""
  rdesc = ""
}
#condition {^(&15)(*)$} {
  minimap = %additem(%1,@minimap)
  rdesc = %additem(%2,@rdesc)
} {LoopPattern|param=11}
#condition {^%sThe obvious exits are ($rexits:[%w%s,]).} {
  #tag desc %expandlist(@rdesc,%cr)
  #tag exit $rexits
}


The new trigger
#variable movecommands {n|s|e|w|u|d|enter %w|sleep|enter}
Code:

#oninput "tRoomInfo" {^{@movecommands}$} {
  minimap = ""
  rdesc = ""
}
#condition {^(*)$} {
  #if (%begins(%1,"        The obvious exits are ")) {
    //this is the exits line
    #state tRoomInfo 0
    #call %match(%1,"        The obvious exits are (*).",@rexits)
  } {
    //this is part of the description, check for a minimap
    #if (%pos("   ",%1)) {
      //there's a minimap here
      #additem minimap %left("    ~~~~~       You are at a crossing of two roads. The roads are made",16)
      rdesc = %additem(@rdesc,%right("    ~~~~~       You are at a crossing of two roads. The roads are made",16))
    }
  }
} {manual}
#condition {[b]whatever comes after exits line[/b]} {
  #tag desc %expandlist(@rdesc,%cr)
  #tag exit @rexits
}


1)get rid of the old trigger, and anything else that went with it (there's no longer any need for multiple #TAG triggers in zone scripts like Rahab suggested)

2)put the new trigger anywhere but in the mapper object (being this is going to be your only #TAG trigger, it needs to remain enabled)

3)fill in the @movecommands variable as completely as possible. This trigger will not work if you use an unknown (and probably unique or rare) command.

4)because this trigger depends on commands issued by the user, it might not work on commands issued from a script.
_________________
EDIT: I didn't like my old signature
Reply with quote
Aerious
Wanderer


Joined: 21 Jan 2008
Posts: 62

PostPosted: Wed Mar 31, 2010 3:38 pm   
 
Thank you again Matt Lofton for all of your help, I'll take a look at this soon.
Reply with quote
Aerious
Wanderer


Joined: 21 Jan 2008
Posts: 62

PostPosted: Mon Apr 05, 2010 2:03 pm   Found a better solution for at this time.
 
Until the ascii can be supported, I think the best solution, comes from Matt Lofton from another thread:

Quote:
Here's an even slicker way to do it:

#trigger {^F} {#sub {@randHigh()}}

Make sure the Repeat within line trigger option is checked.


however, I substitue # w/ F (for fortification) and roads ' - ' with o's and other ascii characters w/ whatever non ascii characters i can come up w/.

Putting these substitution triggers in their respective zones allows the minimap and discriptions to get read into the automapper, completely.

It works pretty well, and the only thing I lose is the ascii characters now.

Thanks Matt Lofton for all the work you do in the community... even tho the above solution was not a reply to mine, I read it on another thread, and found it works for me here :)

Also, thankfully the priority of substitute is above where the maps bring int he descriptions :P (luck?)
Reply with quote
Aerious
Wanderer


Joined: 21 Jan 2008
Posts: 62

PostPosted: Mon Apr 05, 2010 2:40 pm   
 
I stumbled on another solution as well, use whichever works best.. I'm using this current one...

#trigger {^} {#sub {x;#cw black}}


This inserts a black x before every line (if used w/ zone scripts, only in the zones that have non-alphanumeric maps) this allows the room description to be read WITH any of the ascii characters (I don't know why)... but this is how I will use it... (( was trying to replace our 'mountains' ( ^ ) w/ M's and discovered this little nugget :p ))


Take Care,
Aerious
Reply with quote
Display posts from previous:   
Post new topic   Reply to topic     Home » Forums » CMUD Beta Forum 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