Permanent Actor Death Script

I am sorry I am quite new.  I have the latest version of VX Ace (I think),  And I tried to copy and paste this directly

for actor in $game_party.members if actor.dead? $game_party.remove_actor(actor.id) endendInto the script insertion location (Under materials in the script editor)  When I launch the test I get an error message that bombs me out,  Please help!
 
I am sorry I am quite new.  I have the latest version of VX Ace (I think),  And I tried to copy and paste this directly

for actor in $game_party.members if actor.dead? $game_party.remove_actor(actor.id) endendInto the script insertion location (Under materials in the script editor)  When I launch the test I get an error message that bombs me out,  Please help!
Because that snippet isn't in a format to be inserted as an permanent engine script.

You use those snippets with the script command in an event, not within the script editor...
So I inserted it as is into an event under the script type and ran that event as a parallel process. Same bomb out results. Am I supposed to run it as a battle event or something?
please specify what error message you get, and if you have other scripts added in the script editor. A screenshot of the event's window might also help.
Back to the OP,  I wonder if you could re-use Actors...  if they die, jsut use the common event to change their Picture and Name, based on weither an array, or whatever....  might save database space? 
Here's how it looks for me. All I do is turn on the switch '0001:Check for Dead' and it removes dead party members and have the following code in a Common Event. I wanted to make sure it wouldn't remove the "main" character so it's in an else block. Hope that helps.

[IMG]http://i.imgur.com/qYnbcNz.png[/IMG]
 
@FaeDine:

I don't think your event will work as intended, unless your game structure is a bit different than I imagine.

First problem: if several actors including the hero are dead, none of them will be removed since the script command in the else branch will only be executed when the hero is alive.

Second problem: having the state death changed this way will restore the death state at next refresh due to the special code handling that state.

Every refresh, the HP of the actors are checked - if they have 0 HP, death will applied - if not, it will be removed.

Removing th death state without giving HP will result in the death state reapplied at next actor refresh

This might be what you want if the parallel process recalls the same script before the next refresh as in this case the actor's death state is not yet reapplied and the branch will continue to remove the other dead actors. But handling it that way can introduce lag.

And if you forget that this code only works because it's executed several times between refreshes, this can cause later problems when (for example) you get enough lag to prevent the parallel process from running a second time before refresh, or when you change the event believing it worked in a single iteration, suddenly breaking it and more...

I don't know how you start your battles, but it would be a lot better if you change the event in a way that you'll call it once after each battle instead of having it on parallel - but that also requires that you move the script out of the else branch to the end of the event code.
Hey Andar,

That's some good advice. Thank you.

It was working well enough for me when I was testing things out. In a project more robust, you're right, it probably would be quite laggy.

I haven't touched RPG Maker in some time, but figured I would post what I had that "worked" for shamrok43 😉
no problem ;-)

Code that requires the exact timing of parallel processes in order to work is one hell of an error source even for an experienced programmer who knows exactly what he does. And the screenshot didn't even hint that it only works in some cases if it's executed two times at minimum.

Letting that stand uncommented as an example for new eventers/scripters who don't know what's going on inside the event would be less optimal to their learning process...
Andar and Fae I appreciate your help. I had success running the script in a parallel process event in each field. Another question about the op, how can I alter this script to allow for an item to circumvent the doomed dead character, or perhaps a learned skill?
Andar and Fae I appreciate your help. I had success running the script in a parallel process event in each field. Another question about the op, how can I alter this script to allow for an item to circumvent the doomed dead character, or perhaps a learned skill?
What exactly do you mean?

The editor has already a target scope that differs between dead or living actors, so you just have to select the scope "one ally" to prevent it from being used on a dead actor (which would require "One Actor (dead)")...
So I just thought of something interesting in theory. I'll be testing this for use in my game, hopefully it'll help you all out too. I'm sorry if this is considered a necro, but I found this could be helpful, as I as well as potentially many others were looking for this and I didn't find a great resolution here...

This sounds like it could be made much easier that this by using another script, from our pal Yanfly.

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

This allows you to run a "death event". It runs a common event upon a character, enemy, or class's death, easily with a simple notetag on the actor/enemy/class's page. A small note tag (<death event: id>) seems much easier to copy into each note section, than to do this huge loop from the first post.

In theory, one could set it to a common event that simply calls Fomar's script:

for actor in $game_party.members if actor.dead? $game_party.remove_actor(actor.id) endendAlso, again in theory, I feel that you're large cast of characters are sharing classes, yes? Then it might be faster to apply these death events to all of the classes. However, this would mean your main character would have to have a unique class, or at least a clone of one of the other classes and missing the death event tag.

This way, you can, theoretically, have any of your characters permanately die upon their death, except for the main character.

The one problem I see with this method:

Another question about the op, how can I alter this script to allow for an item to circumvent the doomed dead character, or perhaps a learned skill?
I don't think this would be posible when using my method, because theoretically the permadeath would happen instantly at death, not after battle.

I'm using terms like "in theory" and "theoretically" a lot because I have not actually tested this yet, nor am I far enough in the development of my game to introduce the permadeath characters. However, I don't see much of a reason for this not to work. What do you all think?
Try:

for actor in $game_party.members if actor.dead? $game_party.remove_actor(actor.id) endend
Let me try
Yeah I need a script like this.. help.. 

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