running script on enemy death

Discuss IB/IBx engine ideas, bugs, etc.
Post Reply
Pongo
Posts: 156
Joined: Fri Jan 22, 2021 8:39 am

running script on enemy death

Post 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 6267 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?
User avatar
Dorateen
Posts: 316
Joined: Thu Jan 16, 2020 3:03 pm

Re: running script on enemy death

Post 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?
Pongo
Posts: 156
Joined: Fri Jan 22, 2021 8:39 am

Re: running script on enemy death

Post 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".
User avatar
Dorateen
Posts: 316
Joined: Thu Jan 16, 2020 3:03 pm

Re: running script on enemy death

Post 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?
Pongo
Posts: 156
Joined: Fri Jan 22, 2021 8:39 am

Re: running script on enemy death

Post 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!
User avatar
slowdive
Site Admin
Posts: 509
Joined: Wed Jan 15, 2020 4:37 am

Re: running script on enemy death

Post by slowdive »

I'll add this to the task list to investigate.
Post Reply