How to make a skill/state that "ejects" a party member during battles?

I want to make sort of an "ejection" skill for specific enemies where during battle, if the enemy successfully uses this skill on a party member, the party member's sprites, options, and stats all disappear, being effectively "removed" from battle permanently (thus, for game purposes, a different kind of "death" state).

But, once the battle ends, they come right back like normal.


How do I make a skill that gives this sort of "ejection" illusion? I want to make it look like the party member specifically gets removed from battle, and not just fall dead/able to get revived.
The options menu during battle shouldn't allow you to even run by this ejected party member, and enemies/other party members shouldn't be able to target this ejected member.
Not sure if you already have a post-battle common event, but if not, you could make use of one.

Create one that has a trigger of "Parallel" and a Switch of some sort called something like "shouldCallPostBattle". Call it "Post Battle".

Then make a common event called "Eject Party Member" with no trigger or switch that will reference a variable you'll use for the skill's purpose, something like "ejectedActorId".

So let's say you have variable 2, ejectedActorId, and switch 8, shouldCallPostBattle. In the damage formula for your skill, have something like:
Code:
$gameVariables.setValue(2, b.actorId())
Which would set game variable 2 to the Id of the targeted actor.

Then have your skill call a common event that does a script call of:
Code:
$gameParty.removeActor($gameVariables.value(2))
And also sets switch 8, shouldCallPostBattle, to ON.

Then have your "Post Battle" common event do a script call of:
Code:
$gameParty.addActor($gameVariables.value(2))
And set switch 8, shouldCallPostBattle, to OFF.

So, in summary:
  • Damage formula sets a variable of the ejected actor's Id, referencing b.actorId()
  • Common event runs that removes the actor from the party and specifies that the post battle common event needs to run
  • After battle, common event runs that puts the specified actor back in the party, referencing the variable of the ejected actor's Id
This approach would need a modification if it's possible to eject multiple party members, though, since it would only store the Id of the last-ejected member, but I'm not sure if you need that.

If you don't want your skill to use the damage formula, then you could modify the "Eject Party Member" common event to instead choose an actor Id at random from the members of your party and set that value to your variable.
I want to make sort of an "ejection" skill for specific enemies where during battle, if the enemy successfully uses this skill on a party member, the party member's sprites, options, and stats all disappear, being effectively "removed" from battle permanently (thus, for game purposes, a different kind of "death" state).

But, once the battle ends, they come right back like normal.


How do I make a skill that gives this sort of "ejection" illusion? I want to make it look like the party member specifically gets removed from battle, and not just fall dead/able to get revived.
The options menu during battle shouldn't allow you to even run by this ejected party member, and enemies/other party members shouldn't be able to target this ejected member.
kinda like the green haired dude in FF6 that jumpped into animals and dissapeareed and came back randoly with new skills he learned from the animals?
Type b.hide() into the damage formula of the eject skill.
if this is for a single actor, just have the enemy use the escape effect on that actor.

escape is originally meant to be for enemies only and it has a few possible hickups when used on actors, but those only become a problem if you try to escape the entire party. For a specific single actor there should be no problems.

however you need to be able to identify and target that actor, and that means either using troop event and force action, or have some plugin for advanced targeting options.
I have just tested @Rinobi 's solution and it works to perfection. It's also the simplest of those suggested, so I recommend you go with that one.
Type b.hide() into the damage formula of the eject skill.
I have just tested @Rinobi 's solution and it works to perfection. It's also the simplest of those suggested, so I recommend you go with that one.

I just tested it myself too, and it almost does it, but not quite.

The only problem here is that if everyone is ejected, no one is considered "dead", so the game just continues on if everyone gets ejected in the party. This ejection skill should be a sort of "death" state during battles.

I try to think like the party member that get "ejected" can be similar to that of a permanent OHKO status during battle. So it would be a very powerful, dangerous skill, yet it goes away the moment the player wins the battle.



I should clarify since everyone is bringing this up, it will be an enemy-only skill (players can't learn this). It will be a type of ejection skill where the enemy targets only 1 party member. So it won't be multiple people being ejected at once or anything.
@PoptartPresident Have you tried adding the dead state to your skill as well?
The only problem here is that if everyone is ejected, no one is considered "dead", so the game just continues on if everyone gets ejected in the party.
that is exactly the problem I mentioned in my post above with the problem that the escape does not work for the entire party, and there is no easy solution for that.

I think your best option is to ask for a plugin that changes how the battleend is detected and handled.
Apologies, I was at work earlier so I didn't see the problem.
Here's a workaround - give it a try:
JavaScript:
b.die(); b.hide(); if ($gameParty.isAllDead()) {BattleManager.processDefeat()}; 0
@Rinobi Where does one put that bit of code? In the damage formula?

EDIT
Just tried it and got a satisfying Game Over.
Thank you.
Apologies, I was at work earlier so I didn't see the problem.
Here's a workaround - give it a try:
JavaScript:
b.die(); b.hide(); if ($gameParty.isAllDead()) {BattleManager.processDefeat()}; 0
I'd would like an MZ version of this code, please.

CSpringer205, please refrain from necro-posting in a thread. Necro-posting is posting in a thread that has not had posting activity in over 30 days. You can review our forum rules here. Thank you.



but also
I'd would like an MZ version of this code, please.
it should be the same in MZ as it is in MV. If it doesnt work, then please start a new thread and be sure to show the plugins you are using.

Original thread: https://forums.rpgmakerweb.com/threads/how-to-make-a-skill-state-that-ejects-a-party-member-during-battles.149462/