Event triggered by kill

Talk about creating Grimrock 1 levels and mods here. Warning: forum contains spoilers!
Post Reply
xbdj
Posts: 32
Joined: Sun Dec 30, 2012 7:43 pm

Event triggered by kill

Post 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.
User avatar
Brodie301
Posts: 286
Joined: Sun Apr 08, 2012 6:00 pm
Location: Mississippi, USA

Re: Event triggered by kill

Post by Brodie301 »

The best way I've found is clone the monster and add onDie hook to the clone.
The FORCE is with me!!!
xbdj
Posts: 32
Joined: Sun Dec 30, 2012 7:43 pm

Re: Event triggered by kill

Post 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! :-)
User avatar
Komag
Posts: 3659
Joined: Sat Jul 28, 2012 4:55 pm
Location: Boston, USA

Re: Event triggered by kill

Post 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
Finished Dungeons - complete mods to play
Post Reply