Save-Point

Full Version: Save-Point
You're currently viewing a stripped down version of our content. View the full version with proper formatting.
Board Message
Sorry, you do not have permission to access this resource.
Save-Point - Skill based on FFVI's Celes Runic

Save-Point

Full Version: Skill based on FFVI's Celes Runic
You're currently viewing a stripped down version of our content. View the full version with proper formatting.
Pages: 1 2 3 4 5 6
Try creating a new project, don't do anything to the new project. Backup your original project's scripts that are below scene_debug and above main, I'd recommend Notepad++ because it can use the tab feature, which is very useful for something like this.. After the scripts that you've backed up are copied to some word editing program (example - Notepad++), close all RPG Maker XP windows, copy the new project's Scripts data, located in the new project's data folder, and paste it in your original project's data folder. This should update the default RTP Scripts if you made a new project using the Steam Version of RPG Maker XP, however any added scripts are removed (which is why backing them up to a word editing program before the copy/paste step is necessary). Re-add all the scripts you've backed up using a word editing editing program. I've done something similar before, though I'll be doing something like this from now on since I thought of it.
@KDC
Though I would like to say it would work or it worked, it unfortunately did not.
That is the first step I took, in fact.
Just putting in the Runic script below Scene_Debug and above Main and gave it a goold ol' "Play Test".
Instead of the literal start up with the background music to my ears, what I got instead is the jolly good friend of mine a.k.a. line 236 error which I definitely will not want to see again once gotten rid of (which, of course, is still not yet solved).
Please don't mind my way of reply. Trying to be funny which I failed so hardcore in doing so.

Anyway, long story short, that did not work for me.
I placed the script in a new project, and it worked.

Try downloading the latest RTP, see if that helps.
Also, check if it works without the script.

If I think of anything else, I'll let you know. But I'm a simple Lani, so I don't know these things very well. Tongue sticking out
I'm rather curious about your issue, and you did notice in a reply you sent (sorta) to Zackwell that the issue related to "Game_Troop". Hey, I'm admin. I can see the deleted ones.

Yes, the issues you have is within the start_phase1 method, and in the line which cycles through the enemies within the Game_Troop class itself. So this begs the question, "what happened to the troop data which was defined in the battlesystem's main method?"

There must be something fairly 'entertaining' about your battlesystem to not have any defined enemies prior to battle. So I have this suggestion, an edit/replacement of that block of code from:

Code:
# Cycle through enemies
    for enemy in $game_troop.enemies
      # Only if exists
      if enemy.exist?
        # Perform runic cleaning
        runic_clean(enemy)
      end
    end
to
Code:
# Cycle through enemies
    unless $game_troop.enemies.nil?
      for enemy in $game_troop.enemies
        # Only if exists
        if enemy.exist?
          # Perform runic cleaning
          runic_clean(enemy)
        end
      end
    end

EDIT:
In relation to Postality Knights editions, the actual edit was to the editor software which used the original Japanese default scripts and the Japanese DLL. The default scripts were actually the same as the English ones, only the comments translated and needed a extra script call to bypass the default japanese fonts which wouldn't show on Western systems. This issue wouldn't be a P-Knights issue.
@DerVVulfman
Aye. I accidentally pasted the Runic script into the Game_Troop script for some reasons at one point the second time. Made "things right" again as in editing my reply post to @Zackwell a few times from "Runic" to "Game_Troop" to "Runic" again.
Taught me a lesson to pay more attention on what I am doing.

Anyway, will give that code a go.
Will give a post edit update on whether it works in the end or not.

Edit: Tried it, this time it is line 237. It, for some reasons, basically focused on this one which says "for enemy in $game_troop.enemies" and this line alone, even back in the line 236 one. Is there something I should know about this particular line?
enemy in $game_troop.enemies is a statement that begins a loop that cycles through every enemy set up in your battlesystem. If you are set up a battle with two ghosts, your enemy troop consists of both ghosts, and it goes and loops through both ghosts. Now when I say it loops through both ghosts, let's look at the script section:

Code:
# Cycle through enemies
    for enemy in $game_troop.enemies
      # Only if exists
      if enemy.exist?
        # Perform runic cleaning
        runic_clean(enemy)
      end
    end
Assuming the troop consists of just the two ghosts, it does this:
1) Selects ghost #1
2) Sees if the enemy exists, and if it does...
3) Runs the 'Runic Cleaning' method
4) (repeats 1-3 on ghost #2)

Now I used a technique called 'alias' which allows me to add this code into the start_phase1 method, a method that runs when the battle begins, clearing old battler data and the like. At this point, the enemy data from Game_Troop must exist.

Why?

Before the start_phase1 method is even executed (and thus before MY code is executed), the troop is created in the Main method in Scene_Battle. See below:
Code:
class Scene_Battle
  #--------------------------------------------------------------------------
  # * Main Processing
  #--------------------------------------------------------------------------
  def main
    # Initialize each kind of temporary battle data
    $game_temp.in_battle = true
    $game_temp.battle_turn = 0
    $game_temp.battle_event_flags.clear
    $game_temp.battle_abort = false
    $game_temp.battle_main_phase = false
    $game_temp.battleback_name = $game_map.battleback_name
    $game_temp.forcing_battler = nil
    # Initialize battle event interpreter
    $game_system.battle_interpreter.setup(nil, 0)
    # Prepare troop
    @troop_id = $game_temp.battle_troop_id   <--- generates the troop ID used next
    $game_troop.setup(@troop_id)             <--- actively creates your $game_troop.enemies
    # Make actor command window
    s1 = $data_system.words.attack
    s2 = $data_system.words.skill
    s3 = $data_system.words.guard
    s4 = $data_system.words.item
    @actor_command_window = Window_Command.new(160, [s1, s2, s3, s4])

So am seriously curious what's happening if you're generating an error as the battlesystem should be making your enemy data the moment the battle begins.
@DerVVulfman
I am honestly not sure why. Regardless of whether it's a completely new project, nothing touched at all, the Runic script just will not work.
As in the "for enemy in $game_troop.enemies" line. It is abusing Gandalf's "You shall not pass" to a whole new level beyond my imagination.

This is the original Game_Troop script, completely untouched as stated. Is there anything wrong in it?


Code:
#==============================================================================
# ** Game_Troop
#------------------------------------------------------------------------------
#  This class deals with troops. Refer to "$game_troop" for the instance of
#  this class.
#==============================================================================

class Game_Troop
 #--------------------------------------------------------------------------
 # * Object Initialization
 #--------------------------------------------------------------------------
 def initialize
   # Create enemy array
   @enemies = []
 end
 #--------------------------------------------------------------------------
 # * Get Enemies
 #--------------------------------------------------------------------------
 def enemies
   return @enemies
 end
 #--------------------------------------------------------------------------
 # * Setup
 #     troop_id : troop ID
 #--------------------------------------------------------------------------
 def setup(troop_id)
   # Set array of enemies who are set as troops
   @enemies = []
   troop = $data_troops[troop_id]
   for i in 0...troop.members.size
     enemy = $data_enemies[troop.members[i].enemy_id]
     if enemy != nil
       @enemies.push(Game_Enemy.new(troop_id, i))
     end
   end
 end
 #--------------------------------------------------------------------------
 # * Random Selection of a Target Enemy
 #     hp0 : limited to enemies with 0 HP
 #--------------------------------------------------------------------------
 def random_target_enemy(hp0 = false)
   # Initialize roulette
   roulette = []
   # Loop
   for enemy in @enemies
     # If it fits the conditions
     if (not hp0 and enemy.exist?) or (hp0 and enemy.hp0?)
       # Add an enemy to the roulette
       roulette.push(enemy)
     end
   end
   # If roulette size is 0
   if roulette.size == 0
     return nil
   end
   # Spin the roulette, choose an enemy
   return roulette[rand(roulette.size)]
 end
 #--------------------------------------------------------------------------
 # * Random Selection of a Target Enemy (HP 0)
 #--------------------------------------------------------------------------
 def random_target_enemy_hp0
   return random_target_enemy(true)
 end
 #--------------------------------------------------------------------------
 # * Smooth Selection of a Target Enemy
 #     enemy_index : enemy index
 #--------------------------------------------------------------------------
 def smooth_target_enemy(enemy_index)
   # Get an enemy
   enemy = @enemies[enemy_index]
   # If an enemy exists
   if enemy != nil and enemy.exist?
     return enemy
   end
   # Loop
   for enemy in @enemies
     # If an enemy exists
     if enemy.exist?
       return enemy
     end
   end
 end
end

And here is the Scene_Battle 1 script. Anything out of place? Also untouched.

Code:
#==============================================================================
# ** Scene_Battle (part 1)
#------------------------------------------------------------------------------
#  This class performs battle screen processing.
#==============================================================================

class Scene_Battle
 #--------------------------------------------------------------------------
 # * Main Processing
 #--------------------------------------------------------------------------
 def main
   # Initialize each kind of temporary battle data
   $game_temp.in_battle = true
   $game_temp.battle_turn = 0
   $game_temp.battle_event_flags.clear
   $game_temp.battle_abort = false
   $game_temp.battle_main_phase = false
   $game_temp.battleback_name = $game_map.battleback_name
   $game_temp.forcing_battler = nil
   # Initialize battle event interpreter
   $game_system.battle_interpreter.setup(nil, 0)
   # Prepare troop
   @troop_id = $game_temp.battle_troop_id
   $game_troop.setup(@troop_id)
   # Make actor command window
   s1 = $data_system.words.attack
   s2 = $data_system.words.skill
   s3 = $data_system.words.guard
   s4 = $data_system.words.item
   @actor_command_window = Window_Command.new(160, [s1, s2, s3, s4])
   @actor_command_window.y = 160
   @actor_command_window.back_opacity = 160
   @actor_command_window.active = false
   @actor_command_window.visible = false
   # Make other windows
   @party_command_window = Window_PartyCommand.new
   @help_window = Window_Help.new
   @help_window.back_opacity = 160
   @help_window.visible = false
   @status_window = Window_BattleStatus.new
   @message_window = Window_Message.new
   # Make sprite set
   @spriteset = Spriteset_Battle.new
   # Initialize wait count
   @wait_count = 0
   # Execute transition
   if $data_system.battle_transition == ""
     Graphics.transition(20)
   else
     Graphics.transition(40, "Graphics/Transitions/" +
       $data_system.battle_transition)
   end
   # Start pre-battle phase
   start_phase1
   # Main loop
   loop do
     # Update game screen
     Graphics.update
     # Update input information
     Input.update
     # Frame update
     update
     # Abort loop if screen is changed
     if $scene != self
       break
     end
   end
   # Refresh map
   $game_map.refresh
   # Prepare for transition
   Graphics.freeze
   # Dispose of windows
   @actor_command_window.dispose
   @party_command_window.dispose
   @help_window.dispose
   @status_window.dispose
   @message_window.dispose
   if @skill_window != nil
     @skill_window.dispose
   end
   if @item_window != nil
     @item_window.dispose
   end
   if @result_window != nil
     @result_window.dispose
   end
   # Dispose of sprite set
   @spriteset.dispose
   # If switching to title screen
   if $scene.is_a?(Scene_Title)
     # Fade out screen
     Graphics.transition
     Graphics.freeze
   end
   # If switching from battle test to any screen other than game over screen
   if $BTEST and not $scene.is_a?(Scene_Gameover)
     $scene = nil
   end
 end
 #--------------------------------------------------------------------------
 # * Determine Battle Win/Loss Results
 #--------------------------------------------------------------------------
 def judge
   # If all dead determinant is true, or number of members in party is 0
   if $game_party.all_dead? or $game_party.actors.size == 0
     # If possible to lose
     if $game_temp.battle_can_lose
       # Return to BGM before battle starts
       $game_system.bgm_play($game_temp.map_bgm)
       # Battle ends
       battle_end(2)
       # Return true
       return true
     end
     # Set game over flag
     $game_temp.gameover = true
     # Return true
     return true
   end
   # Return false if even 1 enemy exists
   for enemy in $game_troop.enemies
     if enemy.exist?
       return false
     end
   end
   # Start after battle phase (win)
   start_phase5
   # Return true
   return true
 end
 #--------------------------------------------------------------------------
 # * Battle Ends
 #     result : results (0:win 1:lose 2:escape)
 #--------------------------------------------------------------------------
 def battle_end(result)
   # Clear in battle flag
   $game_temp.in_battle = false
   # Clear entire party actions flag
   $game_party.clear_actions
   # Remove battle states
   for actor in $game_party.actors
     actor.remove_states_battle
   end
   # Clear enemies
   $game_troop.enemies.clear
   # Call battle callback
   if $game_temp.battle_proc != nil
     $game_temp.battle_proc.call(result)
     $game_temp.battle_proc = nil
   end
   # Switch to map screen
   $scene = Scene_Map.new
 end
 #--------------------------------------------------------------------------
 # * Battle Event Setup
 #--------------------------------------------------------------------------
 def setup_battle_event
   # If battle event is running
   if $game_system.battle_interpreter.running?
     return
   end
   # Search for all battle event pages
   for index in 0...$data_troops[@troop_id].pages.size
     # Get event pages
     page = $data_troops[@troop_id].pages[index]
     # Make event conditions possible for reference with c
     c = page.condition
     # Go to next page if no conditions are appointed
     unless c.turn_valid or c.enemy_valid or
            c.actor_valid or c.switch_valid
       next
     end
     # Go to next page if action has been completed
     if $game_temp.battle_event_flags[index]
       next
     end
     # Confirm turn conditions
     if c.turn_valid
       n = $game_temp.battle_turn
       a = c.turn_a
       b = c.turn_b
       if (b == 0 and n != a) or
          (b > 0 and (n < 1 or n < a or n % b != a % b))
         next
       end
     end
     # Confirm enemy conditions
     if c.enemy_valid
       enemy = $game_troop.enemies[c.enemy_index]
       if enemy == nil or enemy.hp * 100.0 / enemy.maxhp > c.enemy_hp
         next
       end
     end
     # Confirm actor conditions
     if c.actor_valid
       actor = $game_actors[c.actor_id]
       if actor == nil or actor.hp * 100.0 / actor.maxhp > c.actor_hp
         next
       end
     end
     # Confirm switch conditions
     if c.switch_valid
       if $game_switches[c.switch_id] == false
         next
       end
     end
     # Set up event
     $game_system.battle_interpreter.setup(page.list, 0)
     # If this page span is [battle] or [turn]
     if page.span <= 1
       # Set action completed flag
       $game_temp.battle_event_flags[index] = true
     end
     return
   end
 end
 #--------------------------------------------------------------------------
 # * Frame Update
 #--------------------------------------------------------------------------
 def update
   # If battle event is running
   if $game_system.battle_interpreter.running?
     # Update interpreter
     $game_system.battle_interpreter.update
     # If a battler which is forcing actions doesn't exist
     if $game_temp.forcing_battler == nil
       # If battle event has finished running
       unless $game_system.battle_interpreter.running?
         # Rerun battle event set up if battle continues
         unless judge
           setup_battle_event
         end
       end
       # If not after battle phase
       if @phase != 5
         # Refresh status window
         @status_window.refresh
       end
     end
   end
   # Update system (timer) and screen
   $game_system.update
   $game_screen.update
   # If timer has reached 0
   if $game_system.timer_working and $game_system.timer == 0
     # Abort battle
     $game_temp.battle_abort = true
   end
   # Update windows
   @help_window.update
   @party_command_window.update
   @actor_command_window.update
   @status_window.update
   @message_window.update
   # Update sprite set
   @spriteset.update
   # If transition is processing
   if $game_temp.transition_processing
     # Clear transition processing flag
     $game_temp.transition_processing = false
     # Execute transition
     if $game_temp.transition_name == ""
       Graphics.transition(20)
     else
       Graphics.transition(40, "Graphics/Transitions/" +
         $game_temp.transition_name)
     end
   end
   # If message window is showing
   if $game_temp.message_window_showing
     return
   end
   # If effect is showing
   if @spriteset.effect?
     return
   end
   # If game over
   if $game_temp.gameover
     # Switch to game over screen
     $scene = Scene_Gameover.new
     return
   end
   # If returning to title screen
   if $game_temp.to_title
     # Switch to title screen
     $scene = Scene_Title.new
     return
   end
   # If battle is aborted
   if $game_temp.battle_abort
     # Return to BGM used before battle started
     $game_system.bgm_play($game_temp.map_bgm)
     # Battle ends
     battle_end(1)
     return
   end
   # If waiting
   if @wait_count > 0
     # Decrease wait count
     @wait_count -= 1
     return
   end
   # If battler forcing an action doesn't exist,
   # and battle event is running
   if $game_temp.forcing_battler == nil and
      $game_system.battle_interpreter.running?
     return
   end
   # Branch according to phase
   case @phase
   when 1  # pre-battle phase
     update_phase1
   when 2  # party command phase
     update_phase2
   when 3  # actor command phase
     update_phase3
   when 4  # main phase
     update_phase4
   when 5  # after battle phase
     update_phase5
   end
 end
end

And here is the Scene_Battle 2 script. Untouched.

Code:
#==============================================================================
# ** Scene_Battle (part 2)
#------------------------------------------------------------------------------
#  This class performs battle screen processing.
#==============================================================================

class Scene_Battle
 #--------------------------------------------------------------------------
 # * Start Pre-Battle Phase
 #--------------------------------------------------------------------------
 def start_phase1
   # Shift to phase 1
   @phase = 1
   # Clear all party member actions
   $game_party.clear_actions
   # Set up battle event
   setup_battle_event
 end
 #--------------------------------------------------------------------------
 # * Frame Update (pre-battle phase)
 #--------------------------------------------------------------------------
 def update_phase1
   # Determine win/loss situation
   if judge
     # If won or lost: end method
     return
   end
   # Start party command phase
   start_phase2
 end
 #--------------------------------------------------------------------------
 # * Start Party Command Phase
 #--------------------------------------------------------------------------
 def start_phase2
   # Shift to phase 2
   @phase = 2
   # Set actor to non-selecting
   @actor_index = -1
   @active_battler = nil
   # Enable party command window
   @party_command_window.active = true
   @party_command_window.visible = true
   # Disable actor command window
   @actor_command_window.active = false
   @actor_command_window.visible = false
   # Clear main phase flag
   $game_temp.battle_main_phase = false
   # Clear all party member actions
   $game_party.clear_actions
   # If impossible to input command
   unless $game_party.inputable?
     # Start main phase
     start_phase4
   end
 end
 #--------------------------------------------------------------------------
 # * Frame Update (party command phase)
 #--------------------------------------------------------------------------
 def update_phase2
   # If C button was pressed
   if Input.trigger?(Input::C)
     # Branch by party command window cursor position
     case @party_command_window.index
     when 0  # fight
       # Play decision SE
       $game_system.se_play($data_system.decision_se)
       # Start actor command phase
       start_phase3
     when 1  # escape
       # If it's not possible to escape
       if $game_temp.battle_can_escape == false
         # Play buzzer SE
         $game_system.se_play($data_system.buzzer_se)
         return
       end
       # Play decision SE
       $game_system.se_play($data_system.decision_se)
       # Escape processing
       update_phase2_escape
     end
     return
   end
 end
 #--------------------------------------------------------------------------
 # * Frame Update (party command phase: escape)
 #--------------------------------------------------------------------------
 def update_phase2_escape
   # Calculate enemy agility average
   enemies_agi = 0
   enemies_number = 0
   for enemy in $game_troop.enemies
     if enemy.exist?
       enemies_agi += enemy.agi
       enemies_number += 1
     end
   end
   if enemies_number > 0
     enemies_agi /= enemies_number
   end
   # Calculate actor agility average
   actors_agi = 0
   actors_number = 0
   for actor in $game_party.actors
     if actor.exist?
       actors_agi += actor.agi
       actors_number += 1
     end
   end
   if actors_number > 0
     actors_agi /= actors_number
   end
   # Determine if escape is successful
   success = rand(100) < 50 * actors_agi / enemies_agi
   # If escape is successful
   if success
     # Play escape SE
     $game_system.se_play($data_system.escape_se)
     # Return to BGM before battle started
     $game_system.bgm_play($game_temp.map_bgm)
     # Battle ends
     battle_end(1)
   # If escape is failure
   else
     # Clear all party member actions
     $game_party.clear_actions
     # Start main phase
     start_phase4
   end
 end
 #--------------------------------------------------------------------------
 # * Start After Battle Phase
 #--------------------------------------------------------------------------
 def start_phase5
   # Shift to phase 5
   @phase = 5
   # Play battle end ME
   $game_system.me_play($game_system.battle_end_me)
   # Return to BGM before battle started
   $game_system.bgm_play($game_temp.map_bgm)
   # Initialize EXP, amount of gold, and treasure
   exp = 0
   gold = 0
   treasures = []
   # Loop
   for enemy in $game_troop.enemies
     # If enemy is not hidden
     unless enemy.hidden
       # Add EXP and amount of gold obtained
       exp += enemy.exp
       gold += enemy.gold
       # Determine if treasure appears
       if rand(100) < enemy.treasure_prob
         if enemy.item_id > 0
           treasures.push($data_items[enemy.item_id])
         end
         if enemy.weapon_id > 0
           treasures.push($data_weapons[enemy.weapon_id])
         end
         if enemy.armor_id > 0
           treasures.push($data_armors[enemy.armor_id])
         end
       end
     end
   end
   # Treasure is limited to a maximum of 6 items
   treasures = treasures[0..5]
   # Obtaining EXP
   for i in 0...$game_party.actors.size
     actor = $game_party.actors[i]
     if actor.cant_get_exp? == false
       last_level = actor.level
       actor.exp += exp
       if actor.level > last_level
         @status_window.level_up(i)
       end
     end
   end
   # Obtaining gold
   $game_party.gain_gold(gold)
   # Obtaining treasure
   for item in treasures
     case item
     when RPG::Item
       $game_party.gain_item(item.id, 1)
     when RPG::Weapon
       $game_party.gain_weapon(item.id, 1)
     when RPG::Armor
       $game_party.gain_armor(item.id, 1)
     end
   end
   # Make battle result window
   @result_window = Window_BattleResult.new(exp, gold, treasures)
   # Set wait count
   @phase5_wait_count = 100
 end
 #--------------------------------------------------------------------------
 # * Frame Update (after battle phase)
 #--------------------------------------------------------------------------
 def update_phase5
   # If wait count is larger than 0
   if @phase5_wait_count > 0
     # Decrease wait count
     @phase5_wait_count -= 1
     # If wait count reaches 0
     if @phase5_wait_count == 0
       # Show result window
       @result_window.visible = true
       # Clear main phase flag
       $game_temp.battle_main_phase = false
       # Refresh status window
       @status_window.refresh
     end
     return
   end
   # If C button was pressed
   if Input.trigger?(Input::C)
     # Battle ends
     battle_end(0)
   end
 end
end

Here is Scene_Battle 3. Untouched.
Code:
#==============================================================================
# ** Scene_Battle (part 3)
#------------------------------------------------------------------------------
#  This class performs battle screen processing.
#==============================================================================

class Scene_Battle
 #--------------------------------------------------------------------------
 # * Start Actor Command Phase
 #--------------------------------------------------------------------------
 def start_phase3
   # Shift to phase 3
   @phase = 3
   # Set actor as unselectable
   @actor_index = -1
   @active_battler = nil
   # Go to command input for next actor
   phase3_next_actor
 end
 #--------------------------------------------------------------------------
 # * Go to Command Input for Next Actor
 #--------------------------------------------------------------------------
 def phase3_next_actor
   # Loop
   begin
     # Actor blink effect OFF
     if @active_battler != nil
       @active_battler.blink = false
     end
     # If last actor
     if @actor_index == $game_party.actors.size-1
       # Start main phase
       start_phase4
       return
     end
     # Advance actor index
     @actor_index += 1
     @active_battler = $game_party.actors[@actor_index]
     @active_battler.blink = true
   # Once more if actor refuses command input
   end until @active_battler.inputable?
   # Set up actor command window
   phase3_setup_command_window
 end
 #--------------------------------------------------------------------------
 # * Go to Command Input of Previous Actor
 #--------------------------------------------------------------------------
 def phase3_prior_actor
   # Loop
   begin
     # Actor blink effect OFF
     if @active_battler != nil
       @active_battler.blink = false
     end
     # If first actor
     if @actor_index == 0
       # Start party command phase
       start_phase2
       return
     end
     # Return to actor index
     @actor_index -= 1
     @active_battler = $game_party.actors[@actor_index]
     @active_battler.blink = true
   # Once more if actor refuses command input
   end until @active_battler.inputable?
   # Set up actor command window
   phase3_setup_command_window
 end
 #--------------------------------------------------------------------------
 # * Actor Command Window Setup
 #--------------------------------------------------------------------------
 def phase3_setup_command_window
   # Disable party command window
   @party_command_window.active = false
   @party_command_window.visible = false
   # Enable actor command window
   @actor_command_window.active = true
   @actor_command_window.visible = true
   # Set actor command window position
   @actor_command_window.x = @actor_index * 160
   # Set index to 0
   @actor_command_window.index = 0
 end
 #--------------------------------------------------------------------------
 # * Frame Update (actor command phase)
 #--------------------------------------------------------------------------
 def update_phase3
   # If enemy arrow is enabled
   if @enemy_arrow != nil
     update_phase3_enemy_select
   # If actor arrow is enabled
   elsif @actor_arrow != nil
     update_phase3_actor_select
   # If skill window is enabled
   elsif @skill_window != nil
     update_phase3_skill_select
   # If item window is enabled
   elsif @item_window != nil
     update_phase3_item_select
   # If actor command window is enabled
   elsif @actor_command_window.active
     update_phase3_basic_command
   end
 end
 #--------------------------------------------------------------------------
 # * Frame Update (actor command phase : basic command)
 #--------------------------------------------------------------------------
 def update_phase3_basic_command
   # If B button was pressed
   if Input.trigger?(Input::B)
     # Play cancel SE
     $game_system.se_play($data_system.cancel_se)
     # Go to command input for previous actor
     phase3_prior_actor
     return
   end
   # If C button was pressed
   if Input.trigger?(Input::C)
     # Branch by actor command window cursor position
     case @actor_command_window.index
     when 0  # attack
       # Play decision SE
       $game_system.se_play($data_system.decision_se)
       # Set action
       @active_battler.current_action.kind = 0
       @active_battler.current_action.basic = 0
       # Start enemy selection
       start_enemy_select
     when 1  # skill
       # Play decision SE
       $game_system.se_play($data_system.decision_se)
       # Set action
       @active_battler.current_action.kind = 1
       # Start skill selection
       start_skill_select
     when 2  # guard
       # Play decision SE
       $game_system.se_play($data_system.decision_se)
       # Set action
       @active_battler.current_action.kind = 0
       @active_battler.current_action.basic = 1
       # Go to command input for next actor
       phase3_next_actor
     when 3  # item
       # Play decision SE
       $game_system.se_play($data_system.decision_se)
       # Set action
       @active_battler.current_action.kind = 2
       # Start item selection
       start_item_select
     end
     return
   end
 end
 #--------------------------------------------------------------------------
 # * Frame Update (actor command phase : skill selection)
 #--------------------------------------------------------------------------
 def update_phase3_skill_select
   # Make skill window visible
   @skill_window.visible = true
   # Update skill window
   @skill_window.update
   # If B button was pressed
   if Input.trigger?(Input::B)
     # Play cancel SE
     $game_system.se_play($data_system.cancel_se)
     # End skill selection
     end_skill_select
     return
   end
   # If C button was pressed
   if Input.trigger?(Input::C)
     # Get currently selected data on the skill window
     @skill = @skill_window.skill
     # If it can't be used
     if @skill == nil or not @active_battler.skill_can_use?(@skill.id)
       # Play buzzer SE
       $game_system.se_play($data_system.buzzer_se)
       return
     end
     # Play decision SE
     $game_system.se_play($data_system.decision_se)
     # Set action
     @active_battler.current_action.skill_id = @skill.id
     # Make skill window invisible
     @skill_window.visible = false
     # If effect scope is single enemy
     if @skill.scope == 1
       # Start enemy selection
       start_enemy_select
     # If effect scope is single ally
     elsif @skill.scope == 3 or @skill.scope == 5
       # Start actor selection
       start_actor_select
     # If effect scope is not single
     else
       # End skill selection
       end_skill_select
       # Go to command input for next actor
       phase3_next_actor
     end
     return
   end
 end
 #--------------------------------------------------------------------------
 # * Frame Update (actor command phase : item selection)
 #--------------------------------------------------------------------------
 def update_phase3_item_select
   # Make item window visible
   @item_window.visible = true
   # Update item window
   @item_window.update
   # If B button was pressed
   if Input.trigger?(Input::B)
     # Play cancel SE
     $game_system.se_play($data_system.cancel_se)
     # End item selection
     end_item_select
     return
   end
   # If C button was pressed
   if Input.trigger?(Input::C)
     # Get currently selected data on the item window
     @item = @item_window.item
     # If it can't be used
     unless $game_party.item_can_use?(@item.id)
       # Play buzzer SE
       $game_system.se_play($data_system.buzzer_se)
       return
     end
     # Play decision SE
     $game_system.se_play($data_system.decision_se)
     # Set action
     @active_battler.current_action.item_id = @item.id
     # Make item window invisible
     @item_window.visible = false
     # If effect scope is single enemy
     if @item.scope == 1
       # Start enemy selection
       start_enemy_select
     # If effect scope is single ally
     elsif @item.scope == 3 or @item.scope == 5
       # Start actor selection
       start_actor_select
     # If effect scope is not single
     else
       # End item selection
       end_item_select
       # Go to command input for next actor
       phase3_next_actor
     end
     return
   end
 end
 #--------------------------------------------------------------------------
 # * Frame Updat (actor command phase : enemy selection)
 #--------------------------------------------------------------------------
 def update_phase3_enemy_select
   # Update enemy arrow
   @enemy_arrow.update
   # If B button was pressed
   if Input.trigger?(Input::B)
     # Play cancel SE
     $game_system.se_play($data_system.cancel_se)
     # End enemy selection
     end_enemy_select
     return
   end
   # If C button was pressed
   if Input.trigger?(Input::C)
     # Play decision SE
     $game_system.se_play($data_system.decision_se)
     # Set action
     @active_battler.current_action.target_index = @enemy_arrow.index
     # End enemy selection
     end_enemy_select
     # If skill window is showing
     if @skill_window != nil
       # End skill selection
       end_skill_select
     end
     # If item window is showing
     if @item_window != nil
       # End item selection
       end_item_select
     end
     # Go to command input for next actor
     phase3_next_actor
   end
 end
 #--------------------------------------------------------------------------
 # * Frame Update (actor command phase : actor selection)
 #--------------------------------------------------------------------------
 def update_phase3_actor_select
   # Update actor arrow
   @actor_arrow.update
   # If B button was pressed
   if Input.trigger?(Input::B)
     # Play cancel SE
     $game_system.se_play($data_system.cancel_se)
     # End actor selection
     end_actor_select
     return
   end
   # If C button was pressed
   if Input.trigger?(Input::C)
     # Play decision SE
     $game_system.se_play($data_system.decision_se)
     # Set action
     @active_battler.current_action.target_index = @actor_arrow.index
     # End actor selection
     end_actor_select
     # If skill window is showing
     if @skill_window != nil
       # End skill selection
       end_skill_select
     end
     # If item window is showing
     if @item_window != nil
       # End item selection
       end_item_select
     end
     # Go to command input for next actor
     phase3_next_actor
   end
 end
 #--------------------------------------------------------------------------
 # * Start Enemy Selection
 #--------------------------------------------------------------------------
 def start_enemy_select
   # Make enemy arrow
   @enemy_arrow = Arrow_Enemy.new(@spriteset.viewport1)
   # Associate help window
   @enemy_arrow.help_window = @help_window
   # Disable actor command window
   @actor_command_window.active = false
   @actor_command_window.visible = false
 end
 #--------------------------------------------------------------------------
 # * End Enemy Selection
 #--------------------------------------------------------------------------
 def end_enemy_select
   # Dispose of enemy arrow
   @enemy_arrow.dispose
   @enemy_arrow = nil
   # If command is [fight]
   if @actor_command_window.index == 0
     # Enable actor command window
     @actor_command_window.active = true
     @actor_command_window.visible = true
     # Hide help window
     @help_window.visible = false
   end
 end
 #--------------------------------------------------------------------------
 # * Start Actor Selection
 #--------------------------------------------------------------------------
 def start_actor_select
   # Make actor arrow
   @actor_arrow = Arrow_Actor.new(@spriteset.viewport2)
   @actor_arrow.index = @actor_index
   # Associate help window
   @actor_arrow.help_window = @help_window
   # Disable actor command window
   @actor_command_window.active = false
   @actor_command_window.visible = false
 end
 #--------------------------------------------------------------------------
 # * End Actor Selection
 #--------------------------------------------------------------------------
 def end_actor_select
   # Dispose of actor arrow
   @actor_arrow.dispose
   @actor_arrow = nil
 end
 #--------------------------------------------------------------------------
 # * Start Skill Selection
 #--------------------------------------------------------------------------
 def start_skill_select
   # Make skill window
   @skill_window = Window_Skill.new(@active_battler)
   # Associate help window
   @skill_window.help_window = @help_window
   # Disable actor command window
   @actor_command_window.active = false
   @actor_command_window.visible = false
 end
 #--------------------------------------------------------------------------
 # * End Skill Selection
 #--------------------------------------------------------------------------
 def end_skill_select
   # Dispose of skill window
   @skill_window.dispose
   @skill_window = nil
   # Hide help window
   @help_window.visible = false
   # Enable actor command window
   @actor_command_window.active = true
   @actor_command_window.visible = true
 end
 #--------------------------------------------------------------------------
 # * Start Item Selection
 #--------------------------------------------------------------------------
 def start_item_select
   # Make item window
   @item_window = Window_Item.new
   # Associate help window
   @item_window.help_window = @help_window
   # Disable actor command window
   @actor_command_window.active = false
   @actor_command_window.visible = false
 end
 #--------------------------------------------------------------------------
 # * End Item Selection
 #--------------------------------------------------------------------------
 def end_item_select
   # Dispose of item window
   @item_window.dispose
   @item_window = nil
   # Hide help window
   @help_window.visible = false
   # Enable actor command window
   @actor_command_window.active = true
   @actor_command_window.visible = true
 end
end

And finally Scene_Battle 4. Also untouched.

Code:
#==============================================================================
# ** Scene_Battle (part 4)
#------------------------------------------------------------------------------
#  This class performs battle screen processing.
#==============================================================================

class Scene_Battle
 #--------------------------------------------------------------------------
 # * Start Main Phase
 #--------------------------------------------------------------------------
 def start_phase4
   # Shift to phase 4
   @phase = 4
   # Turn count
   $game_temp.battle_turn += 1
   # Search all battle event pages
   for index in 0...$data_troops[@troop_id].pages.size
     # Get event page
     page = $data_troops[@troop_id].pages[index]
     # If this page span is [turn]
     if page.span == 1
       # Clear action completed flags
       $game_temp.battle_event_flags[index] = false
     end
   end
   # Set actor as unselectable
   @actor_index = -1
   @active_battler = nil
   # Enable party command window
   @party_command_window.active = false
   @party_command_window.visible = false
   # Disable actor command window
   @actor_command_window.active = false
   @actor_command_window.visible = false
   # Set main phase flag
   $game_temp.battle_main_phase = true
   # Make enemy action
   for enemy in $game_troop.enemies
     enemy.make_action
   end
   # Make action orders
   make_action_orders
   # Shift to step 1
   @phase4_step = 1
 end
 #--------------------------------------------------------------------------
 # * Make Action Orders
 #--------------------------------------------------------------------------
 def make_action_orders
   # Initialize @action_battlers array
   @action_battlers = []
   # Add enemy to @action_battlers array
   for enemy in $game_troop.enemies
     @action_battlers.push(enemy)
   end
   # Add actor to @action_battlers array
   for actor in $game_party.actors
     @action_battlers.push(actor)
   end
   # Decide action speed for all
   for battler in @action_battlers
     battler.make_action_speed
   end
   # Line up action speed in order from greatest to least
   @action_battlers.sort! {|a,b|
     b.current_action.speed - a.current_action.speed }
 end
 #--------------------------------------------------------------------------
 # * Frame Update (main phase)
 #--------------------------------------------------------------------------
 def update_phase4
   case @phase4_step
   when 1
     update_phase4_step1
   when 2
     update_phase4_step2
   when 3
     update_phase4_step3
   when 4
     update_phase4_step4
   when 5
     update_phase4_step5
   when 6
     update_phase4_step6
   end
 end
 #--------------------------------------------------------------------------
 # * Frame Update (main phase step 1 : action preparation)
 #--------------------------------------------------------------------------
 def update_phase4_step1
   # Hide help window
   @help_window.visible = false
   # Determine win/loss
   if judge
     # If won, or if lost : end method
     return
   end
   # If an action forcing battler doesn't exist
   if $game_temp.forcing_battler == nil
     # Set up battle event
     setup_battle_event
     # If battle event is running
     if $game_system.battle_interpreter.running?
       return
     end
   end
   # If an action forcing battler exists
   if $game_temp.forcing_battler != nil
     # Add to head, or move
     @action_battlers.delete($game_temp.forcing_battler)
     @action_battlers.unshift($game_temp.forcing_battler)
   end
   # If no actionless battlers exist (all have performed an action)
   if @action_battlers.size == 0
     # Start party command phase
     start_phase2
     return
   end
   # Initialize animation ID and common event ID
   @animation1_id = 0
   @animation2_id = 0
   @common_event_id = 0
   # Shift from head of actionless battlers
   @active_battler = @action_battlers.shift
   # If already removed from battle
   if @active_battler.index == nil
     return
   end
   # Slip damage
   if @active_battler.hp > 0 and @active_battler.slip_damage?
     @active_battler.slip_damage_effect
     @active_battler.damage_pop = true
   end
   # Natural removal of states
   @active_battler.remove_states_auto
   # Refresh status window
   @status_window.refresh
   # Shift to step 2
   @phase4_step = 2
 end
 #--------------------------------------------------------------------------
 # * Frame Update (main phase step 2 : start action)
 #--------------------------------------------------------------------------
 def update_phase4_step2
   # If not a forcing action
   unless @active_battler.current_action.forcing
     # If restriction is [normal attack enemy] or [normal attack ally]
     if @active_battler.restriction == 2 or @active_battler.restriction == 3
       # Set attack as an action
       @active_battler.current_action.kind = 0
       @active_battler.current_action.basic = 0
     end
     # If restriction is [cannot perform action]
     if @active_battler.restriction == 4
       # Clear battler being forced into action
       $game_temp.forcing_battler = nil
       # Shift to step 1
       @phase4_step = 1
       return
     end
   end
   # Clear target battlers
   @target_battlers = []
   # Branch according to each action
   case @active_battler.current_action.kind
   when 0  # basic
     make_basic_action_result
   when 1  # skill
     make_skill_action_result
   when 2  # item
     make_item_action_result
   end
   # Shift to step 3
   if @phase4_step == 2
     @phase4_step = 3
   end
 end
 #--------------------------------------------------------------------------
 # * Make Basic Action Results
 #--------------------------------------------------------------------------
 def make_basic_action_result
   # If attack
   if @active_battler.current_action.basic == 0
     # Set anaimation ID
     @animation1_id = @active_battler.animation1_id
     @animation2_id = @active_battler.animation2_id
     # If action battler is enemy
     if @active_battler.is_a?(Game_Enemy)
       if @active_battler.restriction == 3
         target = $game_troop.random_target_enemy
       elsif @active_battler.restriction == 2
         target = $game_party.random_target_actor
       else
         index = @active_battler.current_action.target_index
         target = $game_party.smooth_target_actor(index)
       end
     end
     # If action battler is actor
     if @active_battler.is_a?(Game_Actor)
       if @active_battler.restriction == 3
         target = $game_party.random_target_actor
       elsif @active_battler.restriction == 2
         target = $game_troop.random_target_enemy
       else
         index = @active_battler.current_action.target_index
         target = $game_troop.smooth_target_enemy(index)
       end
     end
     # Set array of targeted battlers
     @target_battlers = [target]
     # Apply normal attack results
     for target in @target_battlers
       target.attack_effect(@active_battler)
     end
     return
   end
   # If guard
   if @active_battler.current_action.basic == 1
     # Display "Guard" in help window
     @help_window.set_text($data_system.words.guard, 1)
     return
   end
   # If escape
   if @active_battler.is_a?(Game_Enemy) and
      @active_battler.current_action.basic == 2
     # Display "Escape" in help window
     @help_window.set_text("Escape", 1)
     # Escape
     @active_battler.escape
     return
   end
   # If doing nothing
   if @active_battler.current_action.basic == 3
     # Clear battler being forced into action
     $game_temp.forcing_battler = nil
     # Shift to step 1
     @phase4_step = 1
     return
   end
 end
 #--------------------------------------------------------------------------
 # * Set Targeted Battler for Skill or Item
 #     scope : effect scope for skill or item
 #--------------------------------------------------------------------------
 def set_target_battlers(scope)
   # If battler performing action is enemy
   if @active_battler.is_a?(Game_Enemy)
     # Branch by effect scope
     case scope
     when 1  # single enemy
       index = @active_battler.current_action.target_index
       @target_battlers.push($game_party.smooth_target_actor(index))
     when 2  # all enemies
       for actor in $game_party.actors
         if actor.exist?
           @target_battlers.push(actor)
         end
       end
     when 3  # single ally
       index = @active_battler.current_action.target_index
       @target_battlers.push($game_troop.smooth_target_enemy(index))
     when 4  # all allies
       for enemy in $game_troop.enemies
         if enemy.exist?
           @target_battlers.push(enemy)
         end
       end
     when 5  # single ally (HP 0)
       index = @active_battler.current_action.target_index
       enemy = $game_troop.enemies[index]
       if enemy != nil and enemy.hp0?
         @target_battlers.push(enemy)
       end
     when 6  # all allies (HP 0)
       for enemy in $game_troop.enemies
         if enemy != nil and enemy.hp0?
           @target_battlers.push(enemy)
         end
       end
     when 7  # user
       @target_battlers.push(@active_battler)
     end
   end
   # If battler performing action is actor
   if @active_battler.is_a?(Game_Actor)
     # Branch by effect scope
     case scope
     when 1  # single enemy
       index = @active_battler.current_action.target_index
       @target_battlers.push($game_troop.smooth_target_enemy(index))
     when 2  # all enemies
       for enemy in $game_troop.enemies
         if enemy.exist?
           @target_battlers.push(enemy)
         end
       end
     when 3  # single ally
       index = @active_battler.current_action.target_index
       @target_battlers.push($game_party.smooth_target_actor(index))
     when 4  # all allies
       for actor in $game_party.actors
         if actor.exist?
           @target_battlers.push(actor)
         end
       end
     when 5  # single ally (HP 0)
       index = @active_battler.current_action.target_index
       actor = $game_party.actors[index]
       if actor != nil and actor.hp0?
         @target_battlers.push(actor)
       end
     when 6  # all allies (HP 0)
       for actor in $game_party.actors
         if actor != nil and actor.hp0?
           @target_battlers.push(actor)
         end
       end
     when 7  # user
       @target_battlers.push(@active_battler)
     end
   end
 end
 #--------------------------------------------------------------------------
 # * Make Skill Action Results
 #--------------------------------------------------------------------------
 def make_skill_action_result
   # Get skill
   @skill = $data_skills[@active_battler.current_action.skill_id]
   # If not a forcing action
   unless @active_battler.current_action.forcing
     # If unable to use due to SP running out
     unless @active_battler.skill_can_use?(@skill.id)
       # Clear battler being forced into action
       $game_temp.forcing_battler = nil
       # Shift to step 1
       @phase4_step = 1
       return
     end
   end
   # Use up SP
   @active_battler.sp -= @skill.sp_cost
   # Refresh status window
   @status_window.refresh
   # Show skill name on help window
   @help_window.set_text(@skill.name, 1)
   # Set animation ID
   @animation1_id = @skill.animation1_id
   @animation2_id = @skill.animation2_id
   # Set command event ID
   @common_event_id = @skill.common_event_id
   # Set target battlers
   set_target_battlers(@skill.scope)
   # Apply skill effect
   for target in @target_battlers
     target.skill_effect(@active_battler, @skill)
   end
 end
 #--------------------------------------------------------------------------
 # * Make Item Action Results
 #--------------------------------------------------------------------------
 def make_item_action_result
   # Get item
   @item = $data_items[@active_battler.current_action.item_id]
   # If unable to use due to items running out
   unless $game_party.item_can_use?(@item.id)
     # Shift to step 1
     @phase4_step = 1
     return
   end
   # If consumable
   if @item.consumable
     # Decrease used item by 1
     $game_party.lose_item(@item.id, 1)
   end
   # Display item name on help window
   @help_window.set_text(@item.name, 1)
   # Set animation ID
   @animation1_id = @item.animation1_id
   @animation2_id = @item.animation2_id
   # Set common event ID
   @common_event_id = @item.common_event_id
   # Decide on target
   index = @active_battler.current_action.target_index
   target = $game_party.smooth_target_actor(index)
   # Set targeted battlers
   set_target_battlers(@item.scope)
   # Apply item effect
   for target in @target_battlers
     target.item_effect(@item)
   end
 end
 #--------------------------------------------------------------------------
 # * Frame Update (main phase step 3 : animation for action performer)
 #--------------------------------------------------------------------------
 def update_phase4_step3
   # Animation for action performer (if ID is 0, then white flash)
   if @animation1_id == 0
     @active_battler.white_flash = true
   else
     @active_battler.animation_id = @animation1_id
     @active_battler.animation_hit = true
   end
   # Shift to step 4
   @phase4_step = 4
 end
 #--------------------------------------------------------------------------
 # * Frame Update (main phase step 4 : animation for target)
 #--------------------------------------------------------------------------
 def update_phase4_step4
   # Animation for target
   for target in @target_battlers
     target.animation_id = @animation2_id
     target.animation_hit = (target.damage != "Miss")
   end
   # Animation has at least 8 frames, regardless of its length
   @wait_count = 8
   # Shift to step 5
   @phase4_step = 5
 end
 #--------------------------------------------------------------------------
 # * Frame Update (main phase step 5 : damage display)
 #--------------------------------------------------------------------------
 def update_phase4_step5
   # Hide help window
   @help_window.visible = false
   # Refresh status window
   @status_window.refresh
   # Display damage
   for target in @target_battlers
     if target.damage != nil
       target.damage_pop = true
     end
   end
   # Shift to step 6
   @phase4_step = 6
 end
 #--------------------------------------------------------------------------
 # * Frame Update (main phase step 6 : refresh)
 #--------------------------------------------------------------------------
 def update_phase4_step6
   # Clear battler being forced into action
   $game_temp.forcing_battler = nil
   # If common event ID is valid
   if @common_event_id > 0
     # Set up event
     common_event = $data_common_events[@common_event_id]
     $game_system.battle_interpreter.setup(common_event.list, 0)
   end
   # Shift to step 1
   @phase4_step = 1
 end
end
EDITED. All of them, however working fine.

By edited, please note that there is a 2-character right indent for every line. The proper 2-character indent is mirrored in all of my scripts. Your 'default' scripts first indent is a mere 1-character indent to the right. So the default scripts in your package.... not exactly untouched. But they work fine.

I never tested the script with the 'Test Battle' system, but it works fine. I tried testing with no enemies, but it just goes into 'VICTORY' after that.

You have me VERY confused as I try to replicate your error. Eliminating the scripts that load the Enemies.Rxdata file.... Eliminating the method that creates the $game_troops value.... none of these creates your error at all.

I will say, I have another version of Just Runics (below), as there WAS a bug. But it was a bug related to actor parties, not enemy troops as you have reported.
Code:
#==============================================================================
# ** Just Runics
#------------------------------------------------------------------------------
#  By DerVVulfman
#  v 1.4
#  October 5, 2017
#==============================================================================
#  
#  NOTES:  The Target Animation of a Runic Barrier skill may also show as
#          an effect  upon the recipient when the next turn starts if the
#          barrier is still in effect.
#
#          Originally,  I had a TURNS value  in the configuration section
#          to set how many turns a runic barrier lasts.   Now, the number
#          of turns for a runic barrier to last can be set in the skill's
#          variance value in the Skills database.
#          
#          Originally,  I had a TURNS value  in the configuration section
#          Lastly, a new BYPASS_LIST was added,  Fill this with Skill IDs
#          of skills that permit team member spells  to pass through  the
#          protective Runic barrier.  Concept courtesy of kyonides.
#
#==============================================================================


module Runic


  # List of Skills by ID
  # This, by their skill ID in the database
  #
    SKILL_LIST = [81]

  # Bypass List by ID
  # This holds the list of Runic spells that permit team member spells
  # to pass through.
  #
    BYPASS_LIST = [81]


  # Show Animation Effect per turn?
  # If true, the shielded runic animation plays on turn start
  #
    TURN_SHOW = true


  # Show Animation Effect on Defence?
  # If true, the shielded runic animation plays just as the attacker attacks.
  #
    DEFENCE_SHOW = true


  # Pop that shows target/self protected
  # (Or nil if no pop to show)
  #
    SPELL_POP  = "Runic Barrier"


  # Set Status Effect text if barrier exists
  # Or nil in either if no state text shows.
  # The '[Normal]' state tends to be hardcoded in the default scripts
  #
    STATE_TXT1  = "[Normal]"
    STATE_TXT2  = "[Runic]"


  # Words that show target/self absorbed SP
  # Format is RUNIC_ABSORB + value + RUNIC_SUFFIX
  # (Or nil per word not showing)
  #
    RUNIC_ABSORB = "Absorb"
    RUNIC_SUFFIX = "SP"


end


#==============================================================================
# ** Game_Battler
#------------------------------------------------------------------------------
#  This class deals with battlers. It's used as a superclass for the Game_Actor
#  and Game_Enemy classes.
#==============================================================================

class Game_Battler
  #--------------------------------------------------------------------------
  # * Alias Listings
  #--------------------------------------------------------------------------
  alias runic_gb_initialize initialize
  alias runic_gb_skill_effect skill_effect
  #--------------------------------------------------------------------------
  # * Public Instance Variables
  #--------------------------------------------------------------------------
  attr_accessor :runic_counter            # runic absorb counter
  attr_accessor :runic_spell_id           # runic spell ID
  attr_accessor :runic_animation          # runic spell animation
  attr_accessor :runic_animation2         # runic spell animation2
  #--------------------------------------------------------------------------
  # * Object Initialization
  #--------------------------------------------------------------------------
  def initialize
    # Perform the original call
    runic_gb_initialize
    # The added value
    @runic_counter    = 0
    @runic_spell_id   = 0
    @runic_animation  = 0
    @runic_animation2  = 0
  end
  #--------------------------------------------------------------------------
  # * Apply Skill Effects
  #     user  : the one using skills (battler)
  #     skill : skill
  #--------------------------------------------------------------------------
  def skill_effect(user, skill)
    # If skill is slated as a runic barrier spell
    if Runic::SKILL_LIST.include?(skill.id)
      # Set the spell ID for the runic spell
      @runic_spell_id = skill.id
      # Set the number of turns
      @runic_counter = skill.variance
      # Self/caster turns must be increased 1
      @runic_counter += 1 if user == self
      # Show applied pop text if text set
      self.damage = Runic::SPELL_POP unless Runic::SPELL_POP.nil?
      # Set the barrier animation ID for self
      @runic_animation = skill.animation2_id
      # End Method
      return true
    end
    # Perform the original call
    effective = runic_gb_skill_effect(user, skill)
    # Run bypass if Skill permits ally effects
    return effective unless skill_effect_attacker?(user) == true
    # If positive damage during runic effect
    if @runic_counter > 0
      if self.damage != 0
        # Restore health befoer damage
        self.hp += self.damage
        # Add attacker's SP cost into SP score
        self.sp += skill.sp_cost
        # Clear critical flag
        self.critical = false
        # Add Animation Effect
        @runic_animation2 = @runic_animation
        # Change Pop message
        word1 = word2 = ""
        word1 = Runic::RUNIC_ABSORB unless Runic::RUNIC_ABSORB.nil?
        word2 = Runic::RUNIC_SUFFIX unless Runic::RUNIC_SUFFIX.nil?
        self.damage = word1 +(skill.sp_cost).to_s + word2
        # And turn the runic effect off
        @runic_counter = 0
      return effective
      end
    end
    # End Method
    return effective
  end
  #--------------------------------------------------------------------------
  # * Skill Effect from an attacker?
  #     user  : the one using skills (battler)
  #--------------------------------------------------------------------------  
  def skill_effect_attacker?(user)
    # Ineffective test if team bypass turned on for skill
    unless Runic::BYPASS_LIST.nil?
      return true unless Runic::BYPASS_LIST.include?(@runic_spell_id)
    end
    # Check if both user and self are in same 'group'
    return false  if user.is_a?(Game_Enemy) and self.is_a?(Game_Enemy)
    return false  if user.is_a?(Game_Actor) and self.is_a?(Game_Actor)
    # End Method
    return true
  end
end



#==============================================================================
# ** Window_Base
#------------------------------------------------------------------------------
#  This class is for all in-game windows.
#==============================================================================

class Window_Base < Window
  #--------------------------------------------------------------------------
  # * Alias Listings
  #--------------------------------------------------------------------------
  alias runic_wb_make_battler_state_text make_battler_state_text
  #--------------------------------------------------------------------------
  # * Make State Text String for Drawing
  #     actor       : actor
  #     width       : draw spot width
  #     need_normal : Whether or not [normal] is needed (true / false)
  #--------------------------------------------------------------------------
  def make_battler_state_text(battler, width, need_normal)
    # Perform the original call
    text = runic_wb_make_battler_state_text(battler, width, need_normal)
    # Exit if system not used
    return text if Runic::STATE_TXT1.nil?
    return text if Runic::STATE_TXT2.nil?
    # Change if normal state and ...
    if text == Runic::STATE_TXT1
      # If a runic barrier exists
      if battler.runic_counter > 0
        # Set the new text
        text = Runic::STATE_TXT2
      end
    end
    # Return completed text string
    return text
  end
end



#==============================================================================
# ** Scene_Battle
#------------------------------------------------------------------------------
#  This class performs battle screen processing.
#==============================================================================

class Scene_Battle
  #--------------------------------------------------------------------------
  # * Frame Update (main phase step 6 : refresh)
  #--------------------------------------------------------------------------
  alias runic_sb_start_phase1 start_phase1
  alias runic_sb_battle_end battle_end
  alias runic_sb_start_phase2 start_phase2
  alias runic_sb_update_phase4_step3 update_phase4_step3
  alias runic_sb_update_phase4_step6 update_phase4_step6
  #--------------------------------------------------------------------------
  # * Start Pre-Battle Phase
  #--------------------------------------------------------------------------
  def start_phase1
    # Cycle through enemies
    for enemy in $game_troop.enemies
      # Only if exists
      if enemy.exist?
        # Perform runic cleaning
        runic_clean(enemy)
      end
    end
    # Cycle through actors
    for actor in $game_party.actors
      # Only if exists
      if actor.exist?
        # Perform runic cleaning
        runic_clean(actor)
      end
    end    
    # Perform the original call
    runic_sb_start_phase1
  end
  #--------------------------------------------------------------------------
  # * Battle Ends
  #     result : results (0:win 1:lose 2:escape)
  #--------------------------------------------------------------------------
  def battle_end(result)
    # Cycle through enemies
    for enemy in $game_troop.enemies
      # Only if exists
      if enemy.exist?
        # Perform runic cleaning
        runic_clean(enemy)
      end
    end
    # Cycle through actors
    for actor in $game_party.actors
      # Only if exists
      if actor.exist?
        # Perform runic cleaning
        runic_clean(actor)
      end
    end    
    # Perform the original call
    runic_sb_battle_end(result)
  end
  #--------------------------------------------------------------------------
  # * Start Pre-Battle Runic System Cleanup
  #     target : target (actor or enemy)
  #--------------------------------------------------------------------------
  def runic_clean(target)
    target.runic_counter    = 0
    target.runic_spell_id   = 0
    target.runic_animation  = 0
    target.runic_animation2 = 0
  end
  #--------------------------------------------------------------------------
  # * Start Party Command Phase
  #--------------------------------------------------------------------------
  def start_phase2
    # Cycle through enemies
    for enemy in $game_troop.enemies
      # Perform runic animation
      runic_animation(enemy)
    end
    # Cycle through actors
    for actor in $game_party.actors
      # Perform runic animation
      runic_animation(actor)
    end
    # Perform the original call
    runic_sb_start_phase2
  end
  #--------------------------------------------------------------------------
  # * Start Runic Animation Effect at Party Command Start
  #     target : target (actor or enemy)
  #--------------------------------------------------------------------------
  def runic_animation(target)
    return unless Runic::TURN_SHOW == true
    return unless target.exist?
    return unless target.hp > 0
    return unless target.runic_counter > 0
    target.animation_id = target.runic_animation
    target.animation_hit = true
  end
  #--------------------------------------------------------------------------
  # * Frame Update (main phase step 3 : animation for action performer)
  #--------------------------------------------------------------------------
  def update_phase4_step3
    # Cycle through targets and apply
    update_phase4_step3_barrier
    # Perform the original call
    runic_sb_update_phase4_step3
  end  
  #--------------------------------------------------------------------------
  # * Frame Update (main phase step 3 : animation for barrier)
  #--------------------------------------------------------------------------
  def update_phase4_step3_barrier
    # Exit method unless Defence Barrier shows
    return unless Runic::DEFENCE_SHOW == true
    # Cycle through targets and apply
    for target in @target_battlers
      # Skip unless there is an animation
      next if target.runic_animation2 == 0
      # Apply protective barrier in anticipation
      target.animation_id = target.runic_animation2
      target.animation_hit = true
      # Erase effect
      target.runic_animation2 = 0
    end
  end
  #--------------------------------------------------------------------------
  # * Frame Update (main phase step 6 : refresh)
  #--------------------------------------------------------------------------
  def update_phase4_step6
    # Update Runic counter (never below 0)
    @active_battler.runic_counter -= 1
    @active_battler.runic_counter == 0 if @active_battler.runic_counter < 0
    # Perform the original call
    runic_sb_update_phase4_step6
  end
end
@DerVVulfman
Gave it a go. New project of course to see whether it works.
I would love to say "FINALLY! IT'S ALIVE!".

Unfortunately, good ol' Line 236 a.k.a. the Gandalf of this Runic Script decided to once again stop by, this time with tea and biscuits in hand as it hands me the "for enemy in $game_troop.enemies" error award which I had to politely refuse its "generous offer".

Lame humor from me aside, it still did not work.

Scenario Recap: Current Project, does not work. New Project, nothing else touched, only added the latest Runic script below "Scene_Debug" and above "Main", gave it a "Play Test" and "Game.Exe" run, still does not work.
I would love to have a TEST project. Just a demo of your default no-custom, no NOTHING start-off project before you add anything to it. I mean 100% starter. THIS I gotta see. Just put up as an attachment. You'll need NEW REPLY to bring up a full editor with attachment options.
Pages: 1 2 3 4 5 6