Non Kombatant VX + ACE
#1
Non Kombatant VX + ACE
Version 0.2.0

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? Winking

RMVX Script

Code:
# * Non Kombatant VX * #
#   Scripter : Kyonides Arkanthes
#   v0.2.3 - 2024-09-26

# 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_BattleAction
  alias :kyon_non_kombat_gm_bta_dc_rand_tgt :decide_random_target
  alias :kyon_non_kombat_gm_bta_dc_last_tgt :decide_last_target
  def decide_random_target
    kyon_non_kombat_gm_bta_dc_rand_tgt
    clear unless @target_index
  end

  def decide_last_target
    kyon_non_kombat_gm_bta_dc_last_tgt
    clear unless @target_index
  end
end

class Game_Actor
  attr_accessor :is_npc
end

class Game_Party
  #alias :kyon_non_kombat_gm_pty_rand_trgt_actor :random_target_actor
  alias :kyon_non_kombat_gm_pty_members :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
    $game_temp.in_battle ? members_without_npcs : kyon_non_kombat_gm_pty_members
  end

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

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

RMVX ACE Script

Code:
# * Non Kombatant ACE * #
#   Scripter : Kyonides Arkanthes
#   v0.2.0 - 2024-09-26

# 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 :kyon_non_kombat_gm_pty_members :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 : kyon_non_kombat_gm_pty_members
  end

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

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

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


Terms & Conditions

Free Beer for use in non commercial games but you gotta own a legal copy of the engine. Tongue sticking out
Due credit is mandatory.
That's it! Tongue sticking out
"For God has not destined us for wrath, but for obtaining salvation through our Lord Jesus Christ," 1 Thessalonians 5:9

Maranatha!

The Internet might be either your friend or enemy. It just depends on whether or not she has a bad hair day.

[Image: SP1-Scripter.png]
[Image: SP1-Writer.png]
[Image: SP1-Poet.png]
[Image: SP1-PixelArtist.png]
[Image: SP1-Reporter.png]

My Original Stories (available in English and Spanish)

List of Compiled Binary Executables I have published...
HiddenChest & Roole

Give me a free copy of your completed game if you include at least 3 of my scripts! Laughing + Tongue sticking out

Just some scripts I've already published on the board...
KyoGemBoost XP VX & ACE, RandomEnkounters XP, KSkillShop XP, Kolloseum States XP, KEvents XP, KScenario XP & Gosu, KyoPrizeShop XP Mangostan, Kuests XP, KyoDiscounts XP VX, ACE & MV, KChest XP VX & ACE 2016, KTelePort XP, KSkillMax XP & VX & ACE, Gem Roulette XP VX & VX Ace, KRespawnPoint XP, VX & VX Ace, GiveAway XP VX & ACE, Klearance XP VX & ACE, KUnits XP VX, ACE & Gosu 2017, KLevel XP, KRumors XP & ACE, KMonsterPals XP VX & ACE, KStatsRefill XP VX & ACE, KLotto XP VX & ACE, KItemDesc XP & VX, KPocket XP & VX, OpenChest XP VX & ACE
Reply }
#2
Maintenance Update

A real VX fan let me know about some strange issue taking place while loading the demo I've provided. It couldn't find a non existing method. Happy with a sweat It happens to belong to the XP port so it would obviously be missing in VX. Laughing

Later on I also found 2 other minor bugs that I smashed before reuploading the demo.

Now the script works as intended, guys! Grinning
"For God has not destined us for wrath, but for obtaining salvation through our Lord Jesus Christ," 1 Thessalonians 5:9

Maranatha!

The Internet might be either your friend or enemy. It just depends on whether or not she has a bad hair day.

[Image: SP1-Scripter.png]
[Image: SP1-Writer.png]
[Image: SP1-Poet.png]
[Image: SP1-PixelArtist.png]
[Image: SP1-Reporter.png]

My Original Stories (available in English and Spanish)

List of Compiled Binary Executables I have published...
HiddenChest & Roole

Give me a free copy of your completed game if you include at least 3 of my scripts! Laughing + Tongue sticking out

Just some scripts I've already published on the board...
KyoGemBoost XP VX & ACE, RandomEnkounters XP, KSkillShop XP, Kolloseum States XP, KEvents XP, KScenario XP & Gosu, KyoPrizeShop XP Mangostan, Kuests XP, KyoDiscounts XP VX, ACE & MV, KChest XP VX & ACE 2016, KTelePort XP, KSkillMax XP & VX & ACE, Gem Roulette XP VX & VX Ace, KRespawnPoint XP, VX & VX Ace, GiveAway XP VX & ACE, Klearance XP VX & ACE, KUnits XP VX, ACE & Gosu 2017, KLevel XP, KRumors XP & ACE, KMonsterPals XP VX & ACE, KStatsRefill XP VX & ACE, KLotto XP VX & ACE, KItemDesc XP & VX, KPocket XP & VX, OpenChest XP VX & ACE
Reply }
#3
A New Port Has Arrived!

Now VX ACE users can also enjoy... or hate the possibility of getting a given battler Orson excluded from, well, battles! Laughing
It relies upon the same script calls already available for VX so it won't be difficult to implement in your games, guys! Grinning
"For God has not destined us for wrath, but for obtaining salvation through our Lord Jesus Christ," 1 Thessalonians 5:9

Maranatha!

The Internet might be either your friend or enemy. It just depends on whether or not she has a bad hair day.

[Image: SP1-Scripter.png]
[Image: SP1-Writer.png]
[Image: SP1-Poet.png]
[Image: SP1-PixelArtist.png]
[Image: SP1-Reporter.png]

My Original Stories (available in English and Spanish)

List of Compiled Binary Executables I have published...
HiddenChest & Roole

Give me a free copy of your completed game if you include at least 3 of my scripts! Laughing + Tongue sticking out

Just some scripts I've already published on the board...
KyoGemBoost XP VX & ACE, RandomEnkounters XP, KSkillShop XP, Kolloseum States XP, KEvents XP, KScenario XP & Gosu, KyoPrizeShop XP Mangostan, Kuests XP, KyoDiscounts XP VX, ACE & MV, KChest XP VX & ACE 2016, KTelePort XP, KSkillMax XP & VX & ACE, Gem Roulette XP VX & VX Ace, KRespawnPoint XP, VX & VX Ace, GiveAway XP VX & ACE, Klearance XP VX & ACE, KUnits XP VX, ACE & Gosu 2017, KLevel XP, KRumors XP & ACE, KMonsterPals XP VX & ACE, KStatsRefill XP VX & ACE, KLotto XP VX & ACE, KItemDesc XP & VX, KPocket XP & VX, OpenChest XP VX & ACE
Reply }




Users browsing this thread: 2 Guest(s)