Remove all other actors from party

Hello again!

First - I want to thank this community so, so much for all of their help. You are all saints! I spent 8 hours last week trying to get a pixel monster to move across a screen; today I'm working with far more complicated tasks, and although I'm nowhere near where I need to be to make a polished game, I am enjoying my learning journey - and you are all making it so much easier.

Okay!

The most basic premise of my game is that it is a virtual pet, like oldschool tamagotchi/digimon. My game is set up so that the user is not controlling the Player, but interacts with their Player through a series of on-screen buttons (I'm using Yanfly's YEP Picture Common Event plug-in with great success for this).
I'm also using the YEP Class Change plug-in to facilitate monster evolution (again, with great success - forever thanks to Yanfly, my gosh!) Also, users need to be able to generate additional copies of an actor. For this, I'm using SRD's Copy Actor plug-in, which so far seems to be doing exactly what I want it to do.

I want users to be able to obtain additional monsters (this will be accomplished through a rare item drop from enemies, which will be traded in to an NPC in return for a monster, which I'm quite confident I can do).

My conundrum is this:

I want there to only be one actor in the party at any given time, but I need to manipulate the party through events, since I'm not using the in-game menu system. The only party remove function that I can find through eventing requires that a certain actor is specified (eg, Change Party Member: Remove <SpecificActor>)- but my system needs to be dynamic, because the player could have one of 20-30 actors in their party (some of which are copies) at any given time.

Is there a way for me to call up a list of non-partied, available actors through eventing, and a way for me to replace the current party with the user's choice from that list regardless of what actor is in the party already?

I'm not afraid of scripting; though I don't know much, I'm eager to learn. =)
The easiest workaround is to remove all other actors.

Using the actor remove command on an actor that is not in the party simply does nothing, so if you remove all actors but the one you want in the party then you get the same effect as you want.

and it can be further simplyfied if you're using only one sequence and remove everything from the party, and re-add the one actor you want there after everything is removed.
If an actor is removed and re-added in the same event without any wait between, then that happens too fast for the player to even realise that the party was empty for half of a frame.

One of the more important lessons in game development is that what the player sees and what he is told is not neccesarily the same as what happens inside the game. There are quite a number of cases and effects where it is easier to trick the player into believing something happened than making it happen itself.
I want there to only be one actor in the party at any given time
So through all your game, it will only have one actor in the party. Right?

If I understand you correctly, you can use this:
JavaScript:
$gameParty.removeActor($gameParty.leader()._actorId);
$gameParty.addActor(ID of the actor you want to add);

$gameParty.leader()._actorId > This will return the ID of the actor that will be in the first place in your party(is the one that you see in the map, is the player);

$dataActors > This will return to you an array of all actors in the Database.

If you type: $dataActors[id] this will return various pieces of information of the actor with given Id.
Thank you both!

remove everything from the party, and re-add the one actor you want there after everything is removed.

This sounds exactly like what I want to do. =) Is there a way for me to empty the party regardless of what actors are in it, without having to specify each actor ID?

(See edit below!)

So through all your game, it will only have one actor in the party. Right?

If I understand you correctly, you can use this:

That's correct - there will only be one actor in the party, but who that actor is will change. Thank you for the suggestions. =)


EDIT:
I think I found the script I was looking for:
Code:
$gameParty._actors = []

It's generating some errors at the moment regarding writing custom parameters to the new 0th party player, but it is making the party changes that I wanted and I think I can figure those out (I think it's a timing conflict with a parallel process I have running... been meaning to move that chunk of code into a switch anyway, so I guess here's my excuse, lol)

It's working perfectly, there was indeed a bit of a timing issue with a parallel process, but it was super easy to resolve.

Thank you so much!

Original thread: https://forums.rpgmakerweb.com/threads/remove-all-other-actors-from-party.119353/