Page 1 of 1
Event triggered by kill
Posted: Mon Dec 31, 2012 12:53 am
by xbdj
Ok - next problem
I want a door to open, when a certain mob is killed
But I cant quite get it to work...any suggestions?
I dont know how to make the game continously control for the mobs health being above 0 f.ex.
Re: Event triggered by kill
Posted: Mon Dec 31, 2012 1:08 am
by Brodie301
The best way I've found is clone the monster and add onDie hook to the clone.
Re: Event triggered by kill
Posted: Mon Dec 31, 2012 1:20 am
by xbdj
Excellent - thanks!
Added
cloneObject{
name = "snail_open",
baseObject = "snail",
onDie = function()
dungeon_secret_door_5:open()
end,
}
to the monster.lua, and placed a "snail_open" instead of a normal snail...and it worked!

Re: Event triggered by kill
Posted: Tue Jan 01, 2013 10:53 pm
by Komag
yes, that is the most direct and easy approach in this case. If you had a room of exactly four of them the hook could decrement a counter set at 4 which would then open the door after the last monster dies