edit: is there any hook to se if a breakable entry thing has been damaged
edited 1×, last 26.06.11 01:42:45 pm
Scripts
ai: nearest breakable
ai: nearest breakable
1

local rect = {x, y, width, height}
xsize, ysize = (1+map("xsize")), (1+map("ysize"))
output = {}
for i = rect.x+rect.y*xsize, (rect.x + rect.width)+(rect.y + rect.height)*xsize -1 do
	local x,y = i%ysize, math.floor(i/ysize)
	if entity(x, y, "type") == 25 then table.insert(output, {x,y}) end
end
xsize, ysize = (1+map("xsize")), (1+map("ysize"))
cache = {}
for i = 0, xsize * ysize -1 do
	local x,y = i%ysize, math.floor(i/ysize)
	if entity(x,y,"type") == 25 then table.insert(cache, {x,y}) end
end
break - if you are talking about damaging without breaking: nope, no hook for that.
1
