Mudlet/Mudlet

Function analogous to getMousePointer() for the Mapper

Opened this issue · 1 comments

Brief summary of issue / Description of requested feature:

It might be useful to have an analog for getMousePointer() that functions within the Mapper window; instead of the relative mouse coordinates, it could return an x, y, z for the nearest valid room coordinates.

Optional parameters could specify a scale (e.g., 1.0 would return only whole number coordinates), and/or whether the function should look for the coordinates of the nearest existing room or simply the nearest set of valid coordinates regardless.

I think there might be a variety of use cases, but the one I personally have in mind is using a sequence of mouse clicks to specify the three points along a custom line, e.g.:

mX1, mY1, mZ1 = getMapMousePointer()
mX2, mY2, mZ2 = getMapMousePointer()
mX3, mY3, mZ3 = getMapMousePointer()
addCustomLine(1, {mX1, mY1, mZ1}, {mX2, mY2, mZ2}, {mX3, mY3, mZ3}}, "climb Rope", "dash dot dot line", {128, 128, 0}, false)

In just the 2D mapper or the 3D one as well? 😀

<aside>The latter could be tricky given that the mouse pointer can only be positioned in a 2-dimensional plane across the 3-dimensions (with it's origin at the eye/camera position and an almost arbitrary orientation). OTOH The code that initiates a speedwalk when a room is {single-}clicked on in the 3D mapper does do something like this to determine which room is "closest" to the pointer. And, if I ever want to draw custom exit lines in all three dimensions - so they can be shown in the 3D map - then I will need to get my head around this sort of stuff...</aside>