Need fix for invisible actor movement when no actor in group.

Hey there fellow RPGers, I hope all are well. Recently I got my permadeath system dialed in, at least I thought I did until testing
today. I've been searching for a fix but so far no luck. I admit, I am a little tired, so I am hoping I am overlooking something simple but anyways, here's my issue.

Say I have 6 party members. 4 normal battle members and 2 reserve members. In permadeath mode when a character dies they are removed from the party. The problem is that if all group members die the group is now empty and I can walk around invisible and still interact with things and get attacked. This is going to be an issue for sure if I can't get it fixed. I hope there's a way I can either,

1. Force a group selection window if the battle group is empty.

or

2. Make it so that if the battle group = 0, a reserve member is automatically placed in the first group slot.

or

3. Somehow lock characters movement if no members are in the battle group so they have no choice but to open the group window and add an actor. With this I could see another possible issue however, where if they are locked right next to an event they could interact with it I would think.

I'm not sure how I could attach an, if battle members slots are empty type call to an event but I think this is what I need to be looking for. So there it is I really hope some kind soul can help out here, and I think you for taking a look.

Edit

This only occurs when the group dies from floor damage, not in battle. So they're walking around and poof, gone, and I can still walk around.
It depends on how you're implementing your permadeath.

By default, if an actor dies and you remove them from the party, everyone should slide up one space to fill the empty slot. So if that's not happening, then I'm guessing there's something wrong with the way you're removing them from the party.

Also, by default, if all of your battlers die, it's game over - there is no more walking around on the map at all. So again, you've done something to change the default behaviour.
It depends on how you're implementing your permadeath.

By default, if an actor dies and you remove them from the party, everyone should slide up one space to fill the empty slot. So if that's not happening, then I'm guessing there's something wrong with the way you're removing them from the party.

Also, by default, if all of your battlers die, it's game over - there is no more walking around on the map at all. So again, you've done something to change the default behaviour.

Yes if all of them die it's game over but in the above situation there were 2 reserve party members. I wish they were sliding up when they die but that isn't happening for me I'll list how I work permadeath.

If permadeath mode is selected a common event, parallel process runs. In it I first set a variable for each actors HP, so actor HP = HP of actor. Then in the same event, below the variables I put. in a condition branch that if the Hp is less than or equal to 1 remove party member. When I die to floor damage the character gets removed but the game keeps running normally. I didn't mention the floor damage thing, apologies. It does work when they all die in battle. So it's really just a map issue for if they die from floor damage the issue occurs.
the easiest solutions would be to add commands to whatever handles death now in your game - something you didn't link to, so we can't help there.

Additionally, you need to tell us what you want to be the players option(s) if the last actor dies instead of a list what you think might be doable, because everything is doable once you get to the point where your death is handled - for example if you use one of the "common event on death" scripts/plugins all you would have to do is to add several commands to the common event.
Hey there, thanks for the reply, I figured out a way to get it working earlier but I didn't want to double post so I thought I'd wait. Very sorry about being so vague, I didn't realize I was giving the wrong info. As for the fix, in my permadeath Parallel, I nested if\else condition branchs for all the characters using $gameActors.actor(1).isBattleMember() to see if they were in the battle group or not if no members are then it opens a character select screen. It works but It worry whats going to happen to this parallel process when it gets a good 100+ recruitable actors added to it.
@Jeremiah Eastman from the sound of it you're using an extremely convoluted method to circumvent something that should be done with three or four commands (for example there is absolutely no need to test specific actors for battlemembers in my opinion).

But as said above we can't point you to a better solution unless you show us what exactly you're doing.
Hers some pics of how its set up. Death is handled by being removed from the party by a parallel process, with the change party command, when a characters hp hits 1 or less. I would love to know how to clean this up I am really hoping now I can rework this like you said into 3 or 4 commands. This was simply the only method I was able to come up with on my own.
There are a lot of things in that event that can't work alone, so you're definately not giving all information. For example that event can only work that way if you're somewhow preventing regular death, but nothing there shows how you do that.
What I had in mind was a completely different approach that simply doesn't work if you already changed that much in the default engine (my method would have required the regular death and the party effects on that to work)

That said, why do you check every actor for who is a battlemember?
By default only the first four party members can be battlemembers (unless you changed the entire party system), so you only have to check those specific four actors.
Ok how do I just check those specific 4 actors then? That's all I was originally asking. But I am sorry for being what appears to be a big pain. As for what I have done to prevent death by changing the default engine, well I set battles to have a lose branch that I left empty, I didn't realize this was a reworking of the way the game handles death, apologies. But in the core game when you lose a battle with the lose battle condition empty, the core game will put you back on the map at 1 hp.

I had set it to that, the lose condition in a battle, when I was told to handle it that way on this site because of another issue that was arising. But then if I let the actor be killed to floor damage it was causing a death loop where the player would get stuck on the floor damage tile. I searched all over and asked in a post on this site but no one had a fix for that. That and the whole, why I use a check for all battle members is, as I told you above, the only thing I was able to come up with on my own. I am sorry if this is wrong but I am clearly not as skilled as you when it comes to rpg maker mv.
The control variable command (game data segment) will give you the ID of an actor in a specified party position, you'll need that to store the four IDs into four variables.
If you have no battlemember left all those IDs should be 0 but if your method of overriding the deathstate messes up with that, you simply use the variables instead of fixed numbers in the command you're already using.
The control variable command (game data segment) will give you the ID of an actor in a specified party position, you'll need that to store the four IDs into four variables.
If you have no battlemember left all those IDs should be 0 but if your method of overriding the deathstate messes up with that, you simply use the variables instead of fixed numbers in the command you're already using.

This is almost working but I am having an issue that I am not sure how to fix with it. So I set up 4 variables that are:

Control Variable: #0115 Battle Member 1 = actor id of party member 1
Control Variable: #0116 Battle Member 2 = actor id of party member 2
Control Variable: #0117 Battle Member 3 = actor id of party member 3
Control Variable: #0118 Battle Member 4 = actor id of party member 4

Then I used a nested:

if battle members 1 <= 0
if battle members 2 <= 0
if battle members 3 <= 0
if battle members 4 <= 0
Plugin command: OpenPartyMenu

I believe this should have worked however, say I have 1 reserve party member and a full group of 4 members, so 5 total members. As actors in the main group die the reserve member slides down into the next slot, so if all 4 group members die the reserve member fills the variable #0115 slot, which would be perfect except that the reserve member is still a reserve member, he is not becoming an actual battle member. Because of this the map visuals are still invisible and I can not open the party menu to add the reserve member as he is the only member so the game thinks there is no use for the command and grays it out. Also the reserve member is still dimmed, obviously, as he is a reserve member. The Actor Id of Party Member seems to mean party member not battle member, which seems to be the issue.
as I told you several times above, we can't really help you until you tell us how you disabled the regular death functions. Please link to the plugin you're using or whatever part you need for that function.
Without getting that info, any further help is impossible.
Ok, I thought I have listed that. I didn't disable death I just made it so if a characters hp is 1 or less they are removed from the party as is shown in the pics above. There is no plugin involved other than the yanfly party core to use the Plugin command: OpenPartyMenu when there were no battle members left.

When you start the game you are asked if you want to play in permadeath mode if you say yes permadeath switch is turned on turning on the parallel process permadeath, nothing else. Permadeath was ran completely from the one common event and it worked but was convoluted. I know you keep saying I did something else but that's it.
As actors in the main group die the reserve member slides down into the next slot, so if all 4 group members die the reserve member fills the variable #0115 slot, which would be perfect except that the reserve member is still a reserve member, he is not becoming an actual battle member.
This is the problem (or part of it) - that should not happen, because as soon as the actor becomes the first party member, he should be a battlemember by default.
And only a plugin can prevent that actor from becoming a battlemember automatically, and we need to know which plugin prevents that default function.
It might be caused by the party plugin or by something else, but that is for you to test - we need a link to the plugin that prevents the reserve member from becoming a battlemember automatically, as well as the plugin that prevents your game from automatically getting a gameover whenever all battlemembers are dead during combat (because that also should happen even if there are reserve members.
Ok it is Yanflys party system that is stopping them from being re-added as party members instead of reserve.🙁 When I turn it off it all works perfectly, I did not think that the plugin would affect this aspect but I was wrong. I do wish to keep the plugin as it is nice and deeply implemented in my game. As for if all battle members die there should be a game over, that's not true if you add, can lose. to the battle process and you have reserve members when you lose the battle and all battle members are dead you will be put back on the map with reserve players added. I just checked in a new project with no plugins to be sure.

http://yanfly.moe/2015/11/20/yep-29-party-system/

Edit:

Yanflys plugin allows you to not have a full battle group if you do not wish to and in my game I want players to have that opportunity. I believe that must be why the characters aren't slid into place upon deaths.

That being the case would you suggest I stick with the big convoluted mess that works for the set up? It seems like a scenario where it has to be one way or the other with the group members sliding into place if a member dies.
@Jeremiah Eastman
Solving that problem would require someone to go a lot deeper into the engine, and I simply can't do that at the moment.
There has to be a better solution, but that would most likely require some script code (a loop around the members comes into mind instead of checking each individually).

So until someone can work into that problem you'll have to do it with that list.
@Jeremiah Eastman
Solving that problem would require someone to go a lot deeper into the engine, and I simply can't do that at the moment.
There has to be a better solution, but that would most likely require some script code (a loop around the members comes into mind instead of checking each individually).

So until someone can work into that problem you'll have to do it with that list.

Thank you for the reply. That's what I was thinking, I guess luckily for me I don't run much in the way of parallel processes. I appreciate all the help you put in here, sorry I wasn't understanding the bigger picture at first.

Original thread: https://forums.rpgmakerweb.com/threads/need-fix-for-invisible-actor-movement-when-no-actor-in-group.80017/