MV How to Lock Reserve Party Member?

Hey folks o/

I've been scouring the net for help on this one for awhile now and figured I'd post the question.

I'm looking to lock an actor in the reserve party. There are some party manager plugins (like Yanfly and Hime) and while they can lock a member in the party, they cannot lock a member out of it. I am not looking to remove the actor from the party. For very specific reasons, I only want to lock an actor so that it can't be moved from reserve party to battle party.

Is there a way to script this out? If no one knows of a plugin for this, can anyone point me in the right direction on how to script it myself? Maybe somewhere in the selection function adding an if statement that checks the actor ID and then doesn't allow selection if actor ID matches?

Thanks for your time.

TL : DR
- I want to lock an actor outside of the party, in the reserve section, without just removing the party member all together.

EDIT 2: Ok so I found this

$gameActors.actor($gameParty._battleMembers[this.index()])._locked

but when I rewrite it as this

$gameActors.actor($gameParty.members[this.index()])._locked

It throws an "undefined" error. Am I just writing it wrong?
There are some party manager plugins (like Yanfly and Hime) and while they can lock a member in the party, they cannot lock a member out of it.

So...using Yanfly's Party system, the plugin already works this way for me.

If the character is not currently in the battle party and I use the LockActor plugin command, he's locked out and I can't transfer him in via the Formation command.

I know that doesn't match the documentation (where it says that the actor is locked in place and must be in the party), but it already seems to work exactly the way you want.
You are quite right.

I am using Yan's party system but I am using a different custom party formation scene. The scene works perfect for everything but this one thing. I've got it so it checks for Yan's actor lock/require in the battle party but I'm having trouble doing so for the reserve. So I still need to find a way to script this or else I either gotta redesign my scene or use the overused plugin scene.

I feel like I'm really close to getting this but it is eluding me.
You should be able to just find the scene where it's selecting members and copy the code, no?
Here's what gets called when you select an actor in the formation:







It works perfectly if the actor is in the battle party and it works if I try to rearrange them within the reserve but it won't work if I go to move them from reserve into battle party. I know there's something I'm missing.

EDIT: This is the important part--





if (this._selectedIndex === -1) {
if (this.index() > $gameParty.maxBattleMembers() ||
(!$gameParty._battleMembers[this.index()] || (!Imported.YEP_PartySystem || !$gameActors.actor($gameParty._battleMembers[this.index()])._locked))) {
this._selectedIndex = this.index();
}
}
else if (this._selectedIndex === this.index()) {
this._selectedIndex = -1;
}
else {
//!!--- the rest of the function




I may need to check the selected index against what actor id is in the index and manually say if it equals a certain ID then "this._selectedIndex = -1" but I'm having trouble even doing that.
Moved to: Plugin Support

If that code you posted is from Yanfly's plugin, please remove it from your post.
It most certainly is not from a Yanfly plugin. It checks if certain Yanfly plugins are active (for example checking if Imported.YEP_PartySystem) and, if so, runs different lines of code so as to not write over any Yanfly stuff.

I've taken down the full function but left up the main part I requested help with. I'm guessing you guys have some sort of code-thief problem if you're jumping to conclusions over an import check.
I figured it out. Close the post.

Original thread: https://forums.rpgmakerweb.com/threads/how-to-lock-reserve-party-member.142272/