Just a few condition questions

$game_party.add_actor($game_party.members[0].id)
@RpG LoVeR
I just rechecked and the script given above can't work at all.

You cannot add an actor to the party if he is already a member of the party - and the script above gets the ID of an existing party member in position 1 only. However, that should only result in a failure of the add_actor command, not in an error message.
(basically, when you remove any actor, the following actors are reordered and it will be another actor that gives now the ID in position 0, and the add again command will fail because it will try to add another actor that is already in the party.)

However, this can cause problems if you remove the last actor and then try to add it again, because after removing it the corresponding index of the last actor in the game party will no longer exist.
I know....when i tried to set normal conditional branches with actor ids command without script that specifies the party member (not actor id) it didnt show any error at all but it happened that you said...so basically i think that the multiple branches with the script gameparty member check state one after another or "nested" the one inside the other is making the error....because i tried multiple gameparty check state scripts in another event that seems to work perfectly but they have a distance of another events in the middle and there is none of them "nested"....



So basically 1) we have to fix this error or we have to make different common events for each character....

2)we have to find a way so the add gameparty member command to add the specific person that has been removed before
Okay, forget what you have currently: what are you actually trying to do?
Im trying that when a party member NOT ACTOR is dead to change its graphic to coffin and become last in the gameparty
I think it would be much better to take a step back and explain what you want to do instead of how you want to do it.
Completely ignore all ideas of scripts or event commands, and describe what the player should see or do as a result.

Then we can check if there isn't a better way to do this - because I don't see why you would even add or remove actors, that doesn't make any sense in the context.

EDIT:
ninja'd
Then don't add or remove - change the actor sprite and then swap the actor with the last position - that is a different script command.
Code:
$game_party.members.each { |member|
  id = member.id
  fn = member.face_name
  fi = member.face_index
  if member.dead? && member.character_name != "$Coffin"
    member.set_graphic("$Coffin", 0, fn, fi)
    $game_party.remove_actor(id)
    $game_party.add_actor(id)
  elsif !member.dead? && member.character_name != $data_actors[id].character_name
    cn = $data_actors[id].character_name
    ci = $data_actors[id].character_index
    member.set_graphic(cn, ci, fn, fi)
  end
}
$game_player.refresh

You're welcome. 😛

(note that the if statement additional checks are to stop the character graphics from updating *constantly*)

@Andar In this case removing/adding the member is actually the most convenient way to achieve the desired effect as simply swapping them with the last member may end up making the order of "living" party members change.
Code:
$game_party.members.each { |member|
  id = member.id
  fn = member.face_name
  fi = member.face_index
  if member.dead? && member.character_name != "$Coffin"
    member.set_graphic("$Coffin", 0, fn, fi)
    $game_party.remove_actor(id)
    $game_party.add_actor(id)
  elsif !member.dead? && member.character_name != $data_actors[id].character_name
    cn = $data_actors[id].character_name
    ci = $data_actors[id].character_index
    member.set_graphic(cn, ci, fn, fi)
  end
}
$game_player.refresh

You're welcome. 😛

(note that the if statement additional checks are to stop the character graphics from updating *constantly*)

@Andar In this case removing/adding the member is actually the most convenient way to achieve the desired effect as simply swapping them with the last member may end up making the order of "living" party members change.
So this is gonna made me able, when a party member is dead to become last with the coffin graphic and if he is alive to have the normal graphic? If i change the game actor 1 wich is first to the game actor 9 and make him first in party for example, this is gonna work right?
Yes, it simply loops through every party member. If they're dead and their character graphic isn't the coffin, it changes it to the coffin and puts them to the end of the party. If they're not dead and their character graphic is the coffin, it resets it to what it was before.
Ok thanks man i appriciate your help...just a last thing i want to know is, how should I use this script? should I put it under materials or call a common event that does this script?
Parallel process common event. All you have to do is turn on the associated switch and it'll do the rest.
just remember that parallel processes don't work during battlescreen - if you want this to work in battlescreen, it has to be placed in the troop events.
It wouldn't do anything in battle anyway as it only affects the on-map character graphic.
So..yeah seems to work perfectly!! Thanks a lot man! but one more thing that would be making it perfect is, to disable in any dead actor with the coffin graphic the opportunity to become first in party because, if you have a coffin leading the party, it may be weird dont you agree?
I'm glad it worked out. Sorry about yesterday, things went south really quickly...
Anyway, you could use this to automatically push dead members to the back of your party.
Code:
$game_party.members.each do |member|
  next unless member.dead?
  next unless $game_party.alive_members.size > 0
  until member.index > $game_party.alive_members[-1].index
    $game_party.swap_order(member.index, member.index + 1)
  end
end
Thanks that's quite handy but...can you better make it for the player to be unable to formation the dead character 1st?
Not with an event. You'd have to make a plugin that changes the way the formation command works.
how can i do this?
Yanfly's Party System allows you to lock actor positions with a script call.
https://yanflychannel.wordpress.com/rmvxa/core-scripts/party-system/
how can i specify only when a party member not actor is dead, to lock the formation to him with this script?
I don't have it on my script list but:
Code:
$game_party.members.each do |member|
  lock_actor(member.id) if member.dead? && !member.locked
  unlock_actor(member.id) if member.alive? && member.locked
end
Probably works.

Original thread: https://forums.rpgmakerweb.com/threads/just-a-few-condition-questions.78199/