Try thisst1nger wrote:hi everyone
is it possible to check if the party moves against a wall?
i want script the system from DM to damage the party.
or has anyone else these system already?
Code: Select all
defineObject{
name = "party",
baseObject = "party",
components = {
{
class = "Party",
onMove = function(self,direction)
local dx,dy = getForward(direction)
if self.go.map:isBlocked(self.go.x+dx,self.go.y+dy,self.go.elevation) then
-- add your damage routine here
return true -- if you want the "bumping effect"; otherwise return false
else
return true -- let the party move freely
end
end,
},
},
}