Page 1 of 1

Boss dies' not timer activate..HELP

Posted: Sat Dec 06, 2014 6:33 am
by Mysterious
Hi guys. I having a problem with this script. When the boss die's the (timer_2) does not activated for some reason, even though it checks if the boss is dead. Can I get some help on this please thxs :) Oh and timer_2 connects to the: function Die1()

Code: Select all

boss2timer.timer:stop()
message = "DRACO: First you enter my fort and now you desacrate my tomb...DIE!!"


function bossmodetomb()
party.party:shakeCamera(1, 1)
hudPrint(message)
boss2timer.timer:start()
	end

function bossstart2()

hudPrint("Shadow: Lets do this, or we will die.")
spawn("mummy3",2,14,15,3,0,"boss2draco")

spawn("tomb_key",2,14,15,3,0,"tomb_key_a")
boss2draco.monster:addItem(tomb_key_a.item)

boss2draco.monster:setHealth(300)
boss2draco.monster:setMaxHealth(300) 
boss_fight_draco.bossfight:addMonster(boss2draco.monster)
boss_fight_draco.bossfight:activate()
boss2timer.timer:stop()
Draco_Dont_Steal_1.script.bossdeaddraco()

	end

function bossdeaddraco()

if boss2draco.monster:getHealth() == 0 then
boss_fight_draco.bossfight:deactivate()
timer_2.timer:start()

end
	end

function Die1()	
playSound("screaming_1")
end

Re: Boss dies' not timer activate..HELP

Posted: Sat Dec 06, 2014 8:17 am
by Mysterious
bump sorry need help bad on this

Re: Boss dies' not timer activate..HELP

Posted: Sat Dec 06, 2014 10:38 am
by Scotty
The problem is that you're calling bossdeaddraco() right at the start of the fight (when he'd be at full health) and then never again. What you want to be using is the onDie hook, which will activate a function when a monster dies. So change the bossdeaddraco() function to this:

Code: Select all

function bossdeaddraco()
boss_fight_draco.bossfight:deactivate()
timer_2.timer:start()
end
(since the if statement is irrelevant if it's being called on his death anyway)
Add a connector from the boss monster, select "onDie", and select bossdeaddraco().

Let me know if that works!

Re: Boss dies' not timer activate..HELP

Posted: Sun Dec 07, 2014 9:35 am
by Mysterious
Hi thxs for the help but I still can get the code to work. The mummy is spawned and I don't know how to code in the ondie hook in the script. I think I very lost on this dam, I spent hours on this lol. Bad scripter I am lol.

Re: Boss dies' not timer activate..HELP

Posted: Sun Dec 07, 2014 10:04 am
by Scotty
If the mummy is sitting there in the editor, you can just click on it, and there should be an add connector button on the right panel.

If the mummy is spawned in at some later point you will have to add the connector in your script somewhere AFTER the spawn happens.
To put in a connector in the script, it's structured like this:

my_monster.monster:addConnector("onDie", "my_script", "my_function")

So yours should be something like:
boss2draco.monster:addConnector("onDie, "whateveryourscriptentityiscalled", "bossdeaddraco")

Don't worry, you'll get the hang of it!

Re: Boss dies' not timer activate..HELP

Posted: Mon Dec 08, 2014 5:13 am
by Mysterious
Hi Scotty I got this to work. Thxs for the help, one line made it work wow :)

Code: Select all

boss2timer.timer:stop()
message = "DRACO: First you enter my fort and now you desacrate my tomb...DIE!!"

--Altar connects to this Script--

function bossmodetomb()
party.party:shakeCamera(1, 1)
hudPrint(message)
boss2timer.timer:start()
	end


--boss2timmer conects to this Script (3 Sec interval)--

function bossstart2()

hudPrint("Shadow: Lets do this, or we will die.")
spawn("mummy3",2,14,15,3,0,"boss2draco")
spawn("tomb_key",2,14,15,3,0,"tomb_key_a")
boss2draco.monster:addItem(tomb_key_a.item)
	boss2draco.monster:setHealth(300)
	boss2draco.monster:setMaxHealth(300) 
boss_fight_draco.bossfight:addMonster(boss2draco.monster)
boss_fight_draco.bossfight:activate()
boss2timer.timer:stop()
boss2draco.monster:addConnector("onDie","Draco_Dont_Steal_1","bossdeaddraco")
	end

function bossdeaddraco()

boss_fight_draco.bossfight:deactivate()
timer_2.timer:start()
	end

--timer_2 conects to this Script (2 sec interval)--

function BossScream()

playSound("screaming_1")
	end
Thxs again now I can use this for other boss fights :)