Page 1 of 1

running script on enemy death

Posted: Tue Mar 22, 2022 1:51 pm
by Pongo
I can't get my exploding zombies to explode. I just get a "failed to run IBScript" message on their deaths.

This is the set up to launch the castspell script:
exploding zombie.png
exploding zombie.png (5.42 KiB) Viewed 7173 times
The tag is correct.

I think the problem might be that the castspell script is designed to work in convos rather than combat. Ie, the second parameter indicates which PC the spell is cast at, but in this case I don't want the spell to be cast at a PC - I want the zombie to cast it on itself so the explosion is centered on it.

Is there an option I'm overlooking that would better enable the dead zombie to cast an exploding spell on itself? Or might the problem be something else?

Re: running script on enemy death

Posted: Tue Mar 22, 2022 2:08 pm
by Dorateen
How did it work in the Eldarin Stone? I thought you first used exploding zombies in that module. Was it a custom script that you might need to import?

Re: running script on enemy death

Posted: Tue Mar 22, 2022 2:53 pm
by Pongo
Good question! Not sure why it hadn't occured to me to check...

In the Elderin Stone I had it set up with "onScoringHitCastSpellTag", which does cast on self. It works on hit though rather than on death, which means if the zombie has enough HP you could hit and get it to explode, but it could survive the explosion, which is a bit weird.

Ideally I'd therefore like to use the "onDeath" script tag, which is the one I can't get working.

If its not possible I'll lower their HP to something that can't survive the explosion and go back to "on scoring hit".

Re: running script on enemy death

Posted: Tue Mar 22, 2022 3:55 pm
by Dorateen
Just a quick thought: could you make a custom spell just for this instance that will be attached to the onScoringHit tag, one that will do the exact amount of damage as the zombie's hit points?

Re: running script on enemy death

Posted: Tue Mar 22, 2022 3:59 pm
by Pongo
Thanks - yes, I think I could just lower their HP - eg, if I give them 4 HP and the explosion does 3d4 damage they can never survive a hit.

It means they become "one hit and explode" enemies, which isn't quite what I had in mind, but it will totally work. I'll do that. Thanks, Dorateen!

Re: running script on enemy death

Posted: Sun Mar 27, 2022 5:48 pm
by slowdive
I'll add this to the task list to investigate.