Help for a script for actor NPC

They don't for me.


Then you need a yanfly save file patch. That may very well be a side script. So you want the non battle actor to show in the save file? By default it uses the battle members, that's all it shows for me.
Spoiler: save
Ruby:
class Window_FileStatus < Window_Base
  #--------------------------------------------------------------------------
  # draw_save_characters
  #--------------------------------------------------------------------------
  def draw_save_characters(dx, dy)
    return if @header[:party].nil?
    reset_font_settings
    make_font_smaller
    dw = (contents.width - dx) / @header[:party].max_battle_members
    dx += dw/2
    count = 1
    for member in @header[:party].members
      next if member.nil?
      next if count > 4
      member = @header[:actors][member.id]
      change_color(normal_color)
      draw_actor_graphic(member, dx, dy)
      text = member.name
      draw_text(dx-dw/2, dy, dw, line_height, text, 1)
      text = member.level.group
      draw_text(dx-dw/2, dy-line_height, dw-4, line_height, text, 2)
      cx = text_size(text).width
      change_color(system_color)
      text = Vocab::level_a
      draw_text(dx-dw/2, dy-line_height, dw-cx-4, line_height, text, 2)
      dx += dw
      count += 1
    end
  end
end

I think you're confusing intended result for a glitch. I do not see any issue.


I did find a bug though it seems a previous version worked better for one part so I reverted some of the code and from my end all is working.
Oh sorry, maybe i am not explaining well enough.
1736000604433.png

These are the scripts i am using in a separate project for testing. And i got the scripts of Yanfly here: https://github.com/Archeia/YEARepo/blob/master/Core/Ace_Core_Engine.rb
Now, first the "Visual glitch" with the save engine... is that when you save with one actor looks pretty good, but when you do it with the
non combat actor gives some visual glitches

1736000901132.png
1736000920682.png
1736000950134.png

Anyways, this is not big deal, the problem (That i think is related to this visual glitch) is in the battles. Let me show you
1736001072319.png

The HP/MP bars of the actor are clearly streched i think xD, this happens with or withouth the non actor combat.
1736001221301.png

This is the only problem i had found, i hope you could fix it because the script is actually working pretty fine now with the final adjustments you did. So, thank you a lot for the help @Roninator2
when you do it with the
non combat actor gives some visual glitches
Did you see the spoiler I posted above. It was a change to Yanfly's save engine.

The HP/MP bars of the actor are clearly streched i think xD, this happens with or withouth the non actor combat.
seen. without my script it has the normal window. Sorry about that. Let me look into it.

*updated for yanfly battle engine. basically takes the max value in the script for how many columns to use. Sine Yanfly's script used the max battle member value to determine the columns.
Did you see the spoiler I posted above. It was a change to Yanfly's save engine.


seen. without my script it has the normal window. Sorry about that. Let me look into it.

*updated for yanfly battle engine. basically takes the max value in the script for how many columns to use. Sine Yanfly's script used the max battle member value to determine the columns.
Yeah, it works perfectly now! Thank you a lot man.
If i had to say one thing more its that if you use the MogHunter_VictoryResult the non combat actor doesn't gain exp never, withouth that script the non combat actor gain exp normally. But it doesn't matter too much because the script is now funcional...

Thank you very much Roninator2, you are great!
if you use the MogHunter_VictoryResult the non combat actor doesn't gain exp never,
Spoiler: mog_battle_result patch
Ruby:
#==============================================================================
# ■ Battle Result
#==============================================================================
class Battle_Result
  #--------------------------------------------------------------------------
  # ● Check Level UP
  #--------------------------------------------------------------------------
  alias :r2_check_level_up_non_combat :check_level_up
  def check_level_up   
    r2_check_level_up_non_combat
    mog_battle_result_non_combat_exp
  end 
  def mog_battle_result_non_combat_exp
    $game_party.non_battle_members.each do |actor|
      actor.gain_exp($game_troop.exp_total)
    end
  end
end
Spoiler: mog_battle_result patch
Ruby:
#==============================================================================
# ■ Battle Result
#==============================================================================
class Battle_Result
  #--------------------------------------------------------------------------
  # ● Check Level UP
  #--------------------------------------------------------------------------
  alias :r2_check_level_up_non_combat :check_level_up
  def check_level_up 
    r2_check_level_up_non_combat
    mog_battle_result_non_combat_exp
  end
  def mog_battle_result_non_combat_exp
    $game_party.non_battle_members.each do |actor|
      actor.gain_exp($game_troop.exp_total)
    end
  end
end
I tried it and the non combat actor actually gain EXP but there are 2 bugs, in the secuence of victory the non combat actor doesn't appear and the EXP that the non combat actor gains is the double for some reason (I checked that the rate exp was 1.0)
I tried it and the non combat actor actually gain EXP but there are 2 bugs, in the secuence of victory the non combat actor doesn't appear and the EXP that the non combat actor gains is the double for some reason (I checked that the rate exp was 1.0)
You did not specify what you wanted done so of course it's not programmed to show the non combat actor. the actors that are shown are the combat actors if you had a party with 10 members and only 4 battle members, then the 4 battle members would gain exp. If 2 out of the remaining 6 were non combat actors then they now gain exp and the remaining actors would not gain exp.

As for them getting double, that means you probably have the reserve exp checkbox selected in the system tab. Making all members get exp. If that's the case then the non combat actors are getting exp and you don't need my patch for battle results script.

I'm busy and will not look at this new request for a little while.
Well, then the only problem left would be that the non combat actor doesn't show in the Victory Result of Mog, anyways thank you a lot for the script man. If later you can check it i would appreciate it a lot.

Have a nice day Roninator!
Spoiler: MOG Battle Result patch
Ruby:
#==============================================================================
# ■ Battle Result
#==============================================================================
class Battle_Result
  #--------------------------------------------------------------------------
  # ● Check Level UP
  #--------------------------------------------------------------------------            
  def check_level_up    
      if @new_skills != nil and !@new_skills.empty?
         show_new_skill 
         return
       end  
      for battler_id in @result_member_id..@result_member_max + 1
          actor_result = $game_party.victory_members[@result_member_id]  
          $game_temp.level_parameter = []
          $game_temp.level_parameter_old = []
          $game_temp.level_parameter_old = [actor_result.level,actor_result.mhp,
          actor_result.mmp,actor_result.atk, actor_result.def, actor_result.mat,
          actor_result.mdf, actor_result.agi, actor_result.luk] rescue nil
          actor_result.gain_exp($game_troop.exp_total) rescue nil
          @result_member_id += 1 ; @new_skills = nil ; @new_skills_index = 0
          if @result_member_id > $game_party.victory_members.size
             $game_temp.level_parameter = [] 
             $game_temp.level_parameter_old = []
             next
           end
          if $game_temp.level_parameter != nil and !$game_temp.level_parameter.empty?
             show_level_result
             break
          end   
      end
      return if !$game_temp.level_parameter.empty?
      @victory_phase = 10 if @result_member_id > @result_member_max
  end  
  #--------------------------------------------------------------------------
  # ● Show Level Result
  #--------------------------------------------------------------------------              
  def show_level_result
      Sound.play_cursor
      @actor_result = $game_party.victory_members[@result_member_id - 1] rescue nil
      return if @actor_result == nil
      @actor_result.animation_id = RESULT_LEVELUP_ANIMATION_ID
      @fade_result_window = true
      create_levelup ; create_level ; create_parameter_number
      create_result_actor ; create_new_skill_window
  end  
  #--------------------------------------------------------------------------
  # ● Update Victory Item
  #--------------------------------------------------------------------------          
  def update_victory_item
      @window_treasure.update
      @actor_level = []
      return if @window_treasure.x != 0 and @victory_phase >= 6
      @victory_phase = 6
      if $data_system.opt_extra_exp
         @result_member_max = $game_party.members.size 
      else
         @result_member_max = $game_party.victory_members.size
      end
      @result_member_id = 0
  end
end

class Game_Party < Game_Unit
  def victory_members
    return battle_members + not_battle_members
  end
end
Hello @Roninator2

Thank you a lot for the patch, i was testing and there is only some minor bugs left.

There is a visual glitch, basically when the MOG Victory Result shows, the non combat actor has the level up animation and looks perfect, however when you enter a battle again, as soon as the battle starts the game shows the level up animation plus the sound effect

Also, if its possible it would be great that the non combat actor follows you in the map even if the max member amount is exceeded

I hope i explained well enough, you really helped a lot! Thank you very much
Also, if its possible it would be great that the non combat actor follows you in the map even if the max member amount is exceeded
If that is not working for you, you have done something wrong. The non combat actor does follow.
If you have 5 battle members and 3 non combat actors, then you have 8 sprites walking on the map.
I tested with 4 battle members and 2 non combat. I had 6 sprites on the map.

There is a visual glitch, basically when the MOG Victory Result shows, the non combat actor has the level up animation and looks perfect, however when you enter a battle again, as soon as the battle starts the game shows the level up animation plus the sound effect
I didn't test doing the second battle. Let me check... confirmed the sound does not play for the non combat actor until the next battle.
I'll fix that.
If that is not working for you, you have done something wrong. The non combat actor does follow.
If you have 5 battle members and 3 non combat actors, then you have 8 sprites walking on the map.
I tested with 4 battle members and 2 non combat. I had 6 sprites on the map.
No, i mean. For example the limit for actors in the party is of 4.
1736307695561.png

And those are the scripts i am using (The same for which I asked you for patches.) and the config of the script.

1736306633666.png


So, i have 4 characters in the team, the 4 are combat actors, and that would be the limit, but if i add a non combat actor the non combat actor is not visible in the map
1736306697426.png


So, would it be possible to make the non combat actor visible like follower in the map even if the max amount of actors (in combat) is exceeded?

Because if i put the max actors in 3, the non combat it's visible when its added (even if there are actually 3 members before) but idk why from 4 to up it doesn't work ;-;

I hope i explained well again because like you can see in the game i speak mainly spanish so yeah, i must polish my english
So, i have 4 characters in the team, the 4 are combat actors, and that would be the limit, but if i add a non combat actor the non combat actor is not visible in the map
Again, you've done something wrong. Either the scripts or whatever.
1736311041900.png
two actors and one non combat.

1736311083203.png
2 actors and 2 non combat

1736311160471.png

4 actors and 2 non combat.

* I've updated the patch above. Best I was able to get is to not have the animation play by adding one to the processing so it empties the data.
This makes the battle members get the animation and the non combat actors not get the animation and sound for the level up.
oh okey, i was testing and i think i know what is the problem.


If you add the characters from the data base (System) then it works perfectly, the non combat actors are visible even if the limit is exceeded

But if you do it with events
1736370917625.png

Like that for example, then only 4 actors will be visible, i don't know why does it happen, but i think there is the bug.


Again, you've done something wrong. Either the scripts or whatever.
View attachment 328288 two actors and one non combat.

View attachment 3282892 actors and 2 non combat

View attachment 328290
4 actors and 2 non combat.

* I've updated the patch above. Best I was able to get is to not have the animation play by adding one to the processing so it empties the data.
This makes the battle members get the animation and the non combat actors not get the animation and sound for the level up.

Also i tested the mog patch and it doesn't fix the bug... i saw that you update the patch but besides the animation of the non combat actor doesn't appear when you level up.

The problem of the animation appearing in the next combat remains.

I tested with the three yanfly scripts that i showed you just in case.
But if you do it with events
Seen had to add in a part to add the actor to the followers and then had to dispose the map sprites and recreate them. refresh the characters
Let me know if that part causes issues. I imagine it might have an issue with events returning to their original place so would look weird, so I'm still looking for a way to redraw the screen. Other option is to open the menu and close it. that works too.
Spoiler: Version 1.11
Ruby:
# ╔═══════════════════════════════════════════════╦════════════════════╗
# ║ Title: Non Combat Actor                       ║  Version: 1.11     ║
# ║ Author: Roninator2                            ║                    ║
# ╠═══════════════════════════════════════════════╬════════════════════╣
# ║ Function:                                     ║   Date Created     ║
# ║                                               ╠════════════════════╣
# ║ Specify actors to never be in combat          ║    03 Jul 2021     ║
# ╚═══════════════════════════════════════════════╩════════════════════╝
# ╔════════════════════════════════════════════════════════════════════╗
# ║ Requires: nil                                                      ║
# ║                                                                    ║
# ╚════════════════════════════════════════════════════════════════════╝
# ╔════════════════════════════════════════════════════════════════════╗
# ║ Brief Description:                                                 ║
# ║       Have Actors that do not fight                                ║
# ╚════════════════════════════════════════════════════════════════════╝
# ╔════════════════════════════════════════════════════════════════════╗
# ║ Instructions:                                                      ║
# ║ Place note tag on actor note box. <non combat>                     ║
# ║ Change number below to Max battle members                          ║
# ║                                                                    ║
# ╚════════════════════════════════════════════════════════════════════╝
# ╔════════════════════════════════════════════════════════════════════╗
# ║ Updates:                                                           ║
# ║ 1.00 - 03 Jul 2021 - Script finished                               ║
# ║ 1.01 - 04 Jul 2021 - updated                                       ║
# ║ 1.02 - 02 Jan 2025 - fixed a bug, allow having non members visible ║
# ║ 1.03 - 03 Jan 2025 - finally fixed the display order               ║
# ║ 1.04 - 03 Jan 2025 - Added Support to have non combat not gain exp ║
# ║ 1.05 - 03 Jan 2025 - Added Support hidden followers                ║
# ║ 1.06 - 03 Jan 2025 - Cleaned up unneeded code                      ║
# ║ 1.07 - 03 Jan 2025 - Fixed gaining exp for non battle actors       ║
# ║ 1.08 - 03 Jan 2025 - Attempt to fix issues reported                ║
# ║ 1.09 - 04 Jan 2025 - Made changes                                  ║
# ║ 1.10 - 08 Jan 2025 - Had to account for adding actors later        ║
# ║ 1.11 - 09 Jan 2025 - Issue with large parties                      ║
# ╚════════════════════════════════════════════════════════════════════╝
# ╔════════════════════════════════════════════════════════════════════╗
# ║ Credits and Thanks:                                                ║
# ║   Roninator2                                                       ║
# ║                                                                    ║
# ╚════════════════════════════════════════════════════════════════════╝
# ╔════════════════════════════════════════════════════════════════════╗
# ║ Terms of use:                                                      ║
# ║  Follow the original Authors terms of use where applicable         ║
# ║    - When not made by me (Roninator2)                              ║
# ║  Free for all uses in RPG Maker except nudity                      ║
# ║  Anyone using this script in their project before these terms      ║
# ║  were changed are allowed to use this script even if it conflicts  ║
# ║  with these new terms. New terms effective 03 Apr 2024             ║
# ║  No part of this code can be used with AI programs or tools        ║
# ║  Credit must be given                                              ║
# ╚════════════════════════════════════════════════════════════════════╝

module R2_Max_Battle_Members
  MAX = 4
  SHOW_NON_COMBAT = true
  GAIN_EXP_NON_COMBAT = true
  EXP_RATE = 1.0
end

# ╔══════════════════════════════════════════════════════════╗
# ║      No more editing                                     ║
# ╚══════════════════════════════════════════════════════════╝

class Game_Follower
  def set_character(character_name, character_index)
    @character_name = character_name
    @character_index = character_index
  end
end

class Game_Followers
  def initialize(leader)
    @visible = $data_system.opt_followers
    @gathering = false
    @data = []
    @data.push(Game_Follower.new(1, leader))
    (2...$game_party.max_battle_members.size).each do |index|
      @data.push(Game_Follower.new(index, @data[-1]))
    end
  end
  def setup_non_battle_members
    return unless R2_Max_Battle_Members::SHOW_NON_COMBAT
    return if $game_party.non_battle_members == []
    $game_party.non_battle_members.each do |i|
      @data.push(Game_Follower.new(@data.size, @data[-1]))
    end
  end
end

class Game_Party < Game_Unit
  attr_reader :non_battle_members
 
  alias :r2_game_party_initialize_na :initialize
  def initialize
    r2_game_party_initialize_na
    @non_battle_members = nil
  end

  def battle_members
    array = []
    for act in @actors
      nonact = $data_actors[act]
      next if nonact.note =~ /<non combat>/i
      actor = $game_actors[act]
      next if !actor.exist?
      next if array.size >= R2_Max_Battle_Members::MAX
      array << actor
    end
    return array
  end
 
  def not_battle_members
    @non_battle_members = []
    for act in @actors
      nonact = $data_actors[act]
      if nonact.note =~ /<non combat>/i
        actor = $game_actors[act]
        next if !actor.exist?
        @non_battle_members << actor
      end
    end
    return @non_battle_members
  end
 
  def max_battle_members
    in_battle ? battle_members.size : battle_members.size + not_battle_members.size
  end

  alias :r2_setup_starting_members_nb :setup_starting_members
  def setup_starting_members
    r2_setup_starting_members_nb
    not_battle_members
    $game_player.followers.setup_non_battle_members
  end
 
  alias :r2_swap_order_non_combat :swap_order
  def swap_order(index1, index2)
    r2_swap_order_non_combat(index1, index2)
    $game_player.refresh
  end
 
  alias :r2_add_actor_non_combat  :add_actor
  def add_actor(actor_id)
    r2_add_actor_non_combat(actor_id)
    not_battle_members
    nonact = $data_actors[actor_id]
    if nonact.note =~ /<non combat>/i
      $game_player.followers.add_non_follower(all_members.size)
    end
    SceneManager.scene.instance_variable_get(:@spriteset).refresh_characters
  end

  alias :r2_remove_actor_non_combat  :remove_actor
  def remove_actor(actor_id)
    r2_remove_actor_non_combat(actor_id)
    not_battle_members
    $game_player.refresh
    $game_map.need_refresh = true
  end
end

class Game_Follower < Game_Character
  def actor
    $game_party.members[@member_index]
  end
end

class Game_Followers
  attr_reader :data
  def add_non_follower(index)
    @data.push(Game_Follower.new(index - 1, @data[-1]))
    new = @data[-1]
    old = @data[-2]
    new.moveto(old.x, old.y)
  end
end

class Scene_Map < Scene_Base
  alias :r2_not_battle_member_update :update
  def update
    r2_not_battle_member_update
    call_not_battle_member_graphic if $game_player.followers.visible_folloers
  end

  def call_not_battle_member_graphic
    return if R2_Max_Battle_Members::SHOW_NON_COMBAT == false
    pos = 0
    cnt = 0
    $game_party.all_members.each_with_index do |actor, index|
      next if actor == nil
      next if index == 0
      nonact = $data_actors[actor.id]
      if nonact.note =~ /<non combat>/i
        follower = $game_player.followers[index - 1 - pos]
        follower.set_character(actor.character_name, actor.character_index)
      else
        if cnt < $game_party.battle_members.size - 1
          follower = $game_player.followers[index - 1 - pos]
          next unless follower
          follower.set_character(actor.character_name, actor.character_index)
        else
          pos += 1
        end
      end
      cnt += 1
    end
  end
end

class Game_Actor < Game_Battler
  def reserve_members_exp_rate
    if $game_party.non_battle_members.include?(self) &&
      R2_Max_Battle_Members::GAIN_EXP_NON_COMBAT
        return R2_Max_Battle_Members::EXP_RATE
    else
      $data_system.opt_extra_exp ? 1 : 0
    end
  end
end

Also i tested the mog patch and it doesn't fix the bug... i saw that you update the patch but besides the animation of the non combat actor doesn't appear when you level up.
They do for me. I'm getting the 4 battle actors leveling up and two non combat actors.
The problem of the animation appearing in the next combat remains.
Maybe you didn't copy the script correctly? guessing here. no issues for me on this anymore.
Seen had to add in a part to add the actor to the followers and then had to dispose the map sprites and recreate them. refresh the characters
Let me know if that part causes issues. I imagine it might have an issue with events returning to their original place so would look weird, so I'm still looking for a way to redraw the screen. Other option is to open the menu and close it. that works too.
Yeah, there are some minor bugs. The only thing that scares me is that if you add (for example) 5 normal actors (with events) when the limit is 4 and after that you add a non combat actor, the game crashes with this bug
1736394058862.png


Besides this bug, there is another problem very weird to be honest.

If you add a non combat actor, after that you quit it and return to add it, for some strange reason adding or removing characters can cause visual glitches pretty weirds.
1736394589087.png

Actually, the thing is that the last character duplicates or you can see even 6 members following you when you should just see maximum 5, things like that.

I tried opening menu and using formation option but it doesn't fix it.
Pretty weird.
Maybe you didn't copy the script correctly? guessing here. no issues for me on this anymore.
About this, with the "animation" i mean the animation ID that is showed when you level up.
1736394737441.png

That thing, i put the "Mog Victory Result" patch in a separate script
1736395057424.png

I thing it's everything working fine but the animation showed doesn't appear in the non combat actor and appears in the next battle, with less opacity but the sound remains.

Those are all the bugs i found, thank you a lot for the help again @Roninator2
I didn't thought this would be so hard xD Sorry for all
The only thing that scares me is that if you add (for example) 5 normal actors (with events) when the limit is 4 and after that you add a non combat actor, the game crashes with this bug
Fixed. had to put in a - 1

Actually, the thing is that the last character duplicates or you can see even 6 members following you when you should just see maximum 5, things like that.
Not happening for me. unless you mean saving and loading. let me test. nope. but I see there is a save bug still. I'll check that out. * fixed. save script on first page updated

I thing it's everything working fine but the animation showed doesn't appear in the non combat actor and appears in the next battle, with less opacity but the sound remains.
I explained that. I can't find a way to have the animation play on the non combat actor. But I prevented the animation playing on the next battle.
Not happening for me. unless you mean saving and loading. let me test. nope. but I see there is a save bug still. I'll check that out. * fixed. save script on first page updated
Okey, let me explain again, because now i think i know how it occurs.

1736467154608.png

These are my configs btw.

In this case i will start with only a character (Normal Actor) and i will add in an event a non combat actor
1736467891222.png


After that if i add another character (Normal Actor) then its when the bug of the duplicate characters appear

1736468081858.png

In this case, there is a empty space between the followers by a reason i don't understand

There are another ways for make this bug appear because i was trying to add and remove actors randomly, but i don't have idea of what causes it.
Try this version.
It still has a bug if you were to add in the same actor that was already in the party. so as long as you don't do that then it should be fine.
Spoiler: Non Combat Actors on map V1.12
Ruby:
# ╔═══════════════════════════════════════════════╦════════════════════╗
# ║ Title: Non Combat Actor                       ║  Version: 1.12     ║
# ║ Author: Roninator2                            ║                    ║
# ╠═══════════════════════════════════════════════╬════════════════════╣
# ║ Function:                                     ║   Date Created     ║
# ║                                               ╠════════════════════╣
# ║ Specify actors to never be in combat          ║    03 Jul 2021     ║
# ╚═══════════════════════════════════════════════╩════════════════════╝
# ╔════════════════════════════════════════════════════════════════════╗
# ║ Requires: nil                                                      ║
# ║                                                                    ║
# ╚════════════════════════════════════════════════════════════════════╝
# ╔════════════════════════════════════════════════════════════════════╗
# ║ Brief Description:                                                 ║
# ║       Have Actors that do not fight                                ║
# ╚════════════════════════════════════════════════════════════════════╝
# ╔════════════════════════════════════════════════════════════════════╗
# ║ Instructions:                                                      ║
# ║   Place note tag on actor note box. <non combat>                   ║
# ║   Change number below to Max battle members                        ║
# ║ Known Bug: adding actors already in party breaks this script       ║
# ╚════════════════════════════════════════════════════════════════════╝
# ╔════════════════════════════════════════════════════════════════════╗
# ║ Updates:                                                           ║
# ║ 1.00 - 03 Jul 2021 - Script finished                               ║
# ║ 1.01 - 04 Jul 2021 - updated                                       ║
# ║ 1.02 - 02 Jan 2025 - fixed a bug, allow having non members visible ║
# ║ 1.03 - 03 Jan 2025 - finally fixed the display order               ║
# ║ 1.04 - 03 Jan 2025 - Added Support to have non combat not gain exp ║
# ║ 1.05 - 03 Jan 2025 - Added Support hidden followers                ║
# ║ 1.06 - 03 Jan 2025 - Cleaned up unneeded code                      ║
# ║ 1.07 - 03 Jan 2025 - Fixed gaining exp for non battle actors       ║
# ║ 1.08 - 03 Jan 2025 - Attempt to fix issues reported                ║
# ║ 1.09 - 04 Jan 2025 - Made changes                                  ║
# ║ 1.10 - 08 Jan 2025 - Had to account for adding actors later        ║
# ║ 1.11 - 09 Jan 2025 - Issue with large parties                      ║
# ║ 1.12 - 10 Jan 2025 - Fixed duplicating actors                      ║
# ╚════════════════════════════════════════════════════════════════════╝
# ╔════════════════════════════════════════════════════════════════════╗
# ║ Credits and Thanks:                                                ║
# ║   Roninator2                                                       ║
# ║                                                                    ║
# ╚════════════════════════════════════════════════════════════════════╝
# ╔════════════════════════════════════════════════════════════════════╗
# ║ Terms of use:                                                      ║
# ║  Follow the original Authors terms of use where applicable         ║
# ║    - When not made by me (Roninator2)                              ║
# ║  Free for all uses in RPG Maker except nudity                      ║
# ║  Anyone using this script in their project before these terms      ║
# ║  were changed are allowed to use this script even if it conflicts  ║
# ║  with these new terms. New terms effective 03 Apr 2024             ║
# ║  No part of this code can be used with AI programs or tools        ║
# ║  Credit must be given                                              ║
# ╚════════════════════════════════════════════════════════════════════╝

module R2_Max_Battle_Members
  MAX = 4
  SHOW_NON_COMBAT = true
  GAIN_EXP_NON_COMBAT = true
  EXP_RATE = 1.0
end

# ╔══════════════════════════════════════════════════════════╗
# ║      No more editing                                     ║
# ╚══════════════════════════════════════════════════════════╝

class Game_Follower < Game_Character
  attr_reader :member_index
  def set_character(character_name, character_index)
    @character_name = character_name
    @character_index = character_index
  end
  def actor
    $game_party.members[@member_index]
  end
end

class Game_Followers
  attr_reader :data
  def initialize(leader)
    @visible = $data_system.opt_followers
    @gathering = false
    @data = []
    @data.push(Game_Follower.new(1, leader))
    (2...$game_party.max_battle_members.size).each do |index|
      @data.push(Game_Follower.new(index, @data[-1]))
    end
  end
  def setup_non_battle_members
    return unless R2_Max_Battle_Members::SHOW_NON_COMBAT
    return if $game_party.non_battle_members == []
    $game_party.non_battle_members.each do |i|
      @data.push(Game_Follower.new(@data.size, @data[-1]))
      new = @data[-1]
      new.moveto($game_player.x, $game_player.y)
    end
  end
  def add_non_follower(index)
    found = false
    @data.each { |fol|
      if fol.member_index == index
        found = true
      end
    }
    if found == false
      @data.push(Game_Follower.new(index, @data[-1]))
      new = @data[-1]
      old = @data[-2]
      new.moveto(old.x, old.y)
    end
  end
end

class Game_Party < Game_Unit
  attr_reader :non_battle_members
 
  alias :r2_game_party_initialize_na :initialize
  def initialize
    r2_game_party_initialize_na
    @non_battle_members = nil
  end

  def battle_members
    array = []
    for act in @actors
      nonact = $data_actors[act]
      next if nonact.note =~ /<non combat>/i
      actor = $game_actors[act]
      next if !actor.exist?
      next if array.size >= R2_Max_Battle_Members::MAX
      array << actor
    end
    return array
  end
 
  def not_battle_members
    @non_battle_members = []
    for act in @actors
      nonact = $data_actors[act]
      if nonact.note =~ /<non combat>/i
        actor = $game_actors[act]
        next if !actor.exist?
        @non_battle_members << actor
      end
    end
    return @non_battle_members
  end
 
  def max_battle_members
    in_battle ? battle_members.size : battle_members.size + not_battle_members.size
  end

  alias :r2_setup_starting_members_nb :setup_starting_members
  def setup_starting_members
    r2_setup_starting_members_nb
    not_battle_members
    $game_player.followers.setup_non_battle_members
  end
 
  alias :r2_swap_order_non_combat :swap_order
  def swap_order(index1, index2)
    r2_swap_order_non_combat(index1, index2)
    $game_player.refresh
  end
 
  alias :r2_add_actor_non_combat  :add_actor
  def add_actor(actor_id)
    list = []
    $game_party.members.each { |mem|  list.push(mem.clone) }
    r2_add_actor_non_combat(actor_id)
    not_battle_members
    nonact = $data_actors[actor_id]
    if nonact.note =~ /<non combat>/i
      $game_player.followers.add_non_follower(actor_id) unless
        list.include?($game_actors[actor_id])
    end
    SceneManager.scene.instance_variable_get(:@spriteset).refresh_characters
  end

  alias :r2_remove_actor_non_combat  :remove_actor
  def remove_actor(actor_id)
    r2_remove_actor_non_combat(actor_id)
    $game_player.refresh
    $game_map.need_refresh = true
  end
end

class Scene_Map < Scene_Base
  alias :r2_not_battle_member_update :update
  def update
    r2_not_battle_member_update
    call_not_battle_member_graphic if $game_player.followers.visible_folloers
  end

  def call_not_battle_member_graphic
    return if R2_Max_Battle_Members::SHOW_NON_COMBAT == false
    pos = 0
    cnt = 0
    $game_party.all_members.each_with_index do |actor, index|
      next if actor == nil
      next if index == 0
      nonact = $data_actors[actor.id]
      if nonact.note =~ /<non combat>/i
        follower = $game_player.followers[index - 1 - pos]
        next unless follower
        follower.set_character(actor.character_name, actor.character_index)
      else
        if cnt < $game_party.battle_members.size - 1
          follower = $game_player.followers[index - 1 - pos]
          next unless follower
          follower.set_character(actor.character_name, actor.character_index)
          cnt += 1
        else
          pos += 1
        end
      end
    end
  end
end

class Game_Actor < Game_Battler
  def reserve_members_exp_rate
    if $game_party.non_battle_members.include?(self) &&
      R2_Max_Battle_Members::GAIN_EXP_NON_COMBAT
        return R2_Max_Battle_Members::EXP_RATE
    else
      $data_system.opt_extra_exp ? 1 : 0
    end
  end
end
Try this version.
It still has a bug if you were to add in the same actor that was already in the party. so as long as you don't do that then it should be fine.
I tested all and... it works perfect! Thank you a lot man, this was pretty useful and sorry for the inconvenients.
Good news. I figured out the animation thing.

Spoiler: Non combat level up animation MOG battle result
Ruby:
class Window_BattleStatus < Window_Selectable
  def col_max; return $game_party.max_battle_members; end
end
 
class Spriteset_Battle
  alias :r2_init_non_combat :initialize
  def initialize
    create_non_combat_actors
    r2_init_non_combat
  end
 
  alias :r2_update_non_combat :update
  def update
    update_non_actors
    r2_update_non_combat
  end
 
  def create_non_combat_actors
    @non_actor_sprites = Array.new($game_party.non_battle_members.size) { Sprite_Battler.new(@viewport1) }
  end

  def battler_sprites
    @enemy_sprites + @actor_sprites + @non_actor_sprites
  end
 
  alias :r2_dispose_non_combat  :dispose
  def dispose
    r2_dispose_non_combat
    dispose_non_combat_actors
  end
 
  def dispose_non_combat_actors
    @non_actor_sprites.each {|sprite| sprite.dispose }
  end

  def update_non_actors
    @non_actor_sprites.each_with_index do |sprite, i|
      sprite.battler = $game_party.non_battle_members[i]
      sprite.update
    end
  end
end
if $imported["YEA-BattleEngine"]
class Game_Actor < Game_Battler
 
  def screen_x
    return 0 unless SceneManager.scene_is?(Scene_Battle)
    status_window = SceneManager.scene.status_window
    return 0 if status_window.nil?
    if $game_party.non_battle_members.include?(self)
      return 10
    else
      item_rect_width = (status_window.width-24) / $game_party.max_battle_members
      ext = SceneManager.scene.info_viewport.ox
      rect = SceneManager.scene.status_window.item_rect(self.index)
      constant = 128 + 12
      return constant + rect.x + item_rect_width / 2 - ext
    end
  end
 
end
end

Original thread: https://forums.rpgmakerweb.com/threads/help-for-a-script-for-actor-npc.174256/