Page 1 of 1

adding onDie condiition to spawned monster

Posted: Mon Oct 27, 2014 8:45 pm
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.

Re: adding onDie condiition to spawned monster

Posted: Mon Oct 27, 2014 9:22 pm
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.

Re: adding onDie condiition to spawned monster

Posted: Mon Oct 27, 2014 9:59 pm
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