Page 1 of 1

Message on death

PostPosted: Tue Jan 07, 2020 4:16 am
by Prickett
So when the final boss dies, I’d like to have a message appear on-screen. But when I put the code in, he was invincible, both in the editor, and in play testing. If anyone knows what line of code works for this, I’d really appreciate it.

Re: Message on death

PostPosted: Tue Jan 07, 2020 10:59 am
by Elendil / Redshift
When a monster script runs, the game only does what it's in it. Any normal processing (damage, dying) is skipped.

What you do when you want normal things to happen is call the "default" function. See the script for Oyo the Shaman for example:

Code: Select all
if (evtdie()) {
  message("As Oyo slumps to the ground, you notice a curious looking scroll still clutched in his hand...");
}
default();

This script is run on all events (getting hit or dying for example) but it only does something special on dying by checking if the event which kicked off the running of the script was the death event "evtdie". And in all cases it runs the default processing.

Re: Message on death

PostPosted: Tue Jan 07, 2020 6:54 pm
by Prickett
Thank you, it’s working as desired now