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
vey2000
Novice


Joined: 21 May 2004
Posts: 32

PostPosted: Fri Mar 09, 2007 11:25 am   

idea for mapper/scripting interaction
 
I had an idea regarding the mapper. Perhaps have the room text triggered by the mapper available as variables that could be edited -- probably following the current format like %roomname for reading and %roomname(text) for editing. By this I mean the text that the mapper catches directly from the mud output, not the text stored in the mapper database. Then you could have the equivalent of an onroomenter/create alias that manually edits the description to remove things like weather lines and other dynamic messages before the mapper continues processing it.

This would also be useful in the case one has enabled the setting "room description changes" and wants to check the actual description received from the mud without having to implement a full mapper override.

Just wanted to suggest it for whenever you get around to redoing the mapper.
Reply with quote
Tech
GURU


Joined: 18 Oct 2000
Posts: 2733
Location: Atlanta, USA

PostPosted: Fri Mar 09, 2007 4:24 pm   
 
This functionality is already available. You need to look into the Rooms functions available .

If you want to do it just after the create use the #EVENT mechanism and choose the system even onRoomCreate
_________________
Asati di tempari!
Reply with quote
Seb
Wizard


Joined: 14 Aug 2004
Posts: 1269

PostPosted: Fri Mar 09, 2007 11:34 pm   
 
Tech, he doesn't want the text stored in the mapper database - he wants what the mapper is getting from mud output (which may not be the same) and you can't get this from %roomname or %roomdesc.
Reply with quote
Fang Xianfu
GURU


Joined: 26 Jan 2004
Posts: 5155
Location: United Kingdom

PostPosted: Fri Mar 09, 2007 11:52 pm   
 
Yes... this sort of pre-processing before the mapper sees text from the MUD can be done with normal triggers capturing the MUD text and then specifying exactly what you want the room name and description and so on to be using the #tag command. There's no way to intercept what the mapper's picking up and change it, but this way you can manually control what's sent to the mapper. Say you wanted to do something like %replace($RoomName,"(road)") before it got sent to the mapper - #tag can do this.
Reply with quote
vey2000
Novice


Joined: 21 May 2004
Posts: 32

PostPosted: Sat Mar 10, 2007 5:06 pm   
 
I don't really have much of a need for this, actually. On the mud I play, descriptions can be as dynamic as each builder wants, so there's no point for me to even track all the different variations there could be. The only thing I could get out of this would be an easy way to check the actual description each time I pass through the room, but I don't believe I've yet come across this need.

I got the idea after reading Zugg's blog entry regarding muds with weather messages in the room descriptions and how to handle them. I just thought this mechanism, perhaps in combination with a function to wordwrap text, could be an easy way to take care of these muds for mapping. It's easier to tell people to just create an event which does something like #tag desc %wordwrap(%replace(%mudroomdesc, "The sun shines bright. ", ""), 80) rather than making a full script system to override the mapper. For this to work the event would have to be raised right after the mapper captures the room info but before it does anything with such as creating a new room or matching it to an existing room.

I know Zugg mentioned a while back that he wouldn't allow scripts to run in the middle of pathfinding due to speed reasons, but there's really no reason not to allow this sort of interaction in these cases where at most you're doing a few rooms per second and it could be the middle ground that's needed for mapper customization between letting the mapper handle things on its own and overriding the mapper.

Besides, not all muds have easy ways to create a mapper override. If the room name and description have nothing to make them stand out from the rest -- like color, tags, etc -- as in mine, then unless you know the room name a priori you'd essentially have to capture everything and then work your way back once you get the exits line, much like I'm guessing the mapper currently does. In these cases, going by my own experience, the mapper is perfectly capable of working by itself, at least as long as you enable the "room description changes" option.

Perhaps even have a gui interface for these most basic cases where you simply put in the various sentences in room descriptions that the mapper should remove before processing. The configuration wizard could let you highlight these sentences in the description and click a button to have them automatically added to the list. This might also require an option to first remove all the (single) carriage returns -- to make sure that multi-paragraph descriptions aren't messed up --, do the pre-processing, then finally word wrap the result in order to handle cases where these unwanted sentences are split up between lines. Unfortunately, this option would mean that any map that was captured with it activated wouldn't work with it deactivated unless the word wrapped result turned out to exactly match the original. However, this would be more of an advanced option only for use when necessary anyway.

Maybe it would be even a good idea to allow the configuration wizard to consider not just the output of one movement, but a path of several rooms, including one direction with no exit, and allow the user to identify all of the corresponding messages for #nomap, #nodir, and those sentences in room descriptions that currently won't work with the use of #nomap.
Reply with quote
patryn
Apprentice


Joined: 26 Sep 2001
Posts: 124

PostPosted: Sun Mar 11, 2007 2:00 am   
 
This may or may not be useful to anyone but...

On the mud I play rooms usually have one or two decriptions depending on whether it is day or night. I found it very useful to utilize the '%notes' field to capture night descriptions and the the %description field for day descriptions. This allowed me to develop a way of pinpointing exactly where I am on the map by room description alone, regardless of the time of day on the mud.

It would be pretty neat if future mapper functionality included custom description fields where the user could specify a number of different descriptions for one room. Perhaps allow keywords in the %description of a room to seperate one from another.

Eg.// [desc 1]This is a white room.[/desc][desc 2]This room is very dark.[desc 3]This room is missing a ceiling.[/desc]

You get the idea
_________________
That which does not kill us, makes us stronger.
Reply with quote
Arminas
Wizard


Joined: 11 Jul 2002
Posts: 1265
Location: USA

PostPosted: Sun Mar 11, 2007 5:56 am   
 
This thread made me think of a wordwrap function so I made one.

Code:
#ALIAS wordWrap {#if (%-1!=%null) {bigString=%quote( %-1);newString=%null;newString1=%null};#if (%len( @bigString)>80) {#loop 80 {#if (%ends( %left( @bigString, %i), " ")) {newString1=%trim( %left( @bigString, %i))}}} {newString=%concat( @newString, @bigString);bigString=%null};#if (@newString1!=%null) {bigString=%trim( %remove( @newString1, @bigString));newString=%concat( @newString, @newString1, %lf);newString1=%null};#IF (@bigString!=%null) {wordWrap} {%quote( @newString)}} "wordwrap"
#VAR bigString {} {_nodef} "wordwrap"
#VAR newString {} {} "wordwrap"
#VAR newString1 {} {} "wordwrap"
#VAR wordwrap {%exec( "wordWrap %quote(%-1)")} {_nodef} "wordwrap"


If you paste this in the command line it creates a class that gives you a wordwrap function. It wraps large blocks of text to 80 characters or less on each line. It also only wraps where spaces occur.

Note that you call it as a user defined Function so @wordwrap("My large amount of text goes here")
Also note that if you are in Zmud and had a large block of text within a variable you would need to do this @wordwrap("@yourvariable"). I have not tested this in CMUD as of yet.
_________________
Arminas, The Invisible horseman
Windows 7 Pro 32 bit
AMD 64 X2 2.51 Dual Core, 2 GB of Ram
Reply with quote
Arminas
Wizard


Joined: 11 Jul 2002
Posts: 1265
Location: USA

PostPosted: Sun Mar 11, 2007 6:09 am   
 
The above could then be used to write the description of your mud to the mapper using %roomdesc or #tag. First you need to have a trigger that finds a roomname. Then...

#trigger {your room name trigger pattern} {#tag roomname;#t+ DescCatcher}

#trigger (*) {Add every line to a variable named roomdescript till this is turned off.;#nomap:#gag} named DescCatcher with an added space at the end.

Trigger that captures your exits if any or one that captures your prompt. #T- DescCatcher;roomdescript=%remove(Stuff I don't want like weather);roomdescript=@wordwrap("@roomdescript");#tag desc @roomdescript

This is All very sloppily written, it's midnight and I'm tired, But I hope you are getting the general drift of my thoughts.
_________________
Arminas, The Invisible horseman
Windows 7 Pro 32 bit
AMD 64 X2 2.51 Dual Core, 2 GB of Ram
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