The RPG Maker Resource Kit

RMRK RPG Maker Creation => RPG Maker General => General Scripting => Topic started by: dudeguy119 on June 26, 2013, 06:25:01 PM

Title: [VX]I've fixed Battle Engine Melody ATB's "Fatal Flaw"
Post by: dudeguy119 on June 26, 2013, 06:25:01 PM
Not sure if this is where to put this, or if anyone cares anymore seeing as this script is older than the hills now, what with Yanfly Ace out and me still playing around in VX instead of getting ACE.

But, anyways, I solved the problem that was causing the ATB to stop completely whenever an actor or enemy attempts to use a skill they no longer meet the requirements to use. I've seen a lot of complaints and requests to fix it, but no solutions. So I fixed it myself.

If anyone is interested, just replace "process_atb_action" around line 9176 with this:

  #--------------------------------------------------------------------------
  # new method: process_atb_action
  #--------------------------------------------------------------------------
  def process_atb_action
    if $game_troop.forcing_battler != nil
      @active_battler = $game_troop.forcing_battler
    else
      @active_battler = $game_troop.atb_ready[0]
      $game_troop.atb_ready.delete(@active_battler)
    end
    return if @active_battler == nil
    if !@active_battler.action.valid?
      @active_battler.reset_atb_speed
      end
    return if !@active_battler.action.valid?
    pause_atb(true)
    @message_window.visible = true
    execute_action unless @active_battler.action.wait?
    @message_window.clear
    @message_window.visible = false
    unless $game_troop.forcing_battler
      $game_troop.atb_ready.delete(@active_battler)
      @active_battler.reset_atb_speed
      @active_battler.process_atb_reset
    end
    $game_troop.forcing_battler = nil
    @active_battler = nil
    if YEM::BATTLE_ENGINE::ATB_COMMON_EVENTS[:end_action] != nil
      event_id = YEM::BATTLE_ENGINE::ATB_COMMON_EVENTS[:end_action]
      $game_temp.common_event_id = event_id
      process_battle_event
    end
    pause_atb(false)
  end


The problem was one that is easy to overlook, especially since the game returns no error message. It took me hours to sleuth the source of the problem, but not very long to fix it. The problem was that there were no further instructions on what to do if a skill no longer meets the requirements (cost) to use it. I've fixed it by telling it to return to the start of the ATB. If anyone wants a different outcome, I can attempt to make that happen. I'm looking into that myself, as I'm not sure if that's what I want it to do in my game
Title: Re: [VX]I've fixed Battle Engine Melody ATB's "Fatal Flaw"
Post by: IAMFORTE on June 27, 2013, 12:52:55 AM
Great job!