client
var
startPx = 0
endPx = 0
startPy = 0
endPy = 0
MouseMove(object,location,control,params)
var/list/_params = params2list(params)
endPx = screenLocToPx(_params["screen-loc"])[1]
endPy = screenLocToPx(_params["screen-loc"])[2]
MouseDrag(src_object,over_object,src_location,over_location,src_control,over_control,params)
var/list/_params = params2list(params)
startPx = screenLocToPx(_params["screen-loc"])[1]
startPy = screenLocToPx(_params["screen-loc"])[2]
MouseDrop()
if(startPx && startPy)
var/pxDiff = startPx - endPx
var/pyDiff = startPy - endPx
for(var/robot/R in bounds(locate(1,1,1),startPx,startPy,pxDiff,pyDiff))
R.influence = mob
startPx = 0
startPy = 0
Problem description:
Something is off with my math or something, because what this is supposed to do is let me click+drag to highlight an area, and any robots in that area get added to my influence, but for some reason, my selections produce... strange... results, and I really can't figure out why. If I change the for() to set turfs to black, this is the result, and there doesn't seem to be any real consistency.
Sometimes it's near my mouse, sometimes it seems offset by a specific amount, sometimes it's to the left.
I just don't know anymore, all I want to do is make tiny robot based RTS :(
However that's unfortunately not going to be very scalable for my game, since I'm hoping to have hundreds if not thousands of bots running around at any given time, and looping every single one for every single mouse drag operation isn't going to feasible.