update_pos(params)
var/list/l = params2list(params) //convert the param string to a list.
var/list/l2 = splittext(l["screen-loc"],",") //split the screen coordinates at the comma.
//now we need to split the two strings in l2 into separate strings for processing.
var/list/lx = splittext(l2[1],":")
var/list/ly = splittext(l2[2],":")
//now, convert the text into numbers and do the math to get the on-screen coordinates of the mouse action.
var/sx = (text2num(lx[1]) * 32)
var/sy = (text2num(ly[1]) * 32)
var/wx = src.bound_x + sx
var/wy = src.bound_y + sy
usr.test.loc = locate(wx/32,wy/32,1)
usr.test.step_x = text2num(lx[2])
usr.test.step_y = text2num(ly[2])
Problem description:
Is there a way to get this specific bit of code to work with, and take into consideration, transform*=2 for my default map? When I try it, the location seems off, especially the closer the mouse is to the player/center.