I need a help here.
I need to find in a area what is stairs and holes.
I made a list (n1, n2, n3 and n4) for the differents purposes of my script and also made this:
The problem is: "tile:getItems()" do not get the static items. How can I do that?
Another thing, I tried to use "tile:hasFlag(flag)" too, but I'm stucked on the same thing, how can I find the stairs? (Usable and walkable)
I need to find in a area what is stairs and holes.
I made a list (n1, n2, n3 and n4) for the differents purposes of my script and also made this:
Lua:
for j = selfPosition.y - 6, selfPosition.y + 7 do
for i = selfPosition.x - 8, selfPosition.x + 9 do
if selfPosition.z < targetPosition.z then -- Andar Superior
tile = Tile({x = i, y = j, z = selfPosition.z})
if tile then
testground = tile:getGround()
if testground then
groundId = testground:getId()
else
groundId = nil
end
tileitems = tile:getItems()
if not tileitems then
tileitems = nil
end
end
if groundId then
if self:getPathTo({x = i, y = j, z = selfPosition.z}) and isInArray(n4,groundId) then
floorgo[c] = {4, {x = i, y = j, z = selfPosition.z}}
c = c + 1
end
elseif tileitems then
if self:getPathTo({x = i, y = j, z = selfPosition.z}) then
for l = 1, #tileitems do
if isInArray(n3, tileitems[l]:getId()) then
floorgo[c] = {3, {x = i, y = j, z = selfPosition.z}}
c = c + 1
end
end
end
end
else
tile = Tile({x = i, y = j, z = selfPosition.z})
if tile then
testground = tile:getGround()
if testground then
groundId = testground:getId()
else
groundId = nil
end
tileitems = tile:getItems()
if not tileitems then
tileitems = nil
end
end
if groundId then
if self:getPathTo({x = i, y = j, z = selfPosition.z}) and isInArray(n1,groundId) then
floorgo[c] = {1, {x = i, y = j, z = selfPosition.z}}
c = c + 1
end
elseif tileitems then
if self:getPathTo({x = i, y = j, z = selfPosition.z}) then
for l = 1, #tileitems do
if isInArray(n2,tileitems[l]:getId()) then
floorgo[c] = {2, {x = i, y = j, z = selfPosition.z}}
c = c + 1
elseif isInArray(n1,tileitems[l]:getId()) then
floorgo[c] = {1, {x = i, y = j, z = selfPosition.z}}
c = c + 1
end
end
end
end
end
end
end
The problem is: "tile:getItems()" do not get the static items. How can I do that?
Another thing, I tried to use "tile:hasFlag(flag)" too, but I'm stucked on the same thing, how can I find the stairs? (Usable and walkable)