ID:163289
 
turf/MouseUp(location,xx,yy)


This was made in 3.5, xx and yy stand for icon_x and icon_y. How would this work in 4.0 I'm guessing they would be params but I have no idea how to use params xD And yes I did look at the refrence.
turf
MouseUp(object,location,params)
var/L[]=params2list(params)
world<<L["icon-x"]

In response to Ease
turf
map
icon = 'map.png'
MouseUp(object,location,params)
var/L[]=params2list(params)
var/xx = L["icon-x"]
var/yy = L["icon-y"]
var/turf/loca = location
var/x3 = ((loca.x-130) * 32) + xx
x3 = round(x3/2)
var/y3 = ((loca.y-92) * 32) + yy
y3 = round(y3/2)
if(x3 > world.maxx || y3 > world.maxy)
return


I tried doing this but it didn't work it gave me this error

runtime error: Cannot read "default.map1".x
proc name: MouseUp (/turf/map/MouseUp)
usr: Miran (/mob/Player)
src: the map (132,95,1) (/turf/map)
call stack:
the map (132,95,1) (/turf/map): MouseUp(the map (132,95,1) (/turf/map), "default.map1", "icon-x=26;icon-y=19;left=1")
Miran94 (/client): MouseUp(the map (132,95,1) (/turf/map), the map (132,95,1) (/turf/map), "default.map1", "icon-x=26;icon-y=19;left=1")
In response to Miran94
They were replaced by the control and location arguments and moved into params. An easy way to see how it all works:

client/MouseUp(object,location,control,params) 
src << "Object: [object]"
src << "Location: [location]"
src << "Params:"
for(var/P in params)
src << "[P] = [params[P]]"

In response to Nadrew
I know I read that in the DM guide but I tried a new method of doing it I posted my snippet.
In response to Miran94
Ah! I got this problem a lot last night before I worked it out. You need to use text2num() - that'll fix everything. It's just that the params are saved strictly as text so you can't do any maths with them!

~Ease~
In response to Ease
An example would be nice but thats actually clever.
In response to Miran94
I tried this and it works sadly MouseUp() is slow

        MouseUp(location,control,params)
var/L[]=params2list(params)
var/xx = text2num(L["icon-x"])
var/yy = text2num(L["icon-y"])
var/turf/loca = location
var/x3 = ((loca.x-130) * 32) + xx
x3 = round(x3/2)
var/y3 = ((loca.y-92) * 32) + yy
y3 = round(y3/2)
if(x3 > world.maxx || y3 > world.maxy)
return
In response to Miran94
Thanks to all those who helped me (Nadrew and Ease) but is there a way to speed up the proc?
In response to Miran94
I read over it, and I just can't see anything in it that might make it slow. There's no real loops, or anything that might get stuck for a while. Are you sure its not something around or near this code that is slow? Any loops that are involved with it that you haven't shown us?

~Ease~