RMMZ Is there a script call to remove reserve members from the party?

Clyve

Veteran
Veteran
Joined
Aug 6, 2013
Messages
62
Reaction score
7
First Language
English
Primarily Uses
RMMV
I've set up an HQ of sorts and I'd like for members who are not in the active party to be hanging around the base. The problem is that members in reserve are still counted as in the party, even if they're not in the active party.

Is there a script call I can do to forcefully eject reserve members from the party?
 

Andar

Veteran
Veteran
Joined
Mar 5, 2013
Messages
32,378
Reaction score
8,097
First Language
German
Primarily Uses
RMMV
the reserve is simply any party member above number 4, and you can use the regular change membership commands for those actors.

however I wouldn't bother with that and instead go to check the process before adding members.

on the HQ map, you'll make one event placeholder for every party member. you'll need three or four event pages there depending on what you want to do.
first page is when the player doesn't know of the actor - empty page, empty chair/bed or whatever.
second page would be conditioned to a switch "actor available", having the actor picture for the actor staying at HQ and asking if he should join the party. And have that joining conditioned on space in the party.
third page is conditioned on actor in party and basically an empty chair again, possibly asking if the actor should leave here or giving options on what the actor can do in the HQ or whatever.

then on every event in the world where the player can find actors, he will activate the switch for "actor available" and check for party size before adding the actor. If the party is already too large the actor will automatically be available on HQ after the switch.
 

Shaz

Global Moderators
Global Mod
Joined
Mar 2, 2012
Messages
41,924
Reaction score
14,556
First Language
English
Primarily Uses
RMMV
As you control when members are added to the party and when they are removed, you simply do not allow new members to be added when the party is full. Make the player remove someone first, then let them add another.
 

Clyve

Veteran
Veteran
Joined
Aug 6, 2013
Messages
62
Reaction score
7
First Language
English
Primarily Uses
RMMV
Thanks for the responses guys.

I should have clarified the reason I'm asking for this specifically is because I'm using Visu's party management (I'm not looking for plugin help - inb4 move) in order to set max members to 5, but the formation screen etc doesn't have any provisions for removing actors from the party, only putting in reserve.

I was hoping that the engine somehow flagged members as being in reserve somehow and that this could be called as a condition in an event in order to remove any party members marked as reserve so I can modify their state outside of any plugins.
 
Last edited:

Shaz

Global Moderators
Global Mod
Joined
Mar 2, 2012
Messages
41,924
Reaction score
14,556
First Language
English
Primarily Uses
RMMV
That would depend on the features of the plugin, as it overrides the "first 4 members are battlers and everyone else is reserved" default behaviour.. So you are looking for plugin help.

Moving to Plugin Support

 

Clyve

Veteran
Veteran
Joined
Aug 6, 2013
Messages
62
Reaction score
7
First Language
English
Primarily Uses
RMMV
That would depend on the features of the plugin, as it overrides the "first 4 members are battlers and everyone else is reserved" default behaviour.. So you are looking for plugin help.

[mod]Moving to Plugin Support[/mod]

Except it's not, because all other party members past 5 ARE in reserve. If there is a general function in RM that is applied to reserve party members, that would work independent of plugins. If there is a function that is applied to members in reserve, it will apply past the 4th if using standard and past the 5th if not. It's still a standard function of the engine.

I don't care where you want to put it, I just don't want to miss out on information that people with general knowledge may have. By burying it in plugin help, I worry it will be dismissed or overlooked by people that have general knowledge but not plugin knowledge when I want to do something that has nothing to with any plugin.
 
Last edited:

Andar

Veteran
Veteran
Joined
Mar 5, 2013
Messages
32,378
Reaction score
8,097
First Language
German
Primarily Uses
RMMV
but the formation screen etc doesn't have any provisions for removing actors from the party,
that is because the reserve is part of the party and the party manager was never intended to handle adding and removing from the party. Even with that plugin you are supposed to use change member event command to handle that part.

and again, that plugin does NOT stop you from doing so.
if you increased the party size to 5 and don't want a reserve, then simply check if there are more than five actors in the party before adding another member, exactly as Shaz and I have told you above.
 

Attachments

  • check5.png
    check5.png
    88.8 KB · Views: 5

Clyve

Veteran
Veteran
Joined
Aug 6, 2013
Messages
62
Reaction score
7
First Language
English
Primarily Uses
RMMV
that is because the reserve is part of the party and the party manager was never intended to handle adding and removing from the party. Even with that plugin you are supposed to use change member event command to handle that part.

and again, that plugin does NOT stop you from doing so.
if you increased the party size to 5 and don't want a reserve, then simply check if there are more than five actors in the party before adding another member, exactly as Shaz and I have told you above.

Is there a function in RPG Maker MZ that identifies whether or not a party member is in reserve?
 

Andar

Veteran
Veteran
Joined
Mar 5, 2013
Messages
32,378
Reaction score
8,097
First Language
German
Primarily Uses
RMMV
Is there a function in RPG Maker MZ that identifies whether or not a party member is in reserve?
no, because by default the reserve is defined by the number of battle members - if the index of the party position is higher than the number of the battle members, then the actor is in the reserve.

It might be that the party manager plugin introduces an attribute for this, especially if it changes the way the reserve is defined - but there is no such thing needed in the default engine, because you simply check which party index an actor has. And that is done like I showed in the screenshot, checking which actor is in a specific party index.
 

Clyve

Veteran
Veteran
Joined
Aug 6, 2013
Messages
62
Reaction score
7
First Language
English
Primarily Uses
RMMV
no, because by default the reserve is defined by the number of battle members - if the index of the party position is higher than the number of the battle members, then the actor is in the reserve.

It might be that the party manager plugin introduces an attribute for this, especially if it changes the way the reserve is defined - but there is no such thing needed in the default engine, because you simply check which party index an actor has. And that is done like I showed in the screenshot, checking which actor is in a specific party index.

Understood, thanks for the help. :D

Unfortunately, using that method will work properly for members past 5, but if you have a solo party member, it views reserves 1-4 as being in party member spots 2-5 and doesn't process for them. :/
 
Last edited:

Clyve

Veteran
Veteran
Joined
Aug 6, 2013
Messages
62
Reaction score
7
First Language
English
Primarily Uses
RMMV
Ramza sorted me. This can be closed :D
 

Andar

Veteran
Veteran
Joined
Mar 5, 2013
Messages
32,378
Reaction score
8,097
First Language
German
Primarily Uses
RMMV
but if you have a solo party member, it views reserves 1-4 as being in party member spots 2-5 and doesn't process for them. :/
that is because of the plugin then - by default it is impossible to have reserve members before the battleparty is full.
 

ramza

Lunatic Coder
Veteran
Joined
Jan 28, 2013
Messages
913
Reaction score
576
First Language
English
Primarily Uses
RMMV
Ramza sorted me. This can be closed :D
Just in case someone else finds this by googling your question/issue later.

Code:
Game_Party.prototype.reserveMembers = function(){
    const battleMembers = this.battleMembers()
    const allMembers = this.allMembers()
    const reserveMembers = []
    for (i = 0; i < allMembers.length; i++){
        var mem = allMembers[i]
        if (!battleMembers.includes(mem)){
            reserveMembers.push(mem)
        }
    }
    return reserveMembers
}
This code snippet adds a function to $gameParty which will return an array of all current party members who are not in the battle party. Save it as a .js file, and import it into your plugin manager.

You can then use the array it returns in a script call to actually remove the reserve members from the party (temporarily, or otherwise).
Code:
var reserve = $gameParty.reserveMembers()
for (var i = 0; i < reserve.length; i++){
    $gameParty.removeActor(reserve[i].actorId())
}
 

Latest Threads

Latest Posts

Latest Profile Posts

Shaz wrote on Tohtori_Jamba's profile.
Hi, you can post a thread for your game in the Completed Games forum. Please check the pinned thread there and make sure you provide all the requested information.
and_remember_tomorrow_more_redesigns_4.jpg

edit: The complete redesign of my player HUD, Time rewind message, mini map and puzzle map.... I'll toss up an animated version later. :LZSexcite:
Oh no my hospital test results are not good......just not good, but at least explains why my health tank more than usual lately. Stupid body. I want a refund on this body. = .=
Ami
Finally,MogHunter's Site is Open Again!

https://moonglesoft.wordpress.com/
You know, having a project this big is kinda nice. I can procrastinate working on one part, while still progressing with another part :guffaw:

Forum statistics

Threads
110,626
Messages
1,054,799
Members
143,755
Latest member
Austejafeja
Top