Faction Wars 2 by D4RK3 54BR3
Research Facility Chiron by D4RK3 54BR3
Darkness by Bravo1
Tanx by Bravo1
Keep It Up by Kaiochao
Shootah by Kaiochao
Mouse Position by Forum_account
Ultimate Jigsaw by Hiro The Dragon King
LetterBox by Hiro The Dragon King
HDK Mouse And Keys by Hiro The Dragon King
----Just to be clear, the extent of this request is any form of mouse tracking. There are several different features that I would like to come out of this though. If I forget anything, I will ammend this post.
1) Mouse coordinates in relation to the client's actual computer screen. (Used in Ultimate Jigsaw)
----- Equivalent to JavaScript's event.screenX/Y.
2) Mouse coordinates in relation to a specifc interface element, in pixels from the top-left of the element.
----- Equivalent to JavaScript's event.clientX/Y.
----- Most likely used for map elements, but who knows?
3) Mouse coordinates in relation to client.screen.
----- This would mean tiled coordinates, most likely, along with pixel offsets.
----- I would much prefer the position in pixels from the bottom-left of the client's screen.
----- This must work outside of the range of the map element itself, of course compensating for map.icon-size and map.view-size.
4) Mouse coordinates in relation to the acutal map.
----As far as implementation goes, I've been so buried in my own implementation that I seriously can't think of another way. My preference for this is to use a winset() call to trigger the mouse tracking. I was thinking that a flag of some sort for elements would be prudent.
//1)
winset(client, null, "mouse-tracking=true")
//2)
winset(client, "element", "mouse-tracking=true")
//3)
winset(client, "map", "screen-tracking=true")
//4
winset(client, "map", "map-tracking=true")
----Interacting with the data once the client starts sending it is a much more complicated matter. In my library, Topic() has to catch all of the incoming data and route it to UpdateMouse(ElementID,PositionX,PositionY). This works because my script calculates the icon-size and view-size of the map element and scales the positions accordingly, allowing me to calculate screen_loc and map coordinates on the server without a buttload of winget() calls.
----Note though, that I have not yet added support for isometric maps, and I don't know if I will. This is mostly because the math is annoying and I am butthurt that I cannot set the height of the client's view.
Mouse tracking in general is okay, but controls based upon mouse tracking, like looking around or moving, actually feel clunky and unresponsive over the network for a BYOND game.
The reason for this is because there's a sort of instant feedback that's expected when mouse controls are being used. For example, if I move my mouse in Research Facility Chiron, I expect my character to immediately look towards the mouse and I expect the camera to scroll appropriately. And when it doesn't happen instantly, the network lag, no matter how little there may be, is highlighted and directly expressed to the player.
Because there's no client side processing, the game feedback from mouse tracking tends to be delayed when in a multiplayer environment.
This is why Faction Wars 2 and Research Facility Chiron never felt smooth and comfortable on BYOND, and it's actually a part of the reason why these games weren't too successful; clunky and unresponsive mouse controls are really tedious to play with and get in the way of fun.