Generic Mapping Script

All and any discussion and development of the Mudlet Mapper.
GErswin
Posts: 17
Joined: Fri Jun 09, 2017 6:12 am

Re: Generic Mapping Script

Post by GErswin »

Unfortunately I had some issues the first time I tried it. I did a loop and when I came back to an earlier room, it created it as a new room. And did the same for all subsequent rooms that I revisited, re-creating them all as new rooms.

I recorded a video: https://youtu.be/bRThIcPmW2I

The room ("Market Square of Kalaman") is created as #67, but when I come back to it, it's recreated as #89. Then when I go back south, each of those rooms is recreated as well.

Jor'Mox
Posts: 1146
Joined: Wed Apr 03, 2013 2:19 am

Re: Generic Mapping Script

Post by Jor'Mox »

Okay, so that is actually just part of the learning process of creating area maps. Since the script can't assume that rooms with the same name and exits are actually the same room, it is on the user to identify when two rooms that don't line up on the map are actually the same, then "shift" one to be colocated with the other, and then use the "merge rooms" command to combine them into a single room. So, in this case, once the second Market Square of Kalaman room was created, I would have done this: "shift north", "shift north", "shift east", "merge rooms"
Then I would have selected that room, and the few trailing rooms south of it on the map and moved them make the path into a proper rectangle again, because I think it looks better visually.

Note that the reverse is also true, in that sometimes you will end up in a room with the same name and exits as some other room already on the map, which you know are different rooms, but because of how you went to them, the map thinks they are the same room (it actually searches in the direction you move for a room that matches name and exits with the room you moved into, and will connect any distance if it finds a match). This would have been useful in your situation if the path looping around had lined up vertically with where it started, in that it would have jumped over a space and connected the market square rooms automatically, but can be problematic if you, for example, starting mapping along a named road from the north, then go back and start mapping the same road from the south, in which case there is a good chance it will mess up, and link things together too early. Just something to be aware of.

You probably also will want to make use of the ability to create distinct map areas. So you would map your town as one area, then as you leave town, you would "set area area_name" to move the room you are standing in to the newly named area. This not only helps to make the map easier to comprehend, but can also make things more sensible, as towns are often much bigger on the inside than the outside, in terms of room count.

In general, you want to be sure you go over the different aliases available to you for mapping, as they are all there to solve certain issues that can arise. If you need help figuring out what to do, or how to make something work the way you want it to, just let me know, and I can help you out.

GErswin
Posts: 17
Joined: Fri Jun 09, 2017 6:12 am

Re: Generic Mapping Script

Post by GErswin »

How do I use the aliases? They don't seem to be getting created.

They're in a local function which I assume isn't called on its own, but I can't figure out how to call it.

Jor'Mox
Posts: 1146
Joined: Wed Apr 03, 2013 2:19 am

Re: Generic Mapping Script

Post by Jor'Mox »

The aliases are all created as temp aliases, and the fact you are able to "start mapping" means that all of them have been created, as that all happens at the same time. You won't see them as aliases in your GUI however, so you shouldn't worry about that part.

The most common reason for someone to think the aliases aren't working is trying to use them when they aren't in mapping mode. You need to "start mapping" first, and then you can use the other aliases by typing them in like any other alias.

GErswin
Posts: 17
Joined: Fri Jun 09, 2017 6:12 am

Re: Generic Mapping Script

Post by GErswin »

"start mapping" has never worked for me - I have to manually fire the function with lua map.start_mapping("myTestArea")

("Lua" is an alias I have for firing off Lua code)

Here's another video of me trying the aliases. Maybe you can see what I'm doing wrong: https://www.youtube.com/watch?v=5jiBVCOWHX4

Thanks again for the help.

Jor'Mox
Posts: 1146
Joined: Wed Apr 03, 2013 2:19 am

Re: Generic Mapping Script

Post by Jor'Mox »

Ah, I see the problem. This script uses the Simple Window Manager script to create and size the mapper GUI object (note that the SWM script is linked to just below the code for this script in the first post). So when the sysConnectionEvent occurs, and the config() function is called, it fails due to the SWM script being absent before the aliases can be created. If you add in the Simple Window Manager script and reconnect to the game, all the aliases should get created, and you should be able to verify this by looking at the map.aliases table.

Note that the proper syntax for the "start mapping" alias is as follows: start mapping OR start mapping My New Area
I noticed you were including quotes and parentheses and such in the video you linked here, so I just wanted to straighten that out for you.

User avatar
demonnic
Posts: 886
Joined: Sat Dec 05, 2009 3:19 pm

Re: Generic Mapping Script

Post by demonnic »

I just wanted to say thanks for making this. I've been looking this over and it should be easy to get working for Geyser and with the msdp I'm receiving from LotJ. Super handy to have a nice generic one out there. If I weren't tying the map into other Geyser elements I've already created I'd probably just take it as is =)

Jor'Mox
Posts: 1146
Joined: Wed Apr 03, 2013 2:19 am

Re: Generic Mapping Script

Post by Jor'Mox »

Yeah, doing it with Geyser would actually make more sense for the generic script it is intended to be. But, as you probably suspect, this was derived from a script that I initially wrote for the game I play, and is part of a much larger project, for which the Simple Window Manager script was developed (because Geyser was painfully slow when I was testing it out). I didn't feel like going through and learning enough about Geyser to make it all work, so I left it as it was. If you make the necessary changes just to switch the GUI management over to Geyser, would you mind posting that version here for people to use?

User avatar
demonnic
Posts: 886
Joined: Sat Dec 05, 2009 3:19 pm

Re: Generic Mapping Script

Post by demonnic »

Not at all, I'll do that before I hook my MSDP events into it and post it back here. May not be today but hoping by end of the weekend.

User avatar
Zaphob
Posts: 180
Joined: Wed May 09, 2012 8:07 am
Location: mg.mud.de

Re: Generic Mapping Script

Post by Zaphob »

GErswin wrote:("Lua" is an alias I have for firing off Lua code)
Sure you do, it's been in Mudlet standard for quite some time now. Which version are you using then? :mrgreen:

Post Reply