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!
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()
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
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:
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().
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.
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:
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