[VXA] Permanent Actor Death Script

Hello, and thank you for taking the time to look at my request - it means a lot!

I am developing an RPG game using the RPG Maker VX Ace engine, and there are a couple things I desire to be included in my game I don't think I can accomplish via events. One of these is a unique permanent actor death system.

First things first, the game will feature a side-view battle system, which we plan to incorporate via Fomar0153's Animated Battlers, found here.

Here is how it works. A character (let's call him "Eric") loses all of his hit points in battle. Because of this, he contracts the "Fallen" Debuff, which causes Eric's sprite to fall and prevents him from being targeted or taking damage, removes all other Buffs/Debuffs, and prevents him from participating in battle for three turns. During these three turns, a counter appears above Eric, starting at 3, and at the start of each new turn counting down by one number until reaching 0. If Eric's Fallen Debuff is treated via an Item or SKill that treats Fallen and restores some health before three turns pass and the counter reaches 0, he is revived and remains in play. If the battle is ended (via running away or defeating all enemies) with Eric Fallen, he revives with 1 HP and is treated of the Fallen Debuff.

If Eric is NOT revived via an Item that treats Fallen and restores health, and the battle is not ended before the three turns are over, the counter hits 0, and a sad sound is played. Eric says his last words, and then dies, removing him from the party. A 25-second video detailing what I envision this process as is linked here. keep your eye on "Lyn" on the right. After she is struck by the axe-wielding enemy, she loses all of her hit points, says some parting words, and fades out of the game.

The main character, however, cannot die; instead, if he contracts the Fallen Debuff and the counter ticks down to 0, he says his final words, the game ends, and the player must restart from their last save.

The reason I am requesting this is because my team and I have limited knowledge of scripting, and the game is built around keeping your party alive. If your character dies in a game where you need only use an item to bring them back from death, death is not much more than an annoyance. Our game is a story-driven one, and we want the player to truly connect with his teammates. We feel that a system where if one of your Allies dies, he is removed from the rest of the story, will help strengthen the need to keep characters alive, and add emotional depth when they do die. On the technical side, each character also brings unique skills and uses to the table, and if they die, the player must then continue the game without that character's mechanics and skills. We hope that permanent actor death will require players to really think about the actions they are taking - one wrong move, and your favorite damage-dealer may be lost forever.

The player can restore from a previous save file, of course, where the character is still alive, and attempt the battle again.

We do plan to commercialize the completed game. If you need compensation for the use of this script in a commercialized game, please message me with your terms, and we can work from there.
I could be completely wrong, But I do think this could be done by events. Unless I am reading this wrong you want a permanent death counter going from 3 to 0, losing 1 per turn? Which could be done by events. Am I reading this wrong?
You could very much accomplish what you want through eventing if you wish. It may be tedious but you may just have to set up a [Conditional Branch] that checks that if actor is [Fallen] then add +1 to a variable and if it equals 3 remove them from the party. Just make sure the Battle event process is set to [Turn] and not [battle] or [Moment].

If you must use scripts then I would recommend Yanfly's Base Troop Events Script:

http://yanflychannel.wordpress.com/rmvxa/utility-scripts/base-troop-events/

This will remove much tediousness since you can have all Battles have this event without copy and pasting them.

Also Yanfly's Death Common Event script might be helpful:

http://yanflychannel.wordpress.com/rmvxa/battle-scripts/death-common-event/

In case you are running into any weird bugs with the [Fallen] state interfering with scripts. But I don't know. I doubt you would need this one.

Please read Yanfly's Terms and Conditions.

Oops I also forgot to say that the countdown display could be done with Image files of a '3', '2', and '1'. And positioning it could be manipulated through a small series of [Conditional Branches] and [Variables] based on Member Position. This isn't the most perfect way to do it and I'm sure a script could be easier. But do keep in mind it is something you can do. I believe I did something very similar in one of my projects. I'll have to look for it though.

(Sorry for posting twice in a row.)
Just edit your previous post next time. I merged your posts.
Thank you everyone for the fast and helpful replies! I'll definitely give eventing another look  - we aim to rely on scripting as little as possible. If I run into any other problems, I'll create a new post in the appropriate area.

Staff can close this thread, I have what I need!
This thread is being closed, due to being solved. If for some reason you would like this thread re-opened, please report this post and leave a message why. Thank you.

Original thread: https://forums.rpgmakerweb.com/threads/vxa-permanent-actor-death-script.21463/