Non Kombatant ACE

Non Kombatant ACE

by Kyonides
​

Introduction

This scriptlet allows you to prevent a certain hero from being present during battles.

This feature can also be disabled at any given time.

There are separate calls for party members and individual heroes. This lets you include or exclude any hero no matter if he has ever joined the party or has recently left it. How convenient that is, don't you agree? :ewink:

The Script
Ruby:
# * Non Kombatant ACE * #
#   Scripter : Kyonides Arkanthes
#   v0.3.0 - 2024-12-29

# This scriptlet allows you to prevent a certain hero from being present during
# battles. This feature can also be disabled at any given time.

# There are separate calls for party members and individual heroes. This lets
# you include or exclude any hero no matter if he has ever joined the party or
# has recently left it.

# Warning: Game_Party#members method has been aliased.

# * Script Calls * #

# - Set Party Member as NPC - Disabling him during battles
# $game_party.actor_as_npc(Index)

# - Set Party Single Hero as NPC - Disabling him during battles
# $game_actors[ID].is_npc = true

# - Set Party Member as Combatant - Enabling him during battles
# $game_party.npc_as_actor(Index)

# - Set Hero as Combatant - Enabling him during battles
# $game_actors[ID].is_npc = false

class Game_Actor
  attr_accessor :is_npc
end

class Game_Party
  alias :members_full :members
  alias :kyon_non_kombat_gm_pty_btl_members :battle_members
  def npcs
    members.select {|actor| actor.is_npc }
  end

  def members_without_npcs
    normal_members = @actors.map {|actor_id| $game_actors[actor_id] }
    normal_members.reject {|actor| actor.is_npc }
  end

  def members
    @in_battle ? members_without_npcs : members_full
  end

  def battle_members
    kyon_non_kombat_gm_pty_btl_members.reject {|actor| actor.is_npc }
  end

  def actor_as_npc(n)
    members_full[n].is_npc = true
  end

  def npc_as_actor(n)
    members_full[n].is_npc = false
  end
end

Terms & Conditions

Free for use in non commercial games but you gotta own a legal copy of the engine. 😛
Due credit is mandatory! 😮
That's it! 😛
Maintenance Upgrade​

As a precaution, I shortened the name of one alias to make it easy to use in 2 of my custom methods. This might ensure that all party members, including reservists, can be turned into NPC's and back to normal actors at will.

Original thread: https://forums.rpgmakerweb.com/threads/non-kombatant-ace.172188/