Problem with branch

I'm using this script to create permanent death.

for (var n=0; n<$gameParty._actors.length; n++) {

if ($gameActors.actor($gameParty._actors[n]).isStateAffected(1))

{$gameParty.removeActor($gameParty._actors[n]);}

}

But I have a character in the game whose death should lead to an instant game over. I tried to do this through a condition that checks for the presence of this character in the party, and created an else branch for him, and inserted logic there that would have to launch the game over screen. But it worked exactly the opposite. The character was in the Party, but the game still launched the Game Over screen. And if I inserted a condition into the main branch of the condition, then the event was not triggered at all, even if the character was absent from the party
I tried to do this through a condition that checks for the presence of this character in the party, and created an else branch for him, and inserted logic there that would have to launch the game over screen
can you show screenshots of how you wrote the logic for this?
As I told you in your other thread, removeActor() expects an actor ID as the argument.

$gameParty._actors[n] is not only bad practice to use in JavaScript, it is a Game_Actor object, not an actor ID.

You would do $gameParty.removeActor($gameParty.members()[n].actorId())

You should always use getter functions when they're provided, rather than directly accessing an object property - that is, members() instead of _actors
can you show screenshots of how you wrote the logic for this?
Well, I'm working on Ru version of RPG maker MV, I don't think you can understand anything, but here
1709925984358.png
I don't think you can understand anything
between the screenshot and your description of what it does, both gives me a better idea of what youve done than either one alone

I did what i would have done based off of what you described in english and then just flipped the language to russian and compared it to yours.
are you using a plugin that changes how actors are handled by the game? I dont see the need for the variable comparison at the start, but that shouldnt cause the check for whether or not that actor is in the party to fail
Well, based on your screenshot & Google's translator, I'd guess your problem derives from the fact that it's checking for Ru NOT being an actual party member at that point. Even if Ru dies in battle, he or she is still a party member from the system's point of view. If Ru isn't, it will default to the Gameover screen, which is a weird behavior indeed. Every check and command there you'd ever need should be applied to the main conditional branch only.
Well, I'm working on Ru version of RPG maker MV, I don't think you can understand anything
Right-click it in your Steam library, go to Properties, and in the General tab you can change the language.
between the screenshot and your description of what it does, both gives me a better idea of what youve done than either one alone

I did what i would have done based off of what you described in english and then just flipped the language to russian and compared it to yours.
are you using a plugin that changes how actors are handled by the game? I dont see the need for the variable comparison at the start, but that shouldnt cause the check for whether or not that actor is in the party to fail
I created a new project, and in it I tried to make a check for the presence of a specific character in the party. And everything worked exactly as it should. Maybe one of the plugins broke something in the mechanics of Rpg maker, or maybe I got confused in a bunch of Common events myself.

between the screenshot and your description of what it does, both gives me a better idea of what youve done than either one alone

I did what i would have done based off of what you described in english and then just flipped the language to russian and compared it to yours.
are you using a plugin that changes how actors are handled by the game? I dont see the need for the variable comparison at the start, but that shouldnt cause the check for whether or not that actor is in the party to fail

I think I've found the cause of the problem. CopyActors plugin http://sumrndm.site/copy-actors / after I turned it off, everything started working as it should.

I think I've found the cause of the problem. CopyActors plugin http://sumrndm.site/copy-actors / after I turned it off, everything started working as it should.
the problem was solved, it turned out that I did not fully understand the work of the plugin, the fact is that by default, copy mode was enabled, because of which the function, add a character to the party, added a copy of it, because of this, the game believed that the team was not the original, but a copy, that's why there was a problem with the Branches.

Original thread: https://forums.rpgmakerweb.com/threads/problem-with-branch.166591/