galv's group manager script

Is there any way to modificate galv's group manager script to 1) have only one group in the home base where you can add max 7 members

2) when a party member is joining and the party is full, to drop it automatically to the group of the home base instead of making you to add him by yourshelf 3) When you add a member in the home base group, a specific variable's constant is being substracted by 1 and added by 1 as removing it from the group. And 4) Remove the 0/8 (in my case will be 0/7) letters in the right side of the group window, so the player will not know how many of how members are in.
Is there any way to modificate galv's group manager script to 1) have only one group in the home base where you can add max 7 members

2) when a party member is joining and the party is full, to drop it automatically to the group of the home base instead of making you to add him by yourshelf 3) When you add a member in the home base group, a specific variable's constant is being substracted by 1 and added by 1 as removing it from the group. And 4) Remove the 0/8 (in my case will be 0/7) letters in the right side of the group window, so the player will not know how many of how members are in.

1) Can be done using the options, specifically on lines 122 and 123
2) What do you mean mean party is full? The members that can participate in the battle?
3) Can also be done with the script. On line 115 you choose on which variable the number of members of group 1 will be stored. You want to get the number of free spaces in the group, so you will have to do "7 - variable"
4) Delete lines 452-456
So about 3) I didn't understood at all... i want the variable 6 to be added by 1 when you get a member to your party and subtracted by 1 when you remove a member from your party....how can i do that? [Also notice that when you have only one member in party, the leader, the variable should be 0] Also about 2), I want the party to have max 4 players, and when you meet the 5th one, I want it to be dropped in the home base automatically but without the variable to being added by 1, because the 5th member is not joining the party. One more thing is, how can i make it unable to leave a dead member in the home base?


EDIT: So, regardless the things i want to do...is there any way to fix the bug that shows your whole party character sprites when you talk to the man for the group manager?
Okay, now it is more clear.
This script does what you want. I added an option in case you wanted to change in which variable it is stored (for request 3).
Code:
#===============================================================================
# Script for Galv's Group Manager ver. 1.3
# Requested by: RpG LoVeR
# What was added:
#   * If the party has 4 actors, any new actor that joins the party will be
#   moved to the first group (and removed from the party)
#   * Variable 6 stores the number of actors in the party (without the ones in
#   a grouop)
#   * Dead actors can not be moved to the group
#===============================================================================
module FOG_OPTIONS
  VARIABLE_INDX = 6
end

class Game_Party < Game_Unit
  alias fog_init initialize
  def initialize
    fog_init
  end
 
  alias fog_aa add_actor
  def add_actor(actor_id)
    fog_aa(actor_id)
    $game_variables[FOG_OPTIONS::VARIABLE_INDX] = members.length if members.count <= 4
    if members.count >= 5
      $game_party.group[0] << actor_id
      remove_actor(actor_id)
    end
  end
 
  alias fog_ra remove_actor
  def remove_actor(actor_id)
    fog_ra(actor_id)
    $game_variables[FOG_OPTIONS::VARIABLE_INDX] = members.length if members.count <= 4
  end
end

class Scene_GroupManager < Scene_MenuBase
  alias fog_opo on_party_ok
  def on_party_ok
    check_if_locked
    if !$game_party.members[@party_window.index].alive?
      $game_temp.group_error = "Member is dead."
      show_error
      @party_window.deactivate
      return
    end
    fog_opo
  end
end

class Window_Party_List < Window_Selectable
  alias fog_cis check_if_set
  def check_if_set(check)
    if !$game_party.members[check-1].alive?
      @set = false
      return
    end
    fog_cis(check)
  end
end

# class Window_Group_List < Window_Selectable
#   def draw_character(character_name, character_index, x, y)
#   end
# end
I'm not sure what you mean by the whole party being drawn (it doesn't happen to me at least) I added an edit that will make it so that no characters are drawn at all (maybe what you wanted?).
Thx, but what i have to do with this? I have to add this script as is below materials, or i have to add it in the galv's group manager script?


EDIT: I Tried both and this error appeared when i talked to the event that calls the group manager script:
Oh, sorry forgot to mention it. You have to add it above main and below Galv's Group Manager script.
Also, I can't see the image you added.
Forget about the error...The script seems to be fine...but there are still some bugs tho...1) the sprite drawing is still there 2)when you have at least 1 dead member in party, you are able to give all your members except the dead one, what causes gameover and 3) when i get the 5th member and i am going to check the home base if the 5th member is there, the game freezes as soon as i talk to the event.

EDIT: An image about 1) can be found here:

(Notice that the sprites are be shown after the first time i talked to the man, and gave him the members)
Forget about the error...The script seems to be fine...but there are still some bugs tho...1) the sprite drawing is still there 2)when you have at least 1 dead member in party, you are able to give all your members except the dead one, what causes gameover and 3) when i get the 5th member and i am going to check the home base if the 5th member is there, the game freezes as soon as i talk to the event.

EDIT: An image about 1) can be found here:

(Notice that the sprites are be shown after the first time i talked to the man, and gave him the members)

The original script doesn't have the exact functionality that you wanted (request 1). When an actor was moved from the party to a group he/she wasn't removed from the party and the only way to change the party members from a group was to use the group_selector() function.
I edited the script and added the functionality you wanted. I am still not sure if you want the actors' sprites to be drawn in the "Hotel Cabin 1" box. If you don't want them to be drawn remove the "#~" at the end of the script.
If you would like some options to be added (like max number of party members, or something else) let me know.
Add the script as is below Galv's Group Manager script.
Code:
#===============================================================================
# Script for Galv's Group Manager ver. 1.3
# Requested by: RpG LoVeR
# Script by: vFoggy
# What was added:
#   * If the party has 4 actors, any new actor that joins the party will be
#   moved to the first group (and removed from the party)
#   * Variable 6 stores the number of actors in the party (without the ones in
#   a group)
#   * Dead actors can not be moved to the group
#   * When actors are moved in a group, they are removed from the party and vice
#   versa
#   * If the party is full (4 actors) the player can't remove any actors from
#   the group
# Changed:
#   * remove_member function now takes the member that is going to be removed as
#   an argument.
#   * All actors are drawn in the party list window (those that are in the party
#   and those that are in the first group), so that the user can select an actor
#   and remove him from the group (as they will not be in the party anymore)
#===============================================================================
module FOG_OPTIONS
  VARIABLE_INDX = 6
end

class Game_Party < Game_Unit
  alias fog_init initialize
  def initialize
    fog_init
  end
 
  alias fog_aa add_actor
  def add_actor(actor_id)
    fog_aa(actor_id)
    $game_variables[FOG_OPTIONS::VARIABLE_INDX] = members.length if members.count <= 4
    if members.count >= 5
      $game_party.group[0] << actor_id unless $game_party.group[0].include?(actor_id)
      remove_actor(actor_id)
    end
  end
 
  alias fog_ra remove_actor
  def remove_actor(actor_id)
    fog_ra(actor_id)
    $game_variables[FOG_OPTIONS::VARIABLE_INDX] = members.length if members.count <= 4
  end
end

class Scene_GroupManager < Scene_MenuBase
  alias fog_ogo on_group_ok
  def on_group_ok
    all_dead = false
    $game_party.members.length.times do |i|
      next if i == @party_window.index
      if !$game_party.members[i].alive?
        all_dead = true
      else
        all_dead = false
        break
      end
    end
 
    if all_dead
      $game_temp.group_error = "Can't remove character."
      show_error
      @group_window.deactivate
    else
      fog_ogo
    end
  end
 
  def on_party_ok
    check_if_locked
    indx = @party_window.index
    member = indx >= $game_party.members.count ? $game_actors[indx] : $game_party.members[indx]
    if !member.alive?
      $game_temp.group_error = "Member is dead."
      show_error
      @party_window.deactivate
      return
    end
 
    check_if_locked
    if @locked_members.include?(member.id)
      $game_temp.group_error = "Member in locked group."
      show_error
      @party_window.deactivate
    else
      @party_index = @party_window.index
      @group_index = 0 if @group_index.nil?
      @party_window.deactivate
      @group_window.activate
      @group_window.select(@group_index)
    end
  end
 
  def member_action
    @g = @group_window.index
    @p = @party_window.index
    if @p >= $game_party.members.count
      @p -= $game_party.members.count
      member = $game_actors[$game_party.group[0][@p]]
    else
      member = $game_party.members[@p]
    end
 
    # Check if group locked
    if !$game_party.group_info[@g][2].nil?
      return Sound.play_buzzer if $game_party.group_info[@g][2] == true
    end
 
    if $game_party.group[@g].include?(member.id)
      puts $game_party.members.count
      if $game_party.members.count == 4
        $game_temp.group_error = "Party is full."
        show_error
        @group_window.deactivate
        return Sound.play_buzzer
      end
      remove_member(member)
    else
      return Sound.play_buzzer if $game_party.group[@g].count >= max_members
      remove_from_all_groups if Galv_Split::ONLY_ONE_GROUP
      add_member
    end
  end
 
  alias fog_am add_member
  def add_member
    fog_am
    $game_party.remove_actor($game_party.members[@p].id)
  end
 
  def remove_member(member)
    RPG::SE.new(Galv_Split::REM_SE[0], Galv_Split::REM_SE[1], Galv_Split::REM_SE[2]).play
    $game_party.add_actor(member.id)
    $game_party.group[@g] -= [member.id]
  end
end

class Window_Party_List < Window_Selectable
  alias fog_init initialize
  def initialize(data)
    super(party_x, (Graphics.height - 410) / 2, 96 + standard_padding * 2, 410)
    self.opacity = 255
    @index = 0
    @set = true
    @item_max = $game_party.members.count + $game_party.group[0].count
    refresh(data)
    select(0)
    activate
  end
 
  alias fog_r refresh
  def refresh(data)
    self.contents.clear
    self.contents = Bitmap.new(96, @item_max * 96)
    for i in 0...$game_party.members.count
       draw_item(i) unless i == nil
    end
    $game_party.group[0].each do |id|
      draw_group_item(id)
    end
  end
 
  def draw_item(index)
    x = 0
    y = (index) / col_max * 96
    check_item_max
    @mem = $game_party.members
    check_if_set(@mem[index].id)
    draw_face(@mem[index].face_name, @mem[index].face_index, x, y, @set)
  end
 
  def draw_group_item(id)
    x = 0
    index = $game_party.group[0].index(id) + $game_party.members.count
    y = (index) / col_max * 96
    draw_face($game_actors[id].face_name, $game_actors[id].face_index, x, y, false)
  end
 
  def check_item_max
    @data_max = $game_party.members.count + $game_party.group[0].count
  end
 
  def item_max
    return @item_max == nil ? 0 : @item_max
  end
 
  alias fog_cis check_if_set
  def check_if_set(check)
    mem = $game_party.members.select{|mem| mem.id == check}[0]
    if !mem.alive?
      @set = false
      return
    end
    fog_cis(check)
  end
end

#~ class Window_Group_List < Window_Selectable
#~   def draw_character(character_name, character_index, x, y)
#~   end
#~ end
So, about 2 and 3, seems to be ok. About 1 now, maybe you haven't understand yet what i am trying to do dont you? Look i will try to explain you as good as i can...So for an example...I have 4 players in party.Then i am talking to the man to store 3 members so i will have only 1 in party (the leader). Then the only member in the party is the leader, without any members behind him. And then when you talk to the man to take back your members, the 3 members that you stored before are shown in the party,behind the leader( the problem is NOT in the home base selections). But the case is that they shouldn't be shown because you are alone in party.
That's what the script does.
You have a party of four actors.
You store three. Exit the manager. One party member remains and is the only one that is shown (no followers because he is alone).
I have uploaded a screenshot with this.
Also, the script had a bug and I fixed it, use this one:
Code:
#===============================================================================
# Script for Galv's Group Manager ver. 1.3
# Requested by: RpG LoVeR
# Script by: vFoggy
# What was added:
#   * If the party has 4 actors, any new actor that joins the party will be
#   moved to the first group (and removed from the party)
#   * Variable 6 stores the number of actors in the party (without the ones in
#   a group)
#   * Dead actors can not be moved to the group
#   * When actors are moved in a group, they are removed from the party and vice
#   versa
#   * If the party is full (4 actors) the player can't remove any actors from
#   the group
# Changed:
#   * remove_member function now takes the member that is going to be removed as
#   an argument.
#   * All actors are drawn in the party list window (those that are in the party
#   and those that are in the first group), so that the user can select an actor
#   and remove him from the group (as they will not be in the party anymore)
#===============================================================================
module FOG_OPTIONS
  VARIABLE_INDX = 6
end

class Game_Party < Game_Unit
  alias fog_init initialize
  def initialize
    fog_init
  end
 
  def add_actor(actor_id)
    @actors.push(actor_id) unless @actors.include?(actor_id) or @group[0].include?(actor_id)
    $game_player.refresh
    $game_map.need_refresh = true
   
    $game_variables[FOG_OPTIONS::VARIABLE_INDX] = members.length if members.count <= 4
    if members.count >= 5
      $game_party.group[0] << actor_id unless $game_party.group[0].include?(actor_id)
      remove_actor(actor_id)
    end
  end
 
  alias fog_ra remove_actor
  def remove_actor(actor_id)
    fog_ra(actor_id)
    $game_variables[FOG_OPTIONS::VARIABLE_INDX] = members.length if members.count <= 4
  end
end

class Scene_GroupManager < Scene_MenuBase
  alias fog_ogo on_group_ok
  def on_group_ok
    all_dead = false
    $game_party.members.length.times do |i|
      next if i == @party_window.index
      if !$game_party.members[i].alive?
        all_dead = true
      else
        all_dead = false
        break
      end
    end
   
    if all_dead
      $game_temp.group_error = "Can't remove character."
      show_error
      @group_window.deactivate
    else
      fog_ogo
    end
  end
 
  def on_party_ok
    check_if_locked
    indx = @party_window.index
    member = indx >= $game_party.members.count ? $game_actors[indx] : $game_party.members[indx]
    if !member.alive?
      $game_temp.group_error = "Member is dead."
      show_error
      @party_window.deactivate
      return
    end
   
    check_if_locked
    if @locked_members.include?(member.id)
      $game_temp.group_error = "Member in locked group."
      show_error
      @party_window.deactivate
    else
      @party_index = @party_window.index
      @group_index = 0 if @group_index.nil?
      @party_window.deactivate
      @group_window.activate
      @group_window.select(@group_index)
    end
  end
 
  def member_action
    @g = @group_window.index
    @p = @party_window.index
    if @p >= $game_party.members.count
      @p -= $game_party.members.count
      member = $game_actors[$game_party.group[0][@p]]
    else
      member = $game_party.members[@p]
    end
   
    # Check if group locked
    if !$game_party.group_info[@g][2].nil?
      return Sound.play_buzzer if $game_party.group_info[@g][2] == true
    end
   
    if $game_party.group[@g].include?(member.id)
      puts $game_party.members.count
      if $game_party.members.count == 4
        $game_temp.group_error = "Party is full."
        show_error
        @group_window.deactivate
        return Sound.play_buzzer
      end
      remove_member(member)
    else
      return Sound.play_buzzer if $game_party.group[@g].count >= max_members
      remove_from_all_groups if Galv_Split::ONLY_ONE_GROUP
      add_member
    end
  end
 
  alias fog_am add_member
  def add_member
    fog_am
    $game_party.remove_actor($game_party.members[@p].id)
  end
 
  def remove_member(member)
    RPG::SE.new(Galv_Split::REM_SE[0], Galv_Split::REM_SE[1], Galv_Split::REM_SE[2]).play
    $game_party.group[@g] -= [member.id]
    $game_party.add_actor(member.id)
  end
end

class Window_Party_List < Window_Selectable
  alias fog_init initialize
  def initialize(data)
    super(party_x, (Graphics.height - 410) / 2, 96 + standard_padding * 2, 410)
    self.opacity = 255
    @index = 0
    @set = true
    @item_max = $game_party.members.count + $game_party.group[0].count
    refresh(data)
    select(0)
    activate
  end
 
  alias fog_r refresh
  def refresh(data)
    self.contents.clear
    self.contents = Bitmap.new(96, @item_max * 96)
    for i in 0...$game_party.members.count
       draw_item(i) unless i == nil
    end
    $game_party.group[0].each do |id|
      draw_group_item(id)
    end
  end
 
  def draw_item(index)
    x = 0
    y = (index) / col_max * 96
    check_item_max
    @mem = $game_party.members
    check_if_set(@mem[index].id)
    draw_face(@mem[index].face_name, @mem[index].face_index, x, y, @set)
  end
 
  def draw_group_item(id)
    x = 0
    index = $game_party.group[0].index(id) + $game_party.members.count
    y = (index) / col_max * 96
    draw_face($game_actors[id].face_name, $game_actors[id].face_index, x, y, false)
  end
 
  def check_item_max
    @data_max = $game_party.members.count + $game_party.group[0].count
  end
 
  def item_max
    return @item_max == nil ? 0 : @item_max
  end
 
  alias fog_cis check_if_set
  def check_if_set(check)
    mem = $game_party.members.select{|mem| mem.id == check}[0]
    if !mem.alive?
      @set = false
      return
    end
    fog_cis(check)
  end
end
b.jpg
Sooo yea, it seems that what i wanted has been fixed but i noticed another little bug xD.....When you try to donate up to 1 member in the same time, without canceling the group selection, you are able to store the dead member

EDIT: Also, one more favor if you dont mind....can you make it when a character is dead, an X will appear above his face graphic in the home base?
Okay, I fixed this bug.
If you find any more let me know.
Code:
#===============================================================================
# Script for Galv's Group Manager ver. 1.3
# Requested by: RpG LoVeR
# Script by: vFoggy
# What was added:
#   * If the party has 4 actors, any new actor that joins the party will be
#   moved to the first group (and removed from the party)
#   * Variable 6 stores the number of actors in the party (without the ones in
#   a group)
#   * Dead actors can not be moved to the group
#   * When actors are moved in a group, they are removed from the party and vice
#   versa
#   * If the party is full (4 actors) the player can't remove any actors from
#   the group
# Changed:
#   * remove_member function now takes the member that is going to be removed as
#   an argument.
#   * All actors are drawn in the party list window (those that are in the party
#   and those that are in the first group), so that the user can select an actor
#   and remove him from the group (as they will not be in the party anymore)
#===============================================================================
module FOG_OPTIONS
  VARIABLE_INDX = 6
end

class Game_Party < Game_Unit
  alias fog_init initialize
  def initialize
    fog_init
  end
 
  def add_actor(actor_id)
    @actors.push(actor_id) unless @actors.include?(actor_id) or @group[0].include?(actor_id)
    $game_player.refresh
    $game_map.need_refresh = true
    
    $game_variables[FOG_OPTIONS::VARIABLE_INDX] = members.length if members.count <= 4
    if members.count >= 5
      $game_party.group[0] << actor_id unless $game_party.group[0].include?(actor_id)
      remove_actor(actor_id)
    end
  end
 
  alias fog_ra remove_actor
  def remove_actor(actor_id)
    fog_ra(actor_id)
    $game_variables[FOG_OPTIONS::VARIABLE_INDX] = members.length if members.count <= 4
  end
end

class Scene_GroupManager < Scene_MenuBase
  alias fog_ogo on_group_ok
  def on_group_ok
    all_dead = false
    $game_party.members.length.times do |i|
      next if i == @party_window.index
      if !$game_party.members[i].alive?
        all_dead = true
      else
        all_dead = false
        break
      end
    end
    
    if all_dead
      $game_temp.group_error = "Can't remove character."
      show_error
      @group_window.deactivate
    else
      fog_ogo
    end
  end
 
  def on_party_ok
    check_if_locked
    indx = @party_window.index
    if indx >= $game_party.members.count
      g_indx = indx-$game_party.members.count
      g_id = $game_party.group[0][g_indx]
      member = $game_actors[g_id]
    else
      member = $game_party.members[indx]
    end
    if !member.alive?
      $game_temp.group_error = "Member is dead."
      show_error
      @party_window.deactivate
      return
    end
    
    check_if_locked
    if @locked_members.include?(member.id)
      $game_temp.group_error = "Member in locked group."
      show_error
      @party_window.deactivate
    else
      @party_index = @party_window.index
      @group_index = 0 if @group_index.nil?
      @party_window.deactivate
      @group_window.activate
      @group_window.select(@group_index)
    end
  end
 
  def member_action
    @g = @group_window.index
    @p = @party_window.index
    if @p >= $game_party.members.count
      @p -= $game_party.members.count
      member = $game_actors[$game_party.group[0][@p]]
    else
      member = $game_party.members[@p]
    end
    
    # Check if group locked
    if !$game_party.group_info[@g][2].nil?
      return Sound.play_buzzer if $game_party.group_info[@g][2] == true
    end
    
    if $game_party.group[@g].include?(member.id)
      if $game_party.members.count == 4
        $game_temp.group_error = "Party is full."
        show_error
        @group_window.deactivate
        return Sound.play_buzzer
      end
      remove_member(member)
      @party_index = $game_party.members.count-1
    else
      return Sound.play_buzzer if $game_party.group[@g].count >= max_members
      remove_from_all_groups if Galv_Split::ONLY_ONE_GROUP
      add_member
      @party_index = $game_party.members.count + $game_party.group[0].count-1
    end
    on_group_cancel
  end
 
  alias fog_am add_member
  def add_member
    fog_am
    $game_party.remove_actor($game_party.members[@p].id)
  end
 
  def remove_member(member)
    RPG::SE.new(Galv_Split::REM_SE[0], Galv_Split::REM_SE[1], Galv_Split::REM_SE[2]).play
    $game_party.group[@g] -= [member.id]
    $game_party.add_actor(member.id)
  end
end

class Window_Party_List < Window_Selectable
  alias fog_init initialize
  def initialize(data)
    super(party_x, (Graphics.height - 410) / 2, 96 + standard_padding * 2, 410)
    self.opacity = 255
    @index = 0
    @set = true
    @item_max = $game_party.members.count + $game_party.group[0].count
    refresh(data)
    select(0)
    activate
  end
 
  alias fog_r refresh
  def refresh(data)
    self.contents.clear
    self.contents = Bitmap.new(96, @item_max * 96)
    for i in 0...$game_party.members.count
       draw_item(i) unless i == nil
    end
    $game_party.group[0].each do |id|
      draw_group_item(id)
    end
  end
 
  def draw_item(index)
    x = 0
    y = (index) / col_max * 96
    check_item_max
    @mem = $game_party.members
    check_if_set(@mem[index].id)
    draw_face(@mem[index].face_name, @mem[index].face_index, x, y, @set)
  end
 
  def draw_group_item(id)
    x = 0
    index = $game_party.group[0].index(id) + $game_party.members.count
    y = (index) / col_max * 96
    draw_face($game_actors[id].face_name, $game_actors[id].face_index, x, y, false)
  end
 
  def check_item_max
    @data_max = $game_party.members.count + $game_party.group[0].count
  end
  
  def item_max
    return @item_max == nil ? 0 : @item_max
  end 
 
  alias fog_cis check_if_set
  def check_if_set(check)
    mem = $game_party.members.select{|mem| mem.id == check}[0]
    if !mem.alive?
      @set = false
      return
    end
    fog_cis(check)
  end
end
It is perfect now! Thanks man, much appreciated! But It would be awesome if you would draw a X graphic on the dead actor's face graphic, so the player can recognize who is dead and who is in the home base without selecting his face graphic to see.
It is perfect now! Thanks man, much appreciated! But It would be awesome if you would draw a X graphic on the dead actor's face graphic, so the player can recognize who is dead and who is in the home base without selecting his face graphic to see.

Here is the script with the changes requested.
Dead members are indicated with a death state icon on bottom left and party members have an index drawn on their face icon on the bottom right.
Code:
#===============================================================================
# Script for Galv's Group Manager ver. 1.3
# Requested by: RpG LoVeR
# Script by: vFoggy
# What was added:
#   * If the party has 4 actors, any new actor that joins the party will be
#   moved to the first group (and removed from the party)
#   * Variable 6 stores the number of actors in the party (without the ones in
#   a group)
#   * Dead actors can not be moved to the group (indicated with a state icon)
#   * When actors are moved in a group, they are removed from the party and vice
#   versa
#   * If the party is full (4 actors) the player can't remove any actors from
#   the group
# Changed:
#   * remove_member function now takes the member that is going to be removed as
#   an argument.
#   * All actors are drawn in the party list window (those that are in the party
#   and those that are in the first group), so that the user can select an actor
#   and remove him from the group (as they will not be in the party anymore)
#===============================================================================
module FOG_OPTIONS
  VARIABLE_INDX = 6
end

class Game_Party < Game_Unit
  alias fog_init initialize
  def initialize
    fog_init
  end
 
  def add_actor(actor_id)
    @actors.push(actor_id) unless @actors.include?(actor_id) or @group[0].include?(actor_id)
    $game_player.refresh
    $game_map.need_refresh = true
  
    $game_variables[FOG_OPTIONS::VARIABLE_INDX] = members.length if members.count <= 4
    if members.count >= 5
      $game_party.group[0] << actor_id unless $game_party.group[0].include?(actor_id)
      remove_actor(actor_id)
    end
  end
 
  alias fog_ra remove_actor
  def remove_actor(actor_id)
    fog_ra(actor_id)
    $game_variables[FOG_OPTIONS::VARIABLE_INDX] = members.length if members.count <= 4
  end
end

class Scene_GroupManager < Scene_MenuBase
  def on_party_cancel
    check_members_in_groups
    check_min_group_members
  
    if @check_arrays.sort != @party_array.sort && Galv_Split::REQUIRE_GROUPED
      # Check all members have been distributed
      $game_temp.group_error = "All members must be in a group."
      show_error
    elsif @min_number_check == false
      # Check if all groups have minimum requirement of members filled
      $game_temp.group_error = "A group requires members."
      show_error
    elsif $game_party.all_dead?
      $game_temp.group_error = "At least one member in party must be alive."
      show_error
    elsif Galv_Split::REQUIRE_UNASSIGNED && !Galv_Split::REQUIRE_GROUPED
      # Check if at least 1 unassigned party member remains
      if @check_arrays.sort == @party_array.sort
        $game_temp.group_error = "One member must be unassigned."
        show_error
      else
        $game_party.saved_group[0] = @party_array.sort - @group_array.sort
        SceneManager.return
      end
    else
      $game_party.saved_group[0] = @party_array.sort - @group_array.sort
      SceneManager.return
    end
  end
 
  def on_party_ok
    check_if_locked
    indx = @party_window.index
    if indx >= $game_party.members.count
      g_indx = indx-$game_party.members.count
      g_id = $game_party.group[0][g_indx]
      member = $game_actors[g_id]
    else
      member = $game_party.members[indx]
    end
    if !member.alive?
      $game_temp.group_error = "Member is dead."
      show_error
      @party_window.deactivate
      return
    end
  
    check_if_locked
    if @locked_members.include?(member.id)
      $game_temp.group_error = "Member in locked group."
      show_error
      @party_window.deactivate
    else
      @party_index = @party_window.index
      @group_index = 0 if @group_index.nil?
      @party_window.deactivate
      @group_window.activate
      @group_window.select(@group_index)
    end
  end
 
  def member_action
    @g = @group_window.index
    @p = @party_window.index
    if @p >= $game_party.members.count
      @p -= $game_party.members.count
      member = $game_actors[$game_party.group[0][@p]]
    else
      member = $game_party.members[@p]
    end
  
    # Check if group locked
    if !$game_party.group_info[@g][2].nil?
      return Sound.play_buzzer if $game_party.group_info[@g][2] == true
    end
  
    if $game_party.group[@g].include?(member.id)
      if $game_party.members.count == 4
        $game_temp.group_error = "Party is full."
        show_error
        @group_window.deactivate
        return Sound.play_buzzer
      end
      remove_member(member)
      @party_index = $game_party.members.count-1
    else
      return Sound.play_buzzer if $game_party.group[@g].count >= max_members
      remove_from_all_groups if Galv_Split::ONLY_ONE_GROUP
      add_member
      @party_index = $game_party.members.count + $game_party.group[0].count-1
    end
    on_group_cancel
  end
 
  alias fog_am add_member
  def add_member
    fog_am
    $game_party.remove_actor($game_party.members[@p].id)
  end
 
  def remove_member(member)
    RPG::SE.new(Galv_Split::REM_SE[0], Galv_Split::REM_SE[1], Galv_Split::REM_SE[2]).play
    $game_party.group[@g] -= [member.id]
    $game_party.add_actor(member.id)
  end
end

class Window_Party_List < Window_Selectable
  alias fog_init initialize
  def initialize(data)
    super(party_x, (Graphics.height - 410) / 2, 96 + standard_padding * 2, 410)
    self.opacity = 255
    @index = 0
    @set = true
    @item_max = $game_party.members.count + $game_party.group[0].count
    refresh(data)
    select(0)
    activate
  end
 
  alias fog_r refresh
  def refresh(data)
    self.contents.clear
    self.contents = Bitmap.new(96, @item_max * 96)
    for i in 0...$game_party.members.count
       draw_item(i) unless i == nil
    end
    $game_party.group[0].each do |id|
      draw_group_item(id)
    end
  end
 
  def draw_item(index)
    x = 0
    y = (index) / col_max * 96
    check_item_max
    @mem = $game_party.members
    check_if_set(@mem[index].id)
    draw_party_face(@mem[index].face_name, @mem[index].face_index, x, y, @set, !@mem[index].alive?)
  end
 
  def draw_group_item(id)
    x = 0
    index = $game_party.group[0].index(id) + $game_party.members.count
    y = (index) / col_max * 96
    draw_face($game_actors[id].face_name, $game_actors[id].face_index, x, y, false)
  end
 
  def draw_party_face(face_name, face_index, x, y, enabled = true, dead = false)
    bitmap = Cache.face(face_name)
    b_x = face_index % 4 * 96 + 96
    b_y = face_index / 4 * 96 + 96
    txt_w = 12
    txt_h = 24
    party_index = y/96 + 1
    bitmap.draw_text(b_x-txt_w, b_y-txt_h, txt_w, txt_h, party_index.to_s)
    if dead
      icon_bitmap = Cache.system("Iconset")
      icon_index = 17 # death state index
      icon_rect = Rect.new(icon_index % 16 * 24, icon_index / 16 * 24, 24, 24)
      bitmap.blt(b_x-96, b_y-24, icon_bitmap, icon_rect, 255)
      icon_bitmap.dispose
    end
    rect = Rect.new(face_index % 4 * 96, face_index / 4 * 96, 96, 96)
    contents.blt(x, y, bitmap, rect, enabled ? 255 : translucent_alpha)
    bitmap.dispose
  end
 
  def check_item_max
    @data_max = $game_party.members.count + $game_party.group[0].count
  end
 
  def item_max
    return @item_max == nil ? 0 : @item_max
  end
 
  alias fog_cis check_if_set
  def check_if_set(check)
    mem = $game_party.members.select{|mem| mem.id == check}[0]
    if !mem.alive?
      @set = false
      return
    end
    fog_cis(check)
  end
end

Original thread: https://forums.rpgmakerweb.com/threads/galvs-group-manager-script.79488/