ID:161860
 
Currently it seems there is a bug where mouse dropping and dragging is screwed up when you drop something outside of the entire game window. Is this going to be fixed in the future or should I just design the game around this feature?
An example would of been nicer but, as most programmer should do, you should safety check if the object is being dropped in the appropriate location.

Don't assume that MouseDrop() was made for items picked/dropped only in the map element - it was meant for stats as well (and grids... and other elements...)

In the DM Ref about MouseDrop(), there are many documented procedures that you can use to verify (safety check) that the object is being dropped where you want, including:

[Note: The words in the (parenthesis) are examples of what you should safety check]

- over_location (if you want the item to drop, try checking if the over_location (drop location) is a /turf via isturf(); if you want a trade option to popup, check if the over_location is a /mob via ismob(), etc)

- src_control (Make sure that the item is being dragged from an appropriate location, such as from a specific grid ID or the map element)

- over_control (Make sure that the location is a map element --> make drop happen, a grid element --> pickup, etc.)

- params for other cool add-on effects (if alt is being held, activate the item (if possible) rather than pickup; if ctrl is held, call the items "info" verb, etc)



Small edit:
Here's a nice output of what shows up for each option when a client drops an object. Try holding ctrl, alt and/or shift while dropping too :O!

client/MouseDrop(atom/src_object,atom/over_object,src_location,over_location,src_control,over_control,params)
var/msg = {"
DEBUG
----
Object dropped =
[src_object] ([src_object.type])
Object under mouse =
[over_object] ([over_object.type])

Starting element/location of dropped item =
[src_location]
Element/location under mouse =
[over_location]

Element ID from beginning point of dropped item =
[src_control]
Element ID under mouse:
[over_control]

Params (params format):
[params]

Params Content(list):"}

var/list/X = params2list(params)
for(var/Y in X) msg+="\n[Y] = [X[Y]]"
world.log << msg
In response to GhostAnime
What I was saying is try dropping the object not in the game window, but outside of it, as in on your operating systems desktop. When you bring the mouse back to the BYOND game, the item that was being dragged on the cursor can no longer be dropped.


My solution would be to simply automatically drop the item to the floor underneath the player when they move, so in effect people can't move around while carrying items on the cursor, and in case they do go out of the game window the item comes back, although their cursor might not function the same way anymore. Not the best solution but it's better than the percieved alternative, which is having the item disappear from the face of the world if you drop it outside of BYOND.


How exactly do I force a premature MouseDrop against the client's will? Is it a matter of simply filling in the parameters manually? I thought I tried this but it didn't work.
In response to Obs
Obs wrote:
Not the best solution but it's better than the percieved alternative, which is having the item disappear from the face of the world if you drop it outside of BYOND.

I'm failing to see how this is counterintuitive in any way.
In response to Garthor
Garthor wrote:
Obs wrote:
Not the best solution but it's better than the percieved alternative, which is having the item disappear from the face of the world if you drop it outside of BYOND.

I'm failing to see how this is counterintuitive in any way.


Failing miserably.