Yami PCTB compatibility fix for Yanfly Instant Cast

● ARCHIVED · READ-ONLY
Started by Oriceles 3 posts View original ↗
  1. Well Yami PCTB is my favorite battle system but it is no longer mantained and I really want to have it in my game, the problem is that if I use Yanfly Instant Cast the tags go ignored doing the actions, following up with the turn and sometimes causing this error:

    Script ‘Scene_Battle’ line 330: NoMethodError occurredSo I'm asking to a fix for this, that is.

    I'll leave attached a project with all necessary scripts and fixes and a battle set to reproduce this error. Otherwise I will upload a video if needed.

    Support PCTB.zip

    The only step needed to reproduce the error is to try to cast Fire Force skill which is set to instant in the database. 
  2. You may want to try this snippet:

    Spoiler
    Code:
    if $imported["YSA-PCTB"] && $imported["YEA-InstantCast"]#------------------------------------------------------------------------------|#------------------------------------------------------------------------------|#  * Edit module: BattleManager                                                |#------------------------------------------------------------------------------|class << BattleManager  #----------------------------------------------------------------------------|  #  Rewrite method: sort_battlers                                             |  #----------------------------------------------------------------------------|  def sort_battlers(cache = false)    return if !btype?(:pctb)    battlers = []    for battler in ($game_party.members + $game_troop.members)      # Rewritten to exclude the actor with an instant action      next if battler.dead? || battler == $game_temp.instant_actor      #      battlers.push(battler)    end    battlers.sort! { |a,b|      if a.pctb_ctr(cache) != b.pctb_ctr(cache)        a.pctb_ctr(cache) <=> b.pctb_ctr(cache)      elsif a.pctb_prediction != b.pctb_prediction        b.pctb_prediction <=> a.pctb_prediction      elsif a.agi != b.agi        b.agi <=> a.agi      elsif a.screen_x != b.screen_x        a.screen_x <=> b.screen_x      else        a.name <=> b.name      end    }    # Added to add the actor with an instant action as the 1st battler    if $game_temp.instant_actor      battlers = [$game_temp.instant_actor] + battlers      $game_temp.instant_actor = nil    end    #    return battlers  end # sort_battlersend # BattleManager#------------------------------------------------------------------------------|#  * Edit class: Game_Temp                                                     |#------------------------------------------------------------------------------|class Game_Temp  #----------------------------------------------------------------------------|  #  New public instance variable                                              |  #----------------------------------------------------------------------------|  # Stores the actor with an instant action  attr_accessor :instant_actor  #end # Game_Temp#------------------------------------------------------------------------------|#  * Edit class: Scene_Battle                                                  |#------------------------------------------------------------------------------|class Scene_Battle  #----------------------------------------------------------------------------|  #  Alias method: perform_instant_action                                      |  #----------------------------------------------------------------------------|  alias perform_instant_action_pctb perform_instant_action  def perform_instant_action    # Added to store the actor with an instant action    $game_temp.instant_actor = BattleManager.actor    #    perform_instant_action_pctb  end # perform_instant_actionend # Scene_Battle#------------------------------------------------------------------------------|end # if $imported["YSA-PCTB"] && $imported["YEA-InstantCast"]
  3. Thank you, the instant cast is working fine now, but then I tested having another actor on the party and the attack command loops until I cancel and select another actor action.

    Example i tried on demo:
    - Added Ernest to party en test battle
    - Ernest takes first action

    - I set to attack, then attack and attack... and so on (error loop?)

    - Then i cancel and select an action for Eric

    - Now I set attack action for Ernest

    - It proceeds as it should

    EDIT: I removed TheoAllen Turn Fix from Battle Engine Ace and now your Fix work as it should. I can say this is solved for now. If I need further support I'll post here. Thanks a lot DoubleX :D I owe you a cookie.