ID:1296731
 
(See the best response by Kaiochao.)
Code:


Problem description:

Is there any way to get a Clicks location on the map?
Best response
Have you checked the DM Reference?
yep
I'm just trying to make a simple movement code. That when something is clicked it is selected and on DoubleClick it moves on a spot. But can't get the loc of the target.
Or I could use Click to select a unit and use the buttons to move the unit.
Allright what I'm trying to do is click on a unit and move it to a spot when I doubleClick.

I've though and coded some approaches but they are ineficient
atom/Click()
atom/DblClick()
I've thought of the atom/Click.
My situation is that I don't want o use turfs. I mean, I need a variable that holds the location I click on.
Check out the lib Click2Move

Isn't the location var already there?
yeah but the location var is being provided by a turf. I mean the unit moves to the turfs loc. What I'm saying is it possible in the byond enviroment to get the loc of a click without using an atomic object?
For example to get the loc just by clicking, not on an object.
http://www.byond.com/developer/HirotheDragonKing/ HDKMouseAndKeys

This will give you a location without necessarily needing a click. As it is though, you could just store the turf's loc in your variable instead.

client
Click(O)
if (unitSelected)
targetLocation = O.loc // Or just O
else
..()
That library was exactly what I needed thanks for your help! The thing is I don't have turfs, if I use turfs I'll have other complications. Otherwise I'd take the loc out of the turf.
"The thing is I don't have turfs"

uhhh...
In response to Jittai
I said the exact same thing in my head.