Page 2 of 2

Re: 7 years ago ... CMUD mapper help needed

Posted: 11 May 2017 22:31
by Kitriana
Tarax the Terrible wrote:
gorboth wrote: It features maps that are quite a bit cooler than zmud maps! ;-)
cmud supporting gmcp allows them to make a window to include magic map beside zmud type map if they want, i believe
How do you do this?

Re: 7 years ago ... CMUD mapper help needed

Posted: 11 May 2017 22:40
by Ody
Kitriana wrote:
Tarax the Terrible wrote:
gorboth wrote: It features maps that are quite a bit cooler than zmud maps! ;-)
cmud supporting gmcp allows them to make a window to include magic map beside zmud type map if they want, i believe
How do you do this?
I love the magic map. I'd also like to know how.

Re: 7 years ago ... CMUD mapper help needed

Posted: 12 May 2017 02:58
by Tarax the Terrible
First ask someone smarter than me...

But here is why I reckon it is possible reading Mercedes post here tells us the map is in gmcp data available to the client

https://www.genesismud.org/forums/viewt ... =37&t=2947
The GMCP interface for maps has been changed. The complete ASCII map is now passed with GMCP, along with the coordinates. This way the client doesn't have to rely on the maps being available before from a certain location. For this Room.Info has been amended with the coordinates. This is called when the player moves to another room.



Code:
Room.Info

Upon subscription of the Room package it will send information about the
environment the player is in. The payload for each room is an object with
the following keys:

id - A unique identifier for the room. This will remain static as long
as the code of the room isn't moved.
short - The short description of the room.
exits - An array listing the exits of the room.
doors - An array listing the exits of the room reachable through a door.
x, y - Coordinates of the room on the map. Omitted if the room isn't on
the map. Note x=0 will never happen, so you can test for that.
The zoomx, zoomy are only given if there is a zoomed map.

Example: { "id" : "iX5PnH",
"short" : "A pond with a waterfall.",
"exits" : [ "up", "east" ],
"doors" : [ "north" ],
"x" : x, "y" : y, "zoomx" : zoomx, "zoomy" : zoomy }




In addition, a new Room.Map has been created, that is called whenever the player moves to a new section of the map.



Code:
Room.Map

This package is sent when a player enters into a new map area. It contains
the map graphics and optionally the zoomed map graphics.

Example: { "map" : "map graphics",
"zoom" : "zoomed map graphics" }




Note, the Room.Map is NOT called when the player moves to an area that isn't covered by the Map. Whether the player is on the map can be determined by the Room.Info.X being positive (X=0 will not happen on maps). The presence of the zoom function can be determined by the Room.Info.zoomx being positive.
Then work out how to call that gmcp data up in cmud

http://forums.zuggsoft.com/forums/viewt ... p?p=158455
Explains gmcp in cmud

From that to show map on main screen a command something like this is needed

#SHOW %gmcp.Room.Map


But have to work out how to call the "map graphics" bit. I think it is.

#SHOW %gmcp.Room.Map.map


Once you have a command that shows the map finally need to work out how to send it to its own dedicated chat window.
There is an example here of ppl at another mud sending gmcp data to a new window

http://www.aardwolf.com/wiki/index.php/Clients/CmudGMCP

So try

Code: Select all

execwin MagicMap { #clr }
#win MagicMap  {%gmcp.Room.Map.map}
Lol would be pretty amazing if that works

If it does, make a trigger for it to fire every time game sees "exit"

If not ask the guys posting on the mud client section of the forum I'm sure if it is possible they will tell u how.

Re: 7 years ago ... CMUD mapper help needed

Posted: 13 May 2017 02:13
by Tarax the Terrible
Installed trial of cMud to play around with it..
It is definitely possible but still need some expert help to make it usable.

I am not familiar with cMud at all and I had trouble making a new window at first, but then got it to work even tho I didn't do anything different.
Just used two commands to see if they work.

To Create the Window

Code: Select all

#window MagicMap
And to send magic map data to the window.

Code: Select all

#window MagicMap {%gmcp.Room.Map.map}

Here are some screenshots.

Called the map up on the game screen as well to compare them.

So if you could work out how to control when the text being shown in the Magic Map window moves to a new line you are all set.

Re: 7 years ago ... CMUD mapper help needed

Posted: 13 May 2017 02:26
by Tarax the Terrible
Package editor looks promising, digging through the settings to see if I can find anything.
Session emulation and wordwrap might be the key...
Lol turned off word wrap and thought I was on to something and instead it put it all on one line!

About reached the limits of my tinkering powers.

You could maybe work around it by measuring the length of the legend line of text from the map and resetting the window width on the fly, but I am sure there could be a more elgant solution

Was thinking on on this how you could use string functions to break it up into the correct line width.
Legend line would have been easiest to use to calculate the proper width, but just realised this isn't included in the .map

If there is something I'm missing which can tell gmcp users the correct width for each map pls let me know.