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
masterkrueger
Wanderer


Joined: 24 Jan 2010
Posts: 65
Location: Hamburg

PostPosted: Tue May 11, 2010 8:41 pm   

Blank room name
 
Hi, i have absolutely the same problem as the following older post:
http://forums.zuggsoft.com/forums/viewtopic.php?p=146705

I am using CMUDPro 3.17 on Win7 Home 32 Bit.
I recognized that my #find did not work for some rooms, the reason is (i think it is) that the room description is correct
but the roomname (normally generated by the roomdesc) is blanc. Reloading the room info did not work.
After i checked the configuration, i saw my room exit keyword is empty.

I set the flag autogenerate roomname from description in the room props and reentered the room,
the name is set correctly.

In the old post Zugg said there should be no zfg and/or cfg files for the zones but i only have one zfg file for my map.

Im not 100% sure about the config, but i used CMUD 2.37 yesterday and switched to beta, the mapping worked there.
The only thing i recognize is that the roomname stops at dots and colons and semicolons! I play a german MUD.
A normal Text (description) the first sentence of the room would be:
Quote:
Du stehst auf einem Trampelpfad, der ueber diese seltsame Insel fuehrt. Am

In zMUD the whole line was taken as the roomname, in CMUD 2.37 the name stops at
Quote:
Du stehst auf einem Trampelpfad
and now in beta the name is empty.

I think i took the same settings from zMUD to CMUD to beta but i'm not absolutely sure because i tried a lot ^^

Thanks for any help

Jason Razz
Reply with quote
Rahab
Wizard


Joined: 22 Mar 2007
Posts: 2320

PostPosted: Wed May 12, 2010 3:04 pm   
 
Did you reconfigure the mapper after switching to 3.17? That may be necessary.
Reply with quote
masterkrueger
Wanderer


Joined: 24 Jan 2010
Posts: 65
Location: Hamburg

PostPosted: Thu May 13, 2010 11:16 am   
 
Hi Rahab,

i reconfigured the mapper about 1000 times now ^^ the only way to get the roomname from the first line of the description is to set the "generate name from desc" and reenter the room. But it worked before,
it should work now i think :)

Maybe i'll have to put the #TAGs together of my own? A normal Text would be( it's an german mud but ill use englisch example text now):

You are standing at the seashore, there is a house
near the trees....blabla
....blabla trees trees trees
There are some Exits: north and northeast
A house
A Tree
>


The mapper recognize the exit words and from the beginning to the exit line all text is description.
The Objects afterwards are lost :( would be nice if it would be description too.

Thats it, any idea?

Thanks a lot
Reply with quote
Zugg
MASTER


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

PostPosted: Thu May 13, 2010 4:37 pm   
 
Quote:
set the "generate name from desc" and reenter the room

What exact option in the Map Properties are you setting? There isn't any option called "generate name from desc" that I can recall. The configuration of the mapper in CMUD is currently the same as it was in zMUD, so I don't know why there would be any difference. Are you sure you don't have some scripts of your own that are generating the name from the description using #tags that might be messed up?
Reply with quote
masterkrueger
Wanderer


Joined: 24 Jan 2010
Posts: 65
Location: Hamburg

PostPosted: Thu May 13, 2010 5:50 pm   
 
I exported and imported the config from z- to CMUD and tested again. (btw. "generate name from desc" is in the properties of the roomdescription, there must be a room so that this can be set) There are no #TAGS active. With this config the problem changes, i get the roomname from the last line now! If we take the example above the roomname would now be ...blabla trees trees and the diagonal exits are not drawn when detected but the description is complete.
This is my current config:
http://img532.imageshack.us/img532/3087/cmudmapperconfig.png
Reply with quote
MattLofton
GURU


Joined: 23 Dec 2000
Posts: 4834
Location: USA

PostPosted: Thu May 13, 2010 7:06 pm   
 
1)compile a stringlist of every form of movement command you can use. You don't need to include specific objects, such as "climb tree|climb rock|etc", but if you want to match on them you will need to include their wildcard equivalents (ie, "climb %w|swim %w|etc"). This list must be as complete as possible, since it will form the beginning of your #TAG trigger.

Code:
#oninput "tCaptureRoom" {{@movecommands}$} {
  Rname = ""  //optional
  RDesc = ""  //required
  RExits = ""  //optional
  RObjects = ""  //optional
}


2)from here, you need to capture everything down to the exits line, and it's a varying amount of multiple lines.

Code:
#condition {^(*)$} {
  #if (%pos("Exits: ",%1) {
    //we have reached the Exits line
    #call %match(%1,"Exits: (*)",@RExits)
    #state tCaptureRoom 2
  } {
    //still part of the name and desc
    //may require some adjustments for proper format, depending on where/how your game wordwraps
    Rdesc = %concat(@Rdesc,%1)
  }
} {manual}


3)room objects might get a little tricky to match, since the terminating line for that is your prompt. In addition, just like in any other game room objects are probably not guaranteed to be permanant to that room nor have any special way other than trying to pick them up to tell if they are permanent. I've chosen to not add them to the description (the presence/absence of transient objects may cause the map to stop matching), instead collecting them into a variable other scripts can check.

Code:
#condition {^(*)} {
  #if (%begins(%1,"> ")) {
    //this is the prompt
    #state tCaptureRoom 0
    //generate room name
    #forall ". |? |! " {RDesc = %replace(@RDesc,%i,%concat(%i,"|"))}
    RName = %item(@RDesc,1)
    //apply #TAG
    #TAG name @RName
    #TAG desc %expandlist(@RDesc,%cr)
    #TAG exit @RExits
    #TAG prompt %1
  } {
    //this is an object
    RObjects = %additem(%1,@RObjects)
  }
} {manual|prompt}


Copy all three codeboxes to the command line or text editor (one after the other, no blank lines between) to insert it into your package.
_________________
EDIT: I didn't like my old signature
Reply with quote
Zugg
MASTER


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

PostPosted: Thu May 13, 2010 10:56 pm   
 
Quote:
(btw. "generate name from desc" is in the properties of the roomdescription, there must be a room so that this can be set)

OK, but that isn't a map configuration option. This is an option set for each and every room object that you can set to force CMUD to reload the description and room name the next time you do a #LOOK command in the room. This option will *not* cause new rooms to generate the name from the description.

I recommend you use what Matt suggested and have your own script compute the room name from the description.
Reply with quote
masterkrueger
Wanderer


Joined: 24 Jan 2010
Posts: 65
Location: Hamburg

PostPosted: Fri May 14, 2010 6:33 am   
 
Thank you very much, that is exactly what i was trying to build. I will try this in the evening :)
I wonder why the exaclty same settings work perfectly in zMUD but not in CMUD the roomname
is the first line of the first paragraph in zMUD and the last line of the first paragraph in CMUD.

Weird, but i will try the scripting version ;)

Thank you very much!!! Razz
Reply with quote
masterkrueger
Wanderer


Joined: 24 Jan 2010
Posts: 65
Location: Hamburg

PostPosted: Sun May 16, 2010 4:02 pm   It's working!
 
Thank you for you help, the roomname is now assigned correctly. There are some other minor things to do but with multistate trigger it's much easier now :)
Reply with quote
masterkrueger
Wanderer


Joined: 24 Jan 2010
Posts: 65
Location: Hamburg

PostPosted: Tue May 18, 2010 7:17 pm   
 
I'm sorry to write again :(

I can't get the roomdesc to work correctly, my debug output shows the CRLF endings but it did not concatenate.
The part is only reached once, the desc shows only the first line of text.
Code:

0.0191 | i  MorgenGr <Hier gabelt sich der Weg erneut. Die Straeucher um Dich herum machen nach wie<CR><LF>
0.0000 | vor einen furchterregenden Eindruck, wohingegen sich der Weg nach Suedosten <CR><LF>
0.0000 | ein wenig verbreitert. Ein seltsames Heulen ist von dort zu hoeren, und Du<CR><LF>
0.0000 | siehst den Schein von Feuer durch die Buesche dringen.  <CR><LF>
0.0000 | Es gibt drei sichtbare Ausgaenge: nordosten, suedosten und westen.<CR><LF>
0.0038 | a  MorgenGr |Hier gabelt sich der Weg erneut. Die Straeucher um Dich herum machen nach wie
0.0037 | a  MorgenGr |vor einen furchterregenden Eindruck, wohingegen sich der Weg nach Suedosten
0.0043 | a  MorgenGr |ein wenig verbreitert. Ein seltsames Heulen ist von dort zu hoeren, und Du
0.0032 | a  MorgenGr |siehst den Schein von Feuer durch die Buesche dringen. 
0.0033 | a  MorgenGr |Es gibt drei sichtbare Ausgaenge: nordosten, suedosten und westen.
0.2049 | i  MorgenGr <> <IAC><EOR>
0.0025 | a  MorgenGr ]>



I hope i will get better in this in the future ^^ thanks in advance :)
Reply with quote
masterkrueger
Wanderer


Joined: 24 Jan 2010
Posts: 65
Location: Hamburg

PostPosted: Tue May 18, 2010 7:53 pm   
 
I'm a bit confused the first trigger only fires once, after that it didn't match anymore???!

before first move:
http://img210.imageshack.us/img210/1067/match1g.png

after:
http://img227.imageshack.us/img227/112/match2.png

and there is no processing even in debug window.

Ok, but thats the last puzzle for today. maybe more tomorrow ^^
Reply with quote
masterkrueger
Wanderer


Joined: 24 Jan 2010
Posts: 65
Location: Hamburg

PostPosted: Sun May 23, 2010 7:22 pm   
 
OK I have the packet up and working :) took a while but now "everything" is fine.

this is it:

Code:
<trigger name="CaptureRoomInfo" type="Command Input" priority="8060" newline="false" prompt="true" id="840">
  <pattern>^{@movekeywords}$</pattern>
  <value>RName = ""  //optional
RDesc = ""  //required
RExits = ""  //optional
RObjects = ""  //optional
RCounter = 0    //optional</value>
  <notes>Trigger any movement</notes>
  <trigger name="RoomDesc" type="Manual" param="25">
    <pattern>^(*)$</pattern>
    <value>#if ((%pos("Ausgang: ",%1)) OR (%pos("Ausgaenge: ",%1))) {
    #print {exit found}
    #call %match(%1,"Ausg??ng?:(*)",RExits)
    RExits = %trim(%replace(%replace(%replace(@RExits," und","|"),", ","|"),".",""))
    #print {@RExits}
    #STATE CaptureRoomInfo 2
  } {
    #print {description}
    #ADD RCounter 1
    RDesc = %concat(@RDesc,%1"|")
    #print {@RCounter}
  }</value>
    <notes>collect data</notes>
  </trigger>
  <trigger name="StopCapture" type="Manual" param="25" prompt="true">
    <pattern>^(*)</pattern>
    <value>#if (%begins(%1,"> ")) {
    //prompt found: data collected, state reset
    #print {prompt %1}   
    //generate room name
    //#forall ". |? |! " {RDesc = %replace(@RDesc,%i,%concat(%i,"|"))}
    RName = %item(@RDesc,1)
    //apply #TAG
    #TAG name @RName
    #TAG desc %expandlist(@RDesc,%cr)
    #TAG exit @RExits
    #TAG prompt %1
    #STATE CaptureRoomInfo 0
  } {
    //Object_Handling
    #DBLOAD Items
    #DBLOAD Monster
    #if (%find(%1, Items) OR %find(%1, Monster)) {
      #print Item %find(%1, Items) gefunden
    } {
      yesno = %prompt(1,"Item?")   
      #IF (@yesno) {
        //match Item
        #print Item neu anlegen     
        #NEW Items Bezeichnung=%1       
      } {
        //match Monster
        #print Monster neu anlegen     
        #NEW Monster Name=%1
      }
      #DBSAVE
    }
  }
  </value>
    <notes>#TAG data</notes>
  </trigger>
</trigger>
<trigger name="CaptureRoomInfo" type="Command Input" priority="8060" newline="false" prompt="true" id="840">
  <pattern>^{@movekeywords}$</pattern>
  <value>RName = ""  //optional
RDesc = ""  //required
RExits = ""  //optional
RObjects = ""  //optional
RCounter = 0    //optional</value>
  <notes>Trigger any movement</notes>
  <trigger name="RoomDesc" type="Manual" param="25">
    <pattern>^(*)$</pattern>
    <value>#if ((%pos("Ausgang: ",%1)) OR (%pos("Ausgaenge: ",%1))) {
    #print {exit found}
    #call %match(%1,"Ausg??ng?:(*)",RExits)
    RExits = %trim(%replace(%replace(%replace(@RExits," und","|"),", ","|"),".",""))
    #print {@RExits}
    #STATE CaptureRoomInfo 2
  } {
    #print {description}
    #ADD RCounter 1
    RDesc = %concat(@RDesc,%1"|")
    #print {@RCounter}
  }</value>
    <notes>collect data</notes>
  </trigger>
  <trigger name="StopCapture" type="Manual" param="25" prompt="true">
    <pattern>^(*)</pattern>
    <value>#if (%begins(%1,"> ")) {
    //prompt found: data collected, state reset
    #print {prompt %1}   
    //generate room name
    //#forall ". |? |! " {RDesc = %replace(@RDesc,%i,%concat(%i,"|"))}
    RName = %item(@RDesc,1)
    //apply #TAG
    #TAG name @RName
    #TAG desc %expandlist(@RDesc,%cr)
    #TAG exit @RExits
    #TAG prompt %1
    #STATE CaptureRoomInfo 0
  } {
    //Object_Handling
    #DBLOAD Items
    #DBLOAD Monster
    #if (%find(%1, Items) OR %find(%1, Monster)) {
      #print Item %find(%1, Items) gefunden
    } {
      yesno = %prompt(1,"Item?")   
      #IF (@yesno) {
        //match Item
        #print Item neu anlegen     
        #NEW Items Bezeichnung=%1       
      } {
        //match Monster
        #print Monster neu anlegen     
        #NEW Monster Name=%1
      }
      #DBSAVE
    }
  }
  </value>
    <notes>#TAG data</notes>
  </trigger>
</trigger>


Now i can get names and descs and items into two different databases but :(
i ran into a new problem. The exits roam over multiple lines and the script handles further lines as Objects.

at the end of the first exit line is a CRLF any fast ideas how to catch the second exit line?

... a nevereding story ;)
Reply with quote
MattLofton
GURU


Joined: 23 Dec 2000
Posts: 4834
Location: USA

PostPosted: Sun May 23, 2010 7:56 pm   
 
Since the name, description, and exit info all runs together and can only be matched by one trigger, you will need to keep track of both the "what" and the "type" found. A simple @roominfo variable that gets set to "name", "desc", and "exit" can then be checked to see what #TAG variable gets added to.
_________________
EDIT: I didn't like my old signature
Reply with quote
masterkrueger
Wanderer


Joined: 24 Jan 2010
Posts: 65
Location: Hamburg

PostPosted: Mon May 24, 2010 1:21 pm   
 
The problem i have is not that the exits are not found or can't be used by #TAG, but there can be multiline exits and the script just looks for one exit line and then go further to Items listed and then prompt and out :)
Its something like this:

Exits: north, south and <CRLF>
west. <CRLF>

west. is added as an item :( Maybe i'll have to try something like matching from "Exit: " to "." if thers no dot at the end, there's still exit information available?
Reply with quote
masterkrueger
Wanderer


Joined: 24 Jan 2010
Posts: 65
Location: Hamburg

PostPosted: Thu May 27, 2010 7:52 pm   
 
I don't wanna keep this Thread open forever and I'm making progress :)
When I receive the prompt I set the #TAG name etc... and afterwards I
want to add the found objects I added before to the database to the room.

BUT the content of the current room is added to the last one. It looks like
it's to early to add the content because the Room is not fully written?

Last question really ;)
(crossing fingers)
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