Floor trigger and flying monsters
Posted: Sun Jul 31, 2016 2:57 pm
Is there a way for flying units to activate floor triggers ?
Official Legend of Grimrock Forums
http://mail.grimrock.net/forum/
Code: Select all
--trigger script (works on specific monsters; checks position and elevation.)
do --Add additional monster ids to the monster table.
local monster = {"crowern_1"}
for x = 1, #monster do
findEntity(monster[x]).move:addConnector('onEndAction', self.go.id, 'triggerFunction')
end
end
function triggerFunction(target)
if target.go.x == self.go.x and target.go.y == self.go.y and target.go.elevation == self.go.elevation then
--Do something when triggered
playSound("secret")
hudPrint(target.go.id.." (a "..target.go.name.."), has triggered the function.")
--
end
end
Code: Select all
spawn("crowern").move:addConnector('onEndAction', <the script id you've used> , 'triggerFunction')