Page 1 of 1

Easy speedwalk?

Posted: Wed Jun 24, 2015 9:39 pm
by Nyyrazzilyss
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)

Re: Easy speedwalk?

Posted: Wed Jun 24, 2015 10:00 pm
by SlySven
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.

Re: Easy speedwalk?

Posted: Wed Jun 24, 2015 10:30 pm
by Nyyrazzilyss
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)

Re: Easy speedwalk?

Posted: Wed Jun 24, 2015 11:42 pm
by SlySven
Yoda almost wrote:Use the source, Luke
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? :)

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? ;)

Re: Easy speedwalk?

Posted: Thu Jun 25, 2015 12:57 am
by Nyyrazzilyss
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 :)

Re: Easy speedwalk?

Posted: Thu Jun 25, 2015 2:50 pm
by Nyyrazzilyss
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