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

Play RetroMUD
Post new topic  Reply to topic     Home » Forums » zMUD General Discussion
dhe
Newbie


Joined: 21 Apr 2008
Posts: 7

PostPosted: Mon Apr 21, 2008 10:15 am   

MXP Map Intercepter?
 
Hi, this is my first time on these forums, so if this question has already been addressed before, please help me out with a link or something.

I play a MUD (Realms of Hell), that has a world map system. I can get the world map to display in a separate frame using the MXP <send> and a few triggers. But obviously, that defeats the purpose of having the map frame, since the map has to show up in the main screen as well. My MUD is really just starting to experiment with MXP, so there's no server-side support yet.

What I'd like to do is know if it's possible to intercept the map before it displays in the main frame, and divert it to the map frame - that way I see only the map in the map frame, and everything BUT the map in the main frame.

An example of what the map looks like is:

Code:

(164 H 66 M): look

The World of Derlith

.-----------------.
|  ~~~~~~~~~~/|f  |   
| ~~~~~~~~~CC~|.. |   
| ~~~~~~~~~CC-+-- |   Wild grass of varying height dominates the nearby
|~~~~....~~@~~.f..|   landscape. Meadows of tall prairie grass are interspersed
|~~~~...@@@/~~....|   with patches of short, rugged vegetation. A wide diversity
|~~~....@@@..~....|   of wildlife grazes throughout the grasslands of Derlith,
|~~.....@@..@~....|   which make for excellent hunting ground.
|........|@@.~~...|   
| ..../--+@-@@~~~ |   You are in the borders of the Kingdom of Highport.
| /@-/.ff|.@.\... |   
|  .@....|....\-  |   
.-----------------.
Obvious exits: north, east, south, west, northeast, northwest, southeast, southwest, rusty gate.
You see a Highport guardsman.

(164 H 66 M): say hello
You say, "hello".
Reply with quote
dhe
Newbie


Joined: 21 Apr 2008
Posts: 7

PostPosted: Mon Apr 21, 2008 11:22 am   What I've tried so far:
 
So so far, I tried using this:
Code:

#TRIGGER {The World of Derlith} {}
#MXP <DEST MAP EOF></DEST>
#LOOP 1,13 (#CONDITION {(*)} {#SUB {<DEST Map X=1 Y=%i>%1</DEST>}} {Within|Param=13})


This has a number of errors though:

1) Ignores the blankspaces in the map output.
2) Map has no color.
3) My main frame does not have the map in it anymore, but there are still 13 empty newlines. <nobr> didn't work very well.
Reply with quote
Fang Xianfu
GURU


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

PostPosted: Mon Apr 21, 2008 12:31 pm   
 
I'm not sure where MXP comes into this. It seems to me like all you want to do is move the map from one window to another. What's that got to do with MXP? I'm loath to suggest a solution when I still don't understand the problem.
_________________
Rorso's syntax colouriser.

- Happy bunny is happy! (1/25)
Reply with quote
dhe
Newbie


Joined: 21 Apr 2008
Posts: 7

PostPosted: Mon Apr 21, 2008 1:02 pm   
 
Are you referring to the 2nd line, where I use #MXP?

I do that because otherwise, I get an error from the MUD saying that <DEST is not a valid command.

Yes, the main thing I want to do is move the map (and description next to it) to a different frame. How would you suggest doing that?
Reply with quote
charneus
Wizard


Joined: 19 Jun 2005
Posts: 1876
Location: California

PostPosted: Mon Apr 21, 2008 2:30 pm   
 
Since this isn't a finished script, could this be moved to the proper forum? Just a question.

Charneus
Reply with quote
Fang Xianfu
GURU


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

PostPosted: Mon Apr 21, 2008 3:08 pm   
 
Good spot, charneus, I'd missed that.

OP: No, I'm not talking about your use of the #MXP command, I'm talking about your use of MXP tags at all in this. Why are you bothering?
_________________
Rorso's syntax colouriser.

- Happy bunny is happy! (1/25)
Reply with quote
dhe
Newbie


Joined: 21 Apr 2008
Posts: 7

PostPosted: Mon Apr 21, 2008 5:37 pm   
 
I'm bothering to use MXP tags because I don't know any other way. If you do, please enlighten me. Thank you.
Reply with quote
Tech
GURU


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

PostPosted: Mon Apr 21, 2008 11:56 pm   
 
You really only need to to create the MAP window once with the MXP command, and as Fang pointed out you really don't need to use MXP. After thinking about it some more, I'm guessing you're using to update in place the map window. I'll post a non-MXP solution later, right now I'm off to workout.

Code:

#MXP <DEST MAP EOF></DEST>
#TRIGGER {The World of Derlith} {}
#LOOP 1,13 (#CONDITION {^({.|\|}*{-.|\|  })} {#SUB {<DEST Map X=1 Y=%i>%1</DEST>}})


That should get you close to what you want. It should only be run once from the command line otherwise you'll be constantly recreating the trigger.
_________________
Asati di tempari!
Reply with quote
dhe
Newbie


Joined: 21 Apr 2008
Posts: 7

PostPosted: Tue Apr 22, 2008 11:36 am   
 
Thanks for the help.

That does remove it. There are a few problems - the edges of the map are denoted by "|", but so are paths, so sometimes that causes the image to be skewed. What I wanted to do is just have the entire line copied over, which is why I used the (*) in my loop. However, that didn't remove the blank line from the main window - it just showed a blank line instead. Any fix for this?

One more thing - the map has colors, but the colors don't get copied over the new frame (all shows up green). Is this because I'm using MXP when the MUD is displaying in ANSI color? Anyway around this problem?

Thanks a lot for the help!

Example:

This
Code:
.-----------------.
|  /........|...  |   
| /.....?ff.|.ff  |   
| ......f...V.ff  |   Wild grass of varying height dominates the nearby
|...........|..ff |   landscape. Meadows of tall prairie grass are interspersed
|....ff..f..|....f|   with patches of short, rugged vegetation. A wide diversity
|--\.....@..|.V...|   of wildlife grazes throughout the grasslands of Derlith,
|...\-------+.|...|   which make for excellent hunting ground.
|............\|...|   
|  .ff..f.....+@. |   You are in the borders of the Kingdom of Highport.
|  ..f........|.. |   
|   ..........CC  |   
.-----------------.


Shows up as this:
Code:
.-----------------.
|  /........|...  |   
| /.....?ff.|.ff  |   
| ......f...V.ff  |   
|...........|..ff |   
|....ff..f..|....f|   
|--\......|.V...|   
|...\-------+.|...|   
|............\|...|   
|  .ff..f.....+@. |   
|  ..f........|.. |   
|   ..........CC  |   
.-----------------.


when copied to the new frame.

Right now, I'm using the loop:

Code:
#LOOP 1,13 (#CONDITION {(*)} {#MXP <DEST Map X=1 Y=%i><font color=white>%1</font></DEST>}


This doesn't sub, so the map still shows up in my main frame. However, it causes no formatting/spacing errors, where as #SUB does.
Reply with quote
Fang Xianfu
GURU


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

PostPosted: Tue Apr 22, 2008 4:06 pm   
 
That's because Tech made a mistake in his pattern. I think he meant this: ^({.|~|}%*{-.|~| })

I changed the * to %* because I believe * doesn't match some special characters, which could cause problems here.
_________________
Rorso's syntax colouriser.

- Happy bunny is happy! (1/25)
Reply with quote
dhe
Newbie


Joined: 21 Apr 2008
Posts: 7

PostPosted: Wed Apr 23, 2008 11:07 am   
 
So I tried that, and it still looks funny. I changed my trigger to:

Code:
#TRIGGER {^The World of Derlith} {}
#MXP <DEST MAP EOF></DEST>
#LOOP 1,13 (#CONDITION {^({.|\|}%*{-.|\|  })} {#SUB {<DEST Map X=1 Y=%i>%1<br></DEST>}})


That is what you suggested, Fang. I added in the <br> to make copy-pasting out of the Map frame easier (otherwise it just came out on the single line), but the output is the same either way.

I'm also keeping the #MXP <DEST MAP EOF></DEST> line within the trigger so that the Map frame clears, just in case there's any residue left from a previous error.

This is what the map looks like from the same position (the 2nd one after I moved around a bit). They look different, but both have problems. The third map is what it should look like.

Code:
.-----------------.
|  /.....?ff.|.f  |   
|  ......f...V.f  |   
| ...........|..f |   
|.....ff..f.@|....|   
|---\........|.V..|   
|....\---@---+.|..|   
|.............\|..|   
|....ff..f.....+..|   
| ....f........|. |   
|  ...... |   .CC |   
|  ff.....f....C  |   
.-----------------.
.-----------------.
|  /.....?ff.|.f  |   
|  ......f...V.f  |   
| ...........|..f |   
|.....ff..f..|....|   
|---\........|.V..|   
|....\---@---+.|..|   
|.............\|..|   
|....ff..f.....+..|   
| ....f........|. |   
|  ..... |     .. |   
|  ff.....  |     |   
.-----------------.


Correct:
Code:
.-----------------.
|  /.....?ff.|.f  |   
|  ......f...V.f  |   
| ...........|..f |   Wild grass of varying height dominates the nearby
|.....ff..f..|....|   landscape. Meadows of tall prairie grass are interspersed
|---\........|.V..|   with patches of short, rugged vegetation. A wide diversity
|....\---@---+.|..|   of wildlife grazes throughout the grasslands of Derlith,
|.............\|..|   which make for excellent hunting ground.
|....ff..f.....+..|   
| ....f........|. |   You are in the borders of the Kingdom of Highport.
|  .....@......CC |   
|  ff.....@....C  |   
.-----------------.


Is it a problem with the interpretation of the "@" character?

I know this is tedious - thanks for the help guys.
Reply with quote
dhe
Newbie


Joined: 21 Apr 2008
Posts: 7

PostPosted: Wed Apr 23, 2008 11:24 am   
 
I've been working on it a little more, and I almost have what I want. I'm using:

Code:
#TRIGGER {^The World of Derlith} {}
#MXP <DEST Map EOF></DEST>
#LOOP 1,13 (#CONDITION {(*)} {#GAG; #MXP <DEST Map X=1 Y=%i>%1</DEST>} {Within|Param=13})


This sends the entire line (map and description) to the Map frame, and also removes it from my main frame.

Now my only two concerns:

* Somehow transfer the ANSI color to the Map frame (it just turns up green)
* I'm using #GAG, so the map still flashes in my Main frame before it is removed to the Map frame. This causes headaches for me. Any fix?
Reply with quote
Fang Xianfu
GURU


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

PostPosted: Wed Apr 23, 2008 11:44 am   
 
dhe wrote:
So I tried that, and it still looks funny. I changed my trigger to:

Code:
#TRIGGER {^The World of Derlith} {}
#MXP <DEST MAP EOF></DEST>
#LOOP 1,13 (#CONDITION {^({.|\|}%*{-.|\|  })} {#SUB {<DEST Map X=1 Y=%i>%1<br></DEST>}})


That is what you suggested, Fang.

That's not what I suggested. Look again.

dhe wrote:
* Somehow transfer the ANSI color to the Map frame (it just turns up green)
* I'm using #GAG, so the map still flashes in my Main frame before it is removed to the Map frame. This causes headaches for me. Any fix?


You need to use #cap to preserve the colour without some complex arrangement to capture and reproduce the ANSI codes (which is a lot of hassle). Unfortunately there's no way to fix #gag except by moving to CMUD.
_________________
Rorso's syntax colouriser.

- Happy bunny is happy! (1/25)
Reply with quote
Display posts from previous:   
Post new topic   Reply to topic     Home » Forums » zMUD 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