Just wondering if there's an 'easy speedwalk' precoded in the mudlet mapper, and if not what the event called would be for someone doubleclicking on a room.
What i'd like to have happen is doubleclicking on any room in the map speedwalks you to that room from whatever room is currently marked by centerview (assuming a path can be created between the two points)
Easy speedwalk?
- SlySven
- Posts: 1023
- Joined: Mon Mar 04, 2013 3:40 pm
- Location: Deepest Wiltshire, UK
- Discord: SlySven#2703
Re: Easy speedwalk?
It is not obvious but when you double click on a room, a path is calculated and put into a pair of globally accessible lua tables called "speedWalkPath" and "speedWalkDir" the former contained the list of rooms to visit in order to get there and the latter the exit directions to use to do so.
There is currently a bug in the latter if there are "parallel edges in the graph" to put it in "Boost Graph Library" terms or in more easy to understand words "more than one valid exit between one room and the next in a step of the speed walk path" then the path may use a locked or non-optimum exit rather than the "best" one. All current Mudlet versions have this bug but it is something that I personally am aware off and want to fix when I can - in the meantime trust the list of rooms but not the exits, to be the "best route".
Once those two tables have been written, the Mudlet Lua subsystem will attempt to call a user provided function called "doSpeedWalk" with, it seems, no arguments - so you need to write something called that, that can than use those data tables.
There is currently a bug in the latter if there are "parallel edges in the graph" to put it in "Boost Graph Library" terms or in more easy to understand words "more than one valid exit between one room and the next in a step of the speed walk path" then the path may use a locked or non-optimum exit rather than the "best" one. All current Mudlet versions have this bug but it is something that I personally am aware off and want to fix when I can - in the meantime trust the list of rooms but not the exits, to be the "best route".
Once those two tables have been written, the Mudlet Lua subsystem will attempt to call a user provided function called "doSpeedWalk" with, it seems, no arguments - so you need to write something called that, that can than use those data tables.
-
- Posts: 334
- Joined: Thu Mar 05, 2015 2:53 am
Re: Easy speedwalk?
Thanks! Knowing that the command was doSpeedWalk, I was able to add it easily (not to mention searching on the command, and finding where it was in the instructions that I should have re-read)
- SlySven
- Posts: 1023
- Joined: Mon Mar 04, 2013 3:40 pm
- Location: Deepest Wiltshire, UK
- Discord: SlySven#2703
Re: Easy speedwalk?
Instructions, instructions, you mean you ACTUALLY RTFM! Good grief, man, we don't want everyone to do that, otherwise people will start finding the, erm, discrepancies and updating the manual - where will it end?Yoda almost wrote:Use the source, Luke
I mean, how can I keep up the appearance of seeming to know intricate stuff about Mudlet from munging with the code if people start asking about things that have actually been written up?
-
- Posts: 334
- Joined: Thu Mar 05, 2015 2:53 am
Re: Easy speedwalk?
Just as an aside on that, it wouldn't hurt if doSpeedWalk() doesn't exist, for doubleclicking on a room in the mapper to give an error message indicating as much
-
- Posts: 334
- Joined: Thu Mar 05, 2015 2:53 am
Re: Easy speedwalk?
Just want to report a thread related bug: In 2d mode, everything working as above.
In 3d mode however, a single click (not double) on a room calls doSpeedWalk
In 3d mode however, a single click (not double) on a room calls doSpeedWalk