adding onDie condiition to spawned monster

Ask for help about creating mods and scripts for Grimrock 2 or share your tips, scripts, tools and assets with other modders here. Warning: forum contains spoilers!
Post Reply
[SMUG]Ipecac
Posts: 28
Joined: Tue Oct 21, 2014 5:51 am

adding onDie condiition to spawned monster

Post by [SMUG]Ipecac »

Hi guys,

How do I add an "onDie" condition to the monster I just spawned? I'd like to do something like:

function zarchtonBossfight()
spawn("zarchton_ambush", 16, x, y, z, facing, "boss_name")
boss_name.monster:onDie(timer_1.timer:start())
zarchton_bossfight.bossfight:activate()
zarchton_bossfight.bossfight:addMonster(boss_name.monster)
end

function zarchtonSwarm()
spawn("zarchton_swarm_1", 16, xyzfacing "new_boss_name")
new_boss_name.monster:onDie(timer_1.timer:start())
zarchton_bossfight.bossfight:addMonster(new_boss_name.monster)
end


The idea being I could spawn additional zarchtons and add them to the fight as it went on. Also, it needs to be the zarchton_ambush guys cause I want them to animate out of the water.
NutJob
Posts: 426
Joined: Sun Oct 19, 2014 6:35 pm

Re: adding onDie condiition to spawned monster

Post by NutJob »

:addConnector(event, target, action)

The way I find a ton of stuff is to add, checkbox, toggle everything in all objects then take a look in the dungeons.lua for the syntax.
[SMUG]Ipecac
Posts: 28
Joined: Tue Oct 21, 2014 5:51 am

Re: adding onDie condiition to spawned monster

Post by [SMUG]Ipecac »

it works!! thanks :)(

function zarchtonBossfight()
spawn("zarchton_ambush", 16, 24, 9, 3, 0, "swarm1")
swarm1.monster:addConnector("onDie", "alarm_timer_1", "start")
end
Post Reply