[SOLVED] Remove Dead Party members from party (during combat)

Status
Not open for further replies.

senku

Villager
Member
Joined
Nov 7, 2020
Messages
18
Reaction score
3
First Language
Italian
Primarily Uses
RMMV
Hi all! I would like to create a party of 5 members, where the first one, that is the leader, is hided from menu and during battles (only members number 2-3-4-5 can fight).

The second task could be accomplished by removing and adding, this party member, before and after every battle, I suppose.

The first is the tough one, I managed to remove the drawings, but the first members is still accessible via menus.

I'm trying to work around the limitation to have at least 1 member in the party :p

Any suggestion, plugin or else?
 

Attachments

Andar

Veteran
Veteran
Joined
Mar 5, 2013
Messages
31,365
Reaction score
7,674
First Language
German
Primarily Uses
RMMV
OK, just to clarify - if you want the first actor to be hidden in the menu as well as in the battles, where should that first actor exist?

Because if he/she is to remain hidden everywhere it might be an option to have that not as an actor at all, and just write the events pretending that there is a leader.
 

senku

Villager
Member
Joined
Nov 7, 2020
Messages
18
Reaction score
3
First Language
Italian
Primarily Uses
RMMV
Okay, let me explain better what I want to accomplish. My game is focused on party recruitments. So when a party member die, it is removed from party forever (via script). So when a party member is removed, you could take a raplace from an npc and go ahead with your mission.

In order to get this "game system", I need 2 things:

1. When all party member die and the system remove them from party, the game crash/don't allow it cos one party member (leader) is required to be in the party to progress through the game. So I need one non-combat leader that could be removed when fights starts, and added again to the party when party wipes.

2. This non-combat leader mentioned earlier don't need to be equipped or have specific abilities. It's a sort of "placeholder" needed when the first point above happens. So I don't want to see him in the menu_status

Hope this clarify better
 

Andar

Veteran
Veteran
Joined
Mar 5, 2013
Messages
31,365
Reaction score
7,674
First Language
German
Primarily Uses
RMMV
the game crash/don't allow it cos one party member (leader) is required to be in the party
no, that sounds like you're doing something wrong on removing the actor.
Because it is NOT required to have an actor in the party - I just checked and there is no problem starting a new game even when the party is empty.
There are a number of problems if there is no actor in the party, but the engine itself won't crash from that alone. Quite the contrary, that option is especially there to enable you to start without a preconstructed party and gain the first actors by events.

It's a sort of "placeholder" needed when the first point above happens.
then you might consider only adding him after a battle where everyone was killed, and remove him as soon as the first regular actor is added again. No need to have him in the party between those points.
 

senku

Villager
Member
Joined
Nov 7, 2020
Messages
18
Reaction score
3
First Language
Italian
Primarily Uses
RMMV
Oh god, you'are damn right, you can have no party members in party... * facepalm *

I just checked again and system still doesn't let me have "no party members" in the party.

Maybe I found what caused the problem. I'm using this plugin to remove party member in fight, so when they die they are removed from party, via battle event. The battle event triggers at the end of the turn:

//file: Remove_Dead.js
removeDead = function(){
var partylength = $gameParty.members().length;
var hp1 = 1;
var hp2 = 1;
var hp3 = 1;
var hp4 = 1;

if(partylength == 4){
hp1 = $gameParty.members()[0].hp;
hp2 = $gameParty.members()[1].hp;
hp3 = $gameParty.members()[2].hp;
hp4 = $gameParty.members()[3].hp;
}else{
if(partylength == 3){
hp1 = $gameParty.members()[0].hp;
hp2 = $gameParty.members()[1].hp;
hp3 = $gameParty.members()[2].hp;
}else{
if(partylength == 2){
hp1 = $gameParty.members()[0].hp;
hp2 = $gameParty.members()[1].hp;
}else{
if(partylength == 1){
hp1 = $gameParty.members()[0].hp;
}
}
}
}
if(hp4 == 0){ $gameParty.removeActor(4); }
if(hp3 == 0){ $gameParty.removeActor(3); }
if(hp2 == 0){ $gameParty.removeActor(2); }
if(hp1 == 0){ $gameParty.removeActor(1); }
}

But when the last one die, the system kick me from battle, so the "last" end of the turn never happens, and the last party member don't get removed :/

Any ideas to fix it?
 
Last edited:

Andar

Veteran
Veteran
Joined
Mar 5, 2013
Messages
31,365
Reaction score
7,674
First Language
German
Primarily Uses
RMMV
But when the last one die, the system kick me from battle, so the "last" end of the turn never happens, and the last party member don't get removed :/
Any ideas to fix it?
Several possibilities have been known for decades to prevent that effect.
going with a pure eventing and inside battle solution, you can give everyone a temporary immortal state on turn zero, having each actor and enemy with a troop event that checks for HP=0, does something and then removes the immortal state - and in case of the last enemy, add a temporary leader before battle abort

second option works only for evented battles, simply check "can lose" on the battle processing command

and then there are several plugins that add new triggers to the battle events, including an "battle end" trigger
 

senku

Villager
Member
Joined
Nov 7, 2020
Messages
18
Reaction score
3
First Language
Italian
Primarily Uses
RMMV
Several possibilities have been known for decades to prevent that effect.
going with a pure eventing and inside battle solution, you can give everyone a temporary immortal state on turn zero, having each actor and enemy with a troop event that checks for HP=0, does something and then removes the immortal state - and in case of the last enemy, add a temporary leader before battle abort

second option works only for evented battles, simply check "can lose" on the battle processing command

and then there are several plugins that add new triggers to the battle events, including an "battle end" trigger
I created this and it worked perfectly on evented battles (no random encounters will be in the game).

resetParty = function(){
var partylength = $gameParty.members().length;

if(partylength == 1){
$gameParty.removeActor($gameParty._actors[0]);
}
if(partylength == 2){
$gameParty.removeActor($gameParty._actors[1]);
$gameParty.removeActor($gameParty._actors[0]);
}
if(partylength == 3){
$gameParty.removeActor($gameParty._actors[2]);
$gameParty.removeActor($gameParty._actors[1]);
$gameParty.removeActor($gameParty._actors[0]);
}
if(partylength == 4){
$gameParty.removeActor($gameParty._actors[3]);
$gameParty.removeActor($gameParty._actors[2]);
$gameParty.removeActor($gameParty._actors[1]);
$gameParty.removeActor($gameParty._actors[0]);
}
}

Thanks a lot Andar! This is my first rpg maker ever and my first attempt to create a game, so ty for your patience :p
 

slimmmeiske2

Little Red Riding Hood
Global Mod
Joined
Sep 6, 2012
Messages
7,842
Reaction score
5,225
First Language
Dutch
Primarily Uses
RMXP

This thread is being closed, due to being solved. If for some reason you would like this thread re-opened, please report this post and leave a message why. Thank you.

 
Status
Not open for further replies.

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

Latest Threads

Latest Posts

Latest Profile Posts

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
How many parameters is 'too many'??

Forum statistics

Threads
105,860
Messages
1,017,040
Members
137,569
Latest member
Shtelsky
Top