proc
bound(loc,list/params = new)
for(var/a in params)
var
x1 = text2num(a)
y1 = text2num(copytext(a,findtext(a,",")))
_to = findtext(a,"to")
x2
y2
if(_to)
x2 = text2num(copytext(a,_to))
y2 = text2num(copytext(a,findtext(copytext(a,_to),",")))
else
x2 = x1
y2 = y1
new/pixel(loc,x1,xy,y1,y2)
pixel
parent_type = /atom/movable
New(loc,x1,x2,y1,y2)
loc = loc
step_x = x1
step_y = y1
bound_x = x1
bound_y = y1
bound_width = x2-x1
bound_height = y2-y1
..()
Problem description:
I'm trying to simplify complex bound shapes; I know there was a thread about this a while back, but when I tried making a simple little proc for it I find myself having trouble. I was just wondering why this doesn't work? Thanks.
Also:
If you can't tell, this process will not work properly with negative arguments; if you want to deal with distance with this proc, use absolute values.
The format of using this proc would be like so:
mob/verb/Create_Object()
bound(src.loc,list("1,1 to 2,4", "2,4 to 5,12"))
(untested)