New account registration is temporarily disabled.

[SCRIPTING-VXA] YEA INSTANT CAST AND YAMI'S PCTB

Posts

Pages: 1
I'm using Yami's Predicted Charge Turn Battle with the Ace Battle Engine.

One of the characters in my game can get stance skills, which change his stats during the course of the battle. I wanted you to be able to change stance and attack in the same turn, so I downloaded Yanfly's Instant Cast script, as it did exactly what I wanted. I put it in my game's scripts, and tagged all stance skills as instant.

And it didn't work... I tried having it both between the Ace Battle Engine and the PCTB and below both. Most of the time it completely ignores my tag and ends the turn after I use a stance skill. Occasionally, it instead crashes and gives me an error.
author=Error Window
Script 'Scene_Battle' line 330: NoMethodError occurred.

undefined method 'index' for nil:NilClass

I went to the Scene_Battle script. The error happens here:
#--------------------------------------------------------------------------
  # * Start Actor Command Selection
  #--------------------------------------------------------------------------
  def start_actor_command_selection
    @status_window.select(BattleManager.actor.index)
    @party_command_window.close
    @actor_command_window.setup(BattleManager.actor)
  end

I went to BattleManager and found the definition of actor.
#--------------------------------------------------------------------------
  # * Get Actor for Which Command Is Being Entered
  #--------------------------------------------------------------------------
  def self.actor
    @actor_index >= 0 ? $game_party.members[@actor_index] : nil
  end

I found uses of actor_index and actor.index in the PCTB code:
#--------------------------------------------------------------------------
  # new method: set_actor
  #--------------------------------------------------------------------------
  def self.set_actor(actor_index)
    @actor_index = actor_index
  end
#--------------------------------------------------------------------------
  # new method: ctb_prior_actor
  #--------------------------------------------------------------------------
  def ctb_prior_actor
    BattleManager.actor.make_actions
    last_index = BattleManager.actor.index
    prior_index = last_index - 1
    if prior_index < 0
      @actor_command_window.close
      @party_command_window.setup
    else
      return ctb_prior_actor if !$game_party.members[prior_index].movable?
      $game_party.members[prior_index].make_actions
      BattleManager.input_start
      BattleManager.set_actor(prior_index) 
      start_actor_command_selection
      if $imported["YEA-BattleEngine"]
        redraw_current_status
        @status_aid_window.hide
      else
        refresh_status
      end
      @status_window.show
      @status_window.open
    end
  end
#--------------------------------------------------------------------------
  # new method: ctb_next_command
  #--------------------------------------------------------------------------
  def ctb_next_command
    BattleManager.actor.make_actions
    last_index = BattleManager.actor.index
    next_index = last_index + 1
    if next_index > ($game_party.members.size - 1)
      return start_confirm_command_selection if $imported["YEA-BattleCommandList"] && YEA::BATTLE_COMMANDS::USE_CONFIRM_WINDOW
      BattleManager.action_list_ctb[0].make_actions
      start_pctb_action
    else
      return ctb_next_command if !$game_party.members[next_index].movable?
      $game_party.members[next_index].make_actions
      BattleManager.input_start
      BattleManager.set_actor(next_index) 
      start_actor_command_selection
      if $imported["YEA-BattleEngine"]
        redraw_current_status
        @status_aid_window.hide
      else
        refresh_status
      end
      @status_window.show
      @status_window.open
    end
  end

Can someone please help me understand what's happening and what I can do to fix this?
Pages: 1