Mudlet mapper script Q&A

All and any discussion and development of the Mudlet Mapper.
User avatar
Akaya
Posts: 412
Joined: Thu Apr 19, 2012 1:36 am

Re: Mudlet mapper script Q&A

Post by Akaya » Wed Oct 15, 2014 5:19 pm

I should probably go into more detail as I think I'm misunderstood...

When you right-click a selected room on the mapper, you can choose custom exit lines from the dropdown menu. You can then draw your custom exit line. You then right-click and select finish. Afterwards, you can click your newly created exit line to edit. Each point on the exit line has a circle of which can be clicked and dragged wherever you want on the map. THIS is the feature that has me wondering. How is this implemented? Correct me if I'm wrong, but doesn't this require tracking of mouse coordinates? Can this behaviour (tracking the mouse coordinates to move a label (I'm guessing its a label) ) be applied to a geyser label? or even native mudlet label?

User avatar
SlySven
Posts: 874
Joined: Mon Mar 04, 2013 3:40 pm
Location: Deepest Wiltshire, UK
Discord: SlySven#2703

Re: Mudlet mapper script Q&A

Post by SlySven » Wed Oct 15, 2014 5:34 pm

Possibly, but I wouldn't want to make any promises at this time... at a guess I suspect Geyser would need some work to make it respond to the additional information generated by such "mouse select/move" operations, indeed it might actually be easier to do for the "native" Mudlet labels.

User avatar
Akaya
Posts: 412
Joined: Thu Apr 19, 2012 1:36 am

Re: Mudlet mapper script Q&A

Post by Akaya » Sun Oct 26, 2014 6:20 pm

The setDoor function door status parameter...
The door status as a number - 0 means remove door, 1 means open door (will draw a green square on exit), 2 means closed door (yellow square) and 3 means locked door (red square).
Could we get a 4 to represent a window (cyan square)?

User avatar
SlySven
Posts: 874
Joined: Mon Mar 04, 2013 3:40 pm
Location: Deepest Wiltshire, UK
Discord: SlySven#2703

Re: Mudlet mapper script Q&A

Post by SlySven » Fri Oct 31, 2014 3:52 am

Well actually those colour codes and interpretation is entirely arbitrary - there is no intrinsic logic, unless script writers code it for any "door" type, and really "door" was just used as a representation of the fact that users might like to indicate limitations about a particular exit from a room, hence the original was just for an "open" and a "closed" case, though yours truly proposed "locked" right back at the beginnings of my contributions to Mudlet. The open/closed/locked model seems to me to cover the main situations we'd like to support and indeed I'm only just coding them to be shown for the up/down/in/out exits this week as I type this. Vadi has suggested in the past that the radio buttons I put onto the rather detailed room exits' GUI for 3.0 to control doors directly should really be a drop down dialog so adding more colours/meanings is something that could be considered if/when that is done but it won't be backwards compatible which may complicate things.

Also, be advised, about that setDoor() command - I will be tightening up on that so that it will only put a door on a normal exit/stub exit/special exit that actually exists (to allow tidying up of code there is not such a limit on removing doors) - as it is currently possible to set a door when there wasn't an exit with that command which has raised queries in the past. To cope with the fact when exploring a MUD that you find a door but cannot actually go through it to see what is on the other side - that is why both the GUI and the Lua command do allow you to set a door on a stub exit - ah, dang nabbit I still have to ensure that the door is shown on the stub which is not happening at the moment.

apelogic
Posts: 4
Joined: Sun Feb 12, 2017 7:03 am
Location: Austin, TX

Re: Mudlet mapper script Q&A

Post by apelogic » Tue Feb 14, 2017 1:43 am

HELLO!

My backround:
  • Some Python, C#
  • New to LUA
  • New to Mudlet
Let me start by saying I think you guys built something awesome here. However, I'm having a little trouble getting started with mapping scripting.

This is what I need to get started:
  • Do I need to create triggers or is there a main()/events
  • What is the main function that runs when you start mapper?
  • How do I access the Map buttons at the bottom of the screen via lua? (buttons should have some name, evnet, or event names right?)
  • What are the list of events or states that I need to handle
  • What are the objects I need to map the data to? map is an object right?
First pain point: Hit the map button and I find out I have to write/download a script for it to work.
We have this tool bar at the bottom of the Map Screen with buttons that do nothing:
Image
Wish the buttons did have basic functionality and the scripting were for automation or extra functionality.

Second Pain Point: I don't even know where to start. The only help link I found was: http://wiki.mudlet.org/w/Mapping_script
The code there gets me this result:
[ INFO ] - Auditing of a loaded/imported/downloaded map starting...
[ OK ] - Auditing of map completed, in 0.00025889 seconds. Enjoy your game...
So now I just have something with no idea where to go. The Generic Mapper seems to have some issue with a string in line 121 which I can't figure out (it also seems to require me to write triggers for it which I'm hoping is avoidable and there are some other capture methods). All other scripts seem to be using XML and it's annoying to read.

http://wiki.mudlet.org/w/Manual:Lua_Fun ... _Functions just shows a lot of functions and there are some missing ones like getMapEvents()


Thanks for the help, sorry for the length

User avatar
Vadi
Posts: 4554
Joined: Sat Mar 14, 2009 3:13 pm

Re: Mudlet mapper script Q&A

Post by Vadi » Tue Feb 14, 2017 8:21 pm

Hey there
apelogic wrote:
  • Do I need to create triggers or is there a main()/events
  • What is the main function that runs when you start mapper?
  • How do I access the Map buttons at the bottom of the screen via lua? (buttons should have some name, evnet, or event names right?)
  • What are the list of events or states that I need to handle
  • What are the objects I need to map the data to? map is an object right?
- there is no main event, you'll want to create triggers or use gmcp/whatever else events from your game to track your position. The only event of sorts you need to hook on is define a doSpeedWalk() function - see Making your own mappings script.
- mapOpenEvent is raised
- http://wiki.mudlet.org/w/Manual:Lua_Fun ... centerview, http://wiki.mudlet.org/w/Manual:Lua_Fun ... setMapZoom, http://wiki.mudlet.org/w/Manual:Lua_Fun ... etGridMode, http://wiki.mudlet.org/w/Manual:Lua_Fun ... ImageLabel, there's a bunch ;)
- just one - the doSpeedWalk() really for when someone double-clicks on the mapper room. The rest are up to you - player tracking and so on that interacts with the game.
- mudlet stores the map data for you, you use API to interact with the stored data.
apelogic wrote: First pain point: Hit the map button and I find out I have to write/download a script for it to work.
We have this tool bar at the bottom of the Map Screen with buttons that do nothing:
Image
Wish the buttons did have basic functionality and the scripting were for automation or extra functionality.
It does suck, but every MUD is rather different so it's hard to impelement player tracking that'll work across all of them. All of the buttons do work - you just need to have a map in order for them to do anything. Perhaps we should include a sample, obviously fake map so the first impression isn't straight up dissapointment.
apelogic wrote: Second Pain Point: I don't even know where to start. The only help link I found was: http://wiki.mudlet.org/w/Mapping_script
The code there gets me this result:
[ INFO ] - Auditing of a loaded/imported/downloaded map starting...
[ OK ] - Auditing of map completed, in 0.00025889 seconds. Enjoy your game...
It's not a bad link, did you have any difficulty with the 'making your own mapping script' section? Happy to improve it.
apelogic wrote: So now I just have something with no idea where to go. The Generic Mapper seems to have some issue with a string in line 121 which I can't figure out (it also seems to require me to write triggers for it which I'm hoping is avoidable and there are some other capture methods). All other scripts seem to be using XML and it's annoying to read.
If there were capture methods available that would work on all MUDs, mapping scripts would be provided by Mudlet. They are in fact provided for a few games - 3k, IRE, that people have written and are bundled. The rest... player tracking, recognising rooms, all of that stuff is different by the game so you can't have something that works for everyone.

Also no Mudlet scripts are in XML, XML is just the serialisation format - you've gotta import the scripts into Mudlet.

Hope that helps, let us know if there's any other questions you've got and we're happy to help & improve the experience.

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

Re: Mudlet mapper script Q&A

Post by Jor'Mox » Tue Feb 14, 2017 8:41 pm

As the person who wrote the Generic Mapping Script, I'm curious about the error you mention, as I just tested the current version on both Mudlet 2.1 and in the most recent 3.0 version, and didn't encounter any errors. If you can get me the error information, I may be able to help.

As for avoiding making triggers, there is no way around it. ANY map script needs some sort of event to hook onto so as to get the necessary information. Some MUDs provide such via GMCP, etc., and other don't. My script was written for games that don't provide any of the back-channel information, and so relies on the user to capture and store the necessary information via triggers that are appropriate to their game. As Vadi mentioned, all games are different, so it isn't possible to make a single set of triggers that will work for everyone. That said, some games make it pretty simple, and make it easy to distinguish exits and room names, or even make it so that they can be displayed in the prompt.

If you have specific questions, I recommend bringing them up on the thread for the script, and I'll be happy to help.

apelogic
Posts: 4
Joined: Sun Feb 12, 2017 7:03 am
Location: Austin, TX

Re: Mudlet mapper script Q&A

Post by apelogic » Tue Feb 14, 2017 10:17 pm

@Jor'Mox I added a comment with the error to your post just now to keep it organized here
hopefully I got the full error. There doesn't seem to be a way to copy/paste the error.

@Vadi
Are those the functions called by the buttons? It'd be nice if there was some documentation stating that, I actually would like to access the area selector if I needed to change areas automatically.
It does suck, but every MUD is rather different so it's hard to impelement player tracking that'll work across all of them. All of the buttons do work - you just need to have a map in order for them to do anything. Perhaps we should include a sample, obviously fake map so the first impression isn't straight up dissapointment.
Doesn't have to be a fake map. Could just implement a Profile Map that does not track player nor has an active doSpeedWalk(). User can manually create the map. To play with, or just if he wants to draw maps without automation. Very basic and can be modified.
It's not a bad link, did you have any difficulty with the 'making your own mapping script' section? Happy to improve it.
I guess I was confused. I did not realize that doSpeedWalk() was required function. I thought it was optional. I don't like doing speedwalk so I never planned on implementing it :p

Thanks for the help. I'm sure I'll return later once I tinker more with it.
I really do love how clean the interface feels.

User avatar
Vadi
Posts: 4554
Joined: Sat Mar 14, 2009 3:13 pm

Re: Mudlet mapper script Q&A

Post by Vadi » Wed Feb 15, 2017 5:26 pm

You can use centerview () to change the area. Appreciate the feedback, and have fun playing with it! There's some pretty cool maps you can come up with.

Post Reply

Who is online

Users browsing this forum: No registered users and 2 guests