Add/Remove Group Member via Script Call of Group Manager Script?

I'm referring to

http://galvs-scripts.com/2012/11/19/group-manager/

There's a process that occurs when you manually add or remove an actor from a group.

For eventing/story purposes it is important for the game to be able to add or remove members. What if someone leaves the group, or you add a new member to your team or someone temporarily joins?

When you switch groups then switch back, by collecting the members of that group and having that new member left out or the member that left still being there, that would mess up your game and also look weird when you manage groups.

(The script is wonderful, by the way)

I couldn't find out how to replicate this process, and Galv is busy.

There's

def add_member RPG::SE.new(Galv_Split::ADD_SE[0], Galv_Split::ADD_SE[1], Galv_Split::ADD_SE[2]).play $game_party.group[@g] << $game_party.members[@p].id endand 

def remove_member RPG::SE.new(Galv_Split::REM_SE[0], Galv_Split::REM_SE[1], Galv_Split::REM_SE[2]).play $game_party.group[@g] -= [$game_party.members[@p].id] end def remove_from_all_groups $game_party.group.each_with_index do |g,i| $game_party.group -= [$game_party.members[@p].id] end endalthough idk if that's relevant
I'm sure there's an actual question in there somewhere, but I'm struggling to find it.


You add and remove members via the Change Party Members event command.


If this is not the question, or the script requires you to do something else, then you're going to have to state it more clearly.
With this script, you cannot have the game add or remove members into groups via script calls. The only way to add or remove members is by going to the Group Manager scene as the player. Which is not scene-friendly. Since I know the script has a way of adding or removing members based on what you do in the Group Management scene window, I wanted to be able to do this via script calls.

Would you know how to replicate such? That is the question.

My apologies.
Okay, that makes it a bit more clear. Moving to RGSSx Script support
One thing about this forum is that you can't double-post. Heheh.

I know you've already assisted me with things today.
Use this for adding members.

$game_party.group[group_id] += [actor_id]For removing, use this.

Code:
$game_party.group[group_id] -= [actor_id]
*eyes gleam*

Thank you.

Is there a way to condition if a group has a member?

Like 

$game_party.group[group_id].has? actor.$game_actor[1](this explanation might be a bit bumpy🙂

I had a way of doing it where the game would register the members of groups into variables by switching the active members to the members of each group, then registering each slot's actor id respectively. So say variables 1-8 would be group 1's members, and variables 8-16 would be group 2's members, and soforth, and then I would register what group each actor is in by having it so that if actor 1 is present while group 3 is being conditioned, then Actor 1's Group is 3.

And I know technically what I could do is have it so that the condition is 

if variables 1, 2, 3, 4, 5, 6, 7, or 8 (Group 1's slots actor ids) are equal to 1, then that means that Actor 1 is in Group 1.

But my way's kind of sloppy and doesn't fit well with some situations.

With your call, I could add actor 3 to a group 5 times with no way to know if he's already added (and it's weird, too. Hahah.)
Going by the above (I didn't look at the script again), you could probably use:

Code:
$game_party.group[group_id].include?(actor_id)
Wow, it does. Thanks!
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.

Original thread: https://forums.rpgmakerweb.com/threads/add-remove-group-member-via-script-call-of-group-manager-script.25958/