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
Toxic
Adept


Joined: 27 May 2008
Posts: 299

PostPosted: Fri Jun 27, 2008 11:55 pm   

[2.29] Getting #TAG exit to work... Also XML Bug
 
Ive got output of

Code:

<RNAME>
Forgotten Library [**> PK <**]
</RNAME>
<RDESC>
  The sweet smell of incense greets you inside a wide, bright chamber.
Torch light dances over rows of timeworn texts that spread against a
rounded stone wall. Dull leather spines and wooden shelving reach to the
high edges of an arched ceiling, forcing the use of unsteady-looking risers
for the most curious reader. Many of the books look untouched while others
carry obvious signs of overuse. Several stone tables, each with its own
glowing flame, are staggered throughout. Small volumes of material remain
stacked on each.
 
 
Two halls lead off the main chamber. One continues south into darkness,
while the other leads west, terminating at a vast wooden door. A similar
door resides to your north.
</RDESC>

<EXITS>
[Exits: north south west]
</EXITS>


and XML of...

Code:
<module name="Map Tags" id="4468">
  <uid>{963EE711-3B3C-4B9E-A46D-DF2021F6FC99}</uid>
  <trigger priority="44693" id="4469">
    <pattern>^~<RNAME~></pattern>
    <value>#GAG
#NOMAP</value>
    <trigger type="Within Lines" param="1">
      <pattern>^(*)$</pattern>
      <value>#TAG name %1</value>
    </trigger>
  </trigger>
  <trigger type="Within Lines" param="1">
    <pattern>^(*)$</pattern>
    <value>#TAG name %1</value>
  </trigger>
  <trigger priority="44720" id="4472">
    <pattern>^~<~/RNAME~></pattern>
    <value>#GAG
#NOMAP</value>
  </trigger>
  <trigger priority="44730" id="4473">
    <pattern>^~<RDESC~></pattern>
    <value>#GAG
#T+ No_Map
#NOMAP</value>
  </trigger>
  <trigger name="No_Map" priority="44740" enabled="false" id="4474">
    <pattern>^(*)$</pattern>
    <value>#NOMAP</value>
  </trigger>
  <trigger priority="44750" id="4475">
    <pattern>^~<~/RDESC~></pattern>
    <value>#T- No_Map
#GAG
#NOMAP</value>
  </trigger>
  <trigger priority="44760" id="4476">
    <pattern>^~<EXITS~></pattern>
    <value>#GAG
#NOMAP</value>
    <trigger type="Within Lines" param="1">
      <pattern>^~[Exits: (*)~]$</pattern>
      <value>#TAG exit</value>
    </trigger>
  </trigger>
  <trigger type="Within Lines" param="1">
    <pattern>^~[Exits: (*)~]$</pattern>
    <value>#TAG exit %1</value>
  </trigger>
  <trigger priority="44780" id="4478">
    <pattern>^~<~/EXITS~></pattern>
    <value>#GAG
#NOMAP</value>
  </trigger>
</module>


When I reconfigure the mapper using the above room it doesnt grab the exits as the exits... the room name grabs fine. I also tried just #TAG exit still didnt work...

BTW theres also an xml bug shown here where its showing the condition of the triggers twice... very wierd, I promise you they arent there twice.
Reply with quote
Toxic
Adept


Joined: 27 May 2008
Posts: 299

PostPosted: Sat Jun 28, 2008 12:03 am   
 
Well, from the looks of it, the forums are parsing some of my xml from up top... since the exit trig is the only thing thats not working Ill write it in zscript here so people can see whats up...

#TR {^~<EXITS~>} {#GAG}
#COND {^~[Exits: (*)~]} {#TAG exit %1} {within|param=1}

with that trigger and the above output I cant get the mapper to recognize the line as the exits

Any help? Thanks
Reply with quote
Zugg
MASTER


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

PostPosted: Tue Jul 01, 2008 5:02 pm   
 
In your XML, it looks like you have some corrupted data in your package causing the trigger state to be listed twice. You'll notice that the first occurence of the "Within Lines" state is properly nested as a state within trigger #4469. The second occurrence shows the trigger state outside of the trigger in the main level of the module. That's very bad.

Also, your main trigger has a pattern of just ^~ which is a bit weird. The ~ character is the escape character, so I think the pattern should be ^~~ instead. That will match a line that starts with the ~ character.

The other thing I'm confused about is that the first trigger (#4469) in the XML fires on ^~ and then has a trigger state to fire on ^(*)$, which will match anything on the next line. But then later down in the XML you have another trigger (#4476) that also triggers on ^~ and then fires on ^~[Exits: (*)~]$ in the second state. So you have two triggers that are going to fire on the same lines. Your first #4469 trigger is also going to fire on the Exit text and call the #TAG Name %1 on the exit text.

To get rid of the corruption, you might need to remove the extra trigger stuff in the XML file with a text editor and then create a new package in CMUD and import the edited XML file into it.
Reply with quote
Toxic
Adept


Joined: 27 May 2008
Posts: 299

PostPosted: Tue Jul 01, 2008 5:28 pm   
 
Alot of that stuff was corrupted in the XML output. For instance I don't have a ^~ trigger. The pattern should be completely different. I think the forums ate it. My Main issue is getting #TAG exit to work. Right now it isnt.
Reply with quote
Zugg
MASTER


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

PostPosted: Tue Jul 01, 2008 5:54 pm   
 
No, the XML format is properly showing what is in your package file. That's why I said that your package file is corrupted. Just because it doesn't show up in the Tree View in the settings editor doesn't mean anything. The XML dump is a low level dump of what CMUD has stored in memory for the module. The fact that you have triggers that are in the XML and not showing up in the Tree View means that your package is corrupted.

Does your XML show trigger #4469 with a pattern of just ^~ like in the dump above? The forums shouldn't be eating anything that is within a [CODE] tag. But without being able to see the exact XML text that you see in CMUD, we can't help much.

As far as capturing the EXIT tag information, You need to use an MXP Trigger and not a normal trigger. Normal triggers don't see the <EXITS> stuff because that's an MXP tag. And unfortunately, multistate triggers haven't really been tested with MXP triggers since the MXP trigger is firing early when the raw text is received from the MUD.
Reply with quote
Toxic
Adept


Joined: 27 May 2008
Posts: 299

PostPosted: Tue Jul 01, 2008 6:26 pm   
 
No, its not. I dont have the package file with me right now but I will when I get home. The actual trigger is {^~<EXITS~>} and when you look at the XML tab it converts the <> to something else, not sure what. When you paste that into the forums, even in qoutes, it strips out the <> that got converted to something else by the XML.
Reply with quote
Zugg
MASTER


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

PostPosted: Tue Jul 01, 2008 8:02 pm   
 
OK, I see what you mean. I have edited your original post to replace the HTML entities with the actual < and > characters. I'll try to fix that problem with the [CODE] tag at some point in the future.

The problem still exists that you are using normal triggers instead of MXP triggers though.
Reply with quote
Toxic
Adept


Joined: 27 May 2008
Posts: 299

PostPosted: Tue Jul 01, 2008 8:30 pm   
 
Right. I'll have to look into the MXP issue then. Thanks.
Reply with quote
Toxic
Adept


Joined: 27 May 2008
Posts: 299

PostPosted: Tue Jul 01, 2008 11:03 pm   
 
Zugg, Take the xml from above, remove the duplicated Cond triggers, import it, then go to the xml tab for that module. The cond triggers are reduplicated.

Also I work better by example... Can you show me how I would write an MXP trigger for the exits line using the output above?
Reply with quote
Zugg
MASTER


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

PostPosted: Tue Jul 01, 2008 11:17 pm   
 
OK, I had to restore the MXP entities that I edited out of your original post, but once I did that and removed the extra trigger states, then I reproduced the problem. Definitely a nasty XML export problem that I'll try to fix in v2.30.

But in looking at CMUD, I don't think this bug is causing your exit problem. I think it's just an XML artifact. The only problem would happen if you imported the XML without deleting the extra triggers first. That could cause extra triggers to get added to your settings.

I'm on my way out the door right now, so maybe one of the other Gurus can give you some hints on an MXP trigger. You'll want to use the ELEMENT tag to create elements called EXITS, RNAME and RDESC so that they are properly detected as MXP tags. Then you don't need the #GAG anymore. And just using the normal flags for MXP tags for exits, rname and rdesc should be enough to send the data to the mapper without any #TAG commands at all.
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