Permanent Actor Death Script

shamrok43

Warper
Member
Joined
Apr 9, 2013
Messages
3
Reaction score
0
First Language
ENG
Primarily Uses
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!
 
 

Andar

Veteran
Veteran
Joined
Mar 5, 2013
Messages
31,365
Reaction score
7,676
First Language
German
Primarily Uses
RMMV
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...
 

shamrok43

Warper
Member
Joined
Apr 9, 2013
Messages
3
Reaction score
0
First Language
ENG
Primarily Uses
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?
 

Andar

Veteran
Veteran
Joined
Mar 5, 2013
Messages
31,365
Reaction score
7,676
First Language
German
Primarily Uses
RMMV
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.
 

Maebius

Veteran
Veteran
Joined
Oct 29, 2012
Messages
40
Reaction score
2
Primarily Uses
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? 
 

FaeDine

Warper
Member
Joined
Jun 7, 2012
Messages
2
Reaction score
0
First Language
English
Primarily Uses
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.


 
 

Andar

Veteran
Veteran
Joined
Mar 5, 2013
Messages
31,365
Reaction score
7,676
First Language
German
Primarily Uses
RMMV
@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.
 
Last edited by a moderator:

FaeDine

Warper
Member
Joined
Jun 7, 2012
Messages
2
Reaction score
0
First Language
English
Primarily Uses
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 ;)
 

Andar

Veteran
Veteran
Joined
Mar 5, 2013
Messages
31,365
Reaction score
7,676
First Language
German
Primarily Uses
RMMV
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...
 
Last edited by a moderator:

shamrok43

Warper
Member
Joined
Apr 9, 2013
Messages
3
Reaction score
0
First Language
ENG
Primarily Uses
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?
 
Last edited by a moderator:

Andar

Veteran
Veteran
Joined
Mar 5, 2013
Messages
31,365
Reaction score
7,676
First Language
German
Primarily Uses
RMMV
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)")...
 

OroCrimson

Villager
Member
Joined
Aug 17, 2013
Messages
15
Reaction score
10
First Language
English
Primarily Uses
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?
 
Last edited by a moderator:

snaxius

Villager
Member
Joined
Aug 23, 2015
Messages
6
Reaction score
0
First Language
Engils
Primarily Uses
Yeah I need a script like this.. help.. 
 

Users Who Are Viewing This Thread (Users: 0, Guests: 1)

Latest Threads

Latest Profile Posts

so hopefully tomorrow i get to go home from the hospital i've been here for 5 days already and it's driving me mad. I miss my family like crazy but at least I get to use my own toiletries and my own clothes. My mom is coming to visit soon i can't wait to see her cause i miss her the most. :kaojoy:
Couple hours of work. Might use in my game as a secret find or something. Not sure. Fancy though no? :D
Holy stink, where have I been? Well, I started my temporary job this week. So less time to spend on game design... :(
Cartoonier cloud cover that better fits the art style, as well as (slightly) improved blending/fading... fading clouds when there are larger patterns is still somewhat abrupt for some reason.
Do you Find Tilesetting or Looking for Tilesets/Plugins more fun? Personally I like making my tileset for my Game (Cretaceous Park TM) xD

Forum statistics

Threads
105,868
Messages
1,017,078
Members
137,580
Latest member
Snavi
Top