Help with an ATB
#6
Actually you CAN change the energy from script, but the ATB system overwrites the value at battle start anyways. Let's fix that.

Find:
Code:
#----------------------------------------------------------------------------
  # œ ƒIƒuƒWƒFƒNƒg‚̏‰Šú‰»
  #----------------------------------------------------------------------------
  def initialize
    @battlers = []
    @cancel = false
    @agi_total = 0
    # ”z—ñ @count_battlers ‚ð‰Šú‰»
    @count_battlers = []
    # ƒGƒlƒ~[‚ð”z—ñ @count_battlers ‚ɒljÁ
    for enemy in $game_troop.enemies
      @count_battlers.push(enemy)
    end
    # ƒAƒNƒ^[‚ð”z—ñ @count_battlers ‚ɒljÁ
    for actor in $game_party.actors
      @count_battlers.push(actor)
    end
    for battler in @count_battlers
      @agi_total += battler.agi
    end
    for battler in @count_battlers
      battler.cp = [[65535 * (rand(15) + 85) / 100 * battler.agi / @agi_total * 4, 0].max, 65535].min
    end
  end

replace with
Code:
#----------------------------------------------------------------------------
  # œ ƒIƒuƒWƒFƒNƒg‚̏‰Šú‰»
  #----------------------------------------------------------------------------
  def initialize
    @battlers = []
    @cancel = false
    @agi_total = 0
    # ”z—ñ @count_battlers ‚ð‰Šú‰»
    @count_battlers = []
    # ƒGƒlƒ~[‚ð”z—ñ @count_battlers ‚ɒljÁ
    for enemy in $game_troop.enemies
      @count_battlers.push(enemy)
    end
    # ƒAƒNƒ^[‚ð”z—ñ @count_battlers ‚ɒljÁ
    for actor in $game_party.actors
      @count_battlers.push(actor)
    end
    for battler in @count_battlers
      @agi_total += battler.agi
    end
    for battler in @count_battlers
      if (battler.cp == 0)
        battler.cp = [[65535 * (rand(15) + 85) / 100 * battler.agi / @agi_total * 4, 0].max, 65535].min
      end
    end
  end

then find:
Code:
#--------------------------------------------------------------------------
  # œ ƒoƒgƒ‹I—¹
  #    result : Œ‹‰ (0:Ÿ—˜ 1:”s–k 2:“¦‘–)
  #--------------------------------------------------------------------------
  alias xrxs_bp1_battle_end battle_end
  def battle_end(result)
    # CPƒJƒEƒ“ƒg’âŽ~
    @cp_thread.stop
    xrxs_bp1_battle_end(result)
  end
  #-------

replace with:
Code:
#--------------------------------------------------------------------------
  # œ ƒoƒgƒ‹I—¹
  #    result : Œ‹‰ (0:Ÿ—˜ 1:”s–k 2:“¦‘–)
  #--------------------------------------------------------------------------
  alias xrxs_bp1_battle_end battle_end
  def battle_end(result)
    #return actor CP to inital value
    for actor in $game_party.actors
      actor.cp = 0
    end
    # CPƒJƒEƒ“ƒg’âŽ~
    @cp_thread.stop
    xrxs_bp1_battle_end(result)
  end
  #------

Now, from a "Script..." Event, do:
Code:
#Player Advantage!
    for actor in $game_party.actors
      actor.cp = 65534
    end

Code:
#Enemy Advantage!
    for actor in $game_party.actors
      actor.cp = 1
    end

I tested it and it works for me, so let me know if you have any problems.
}


Messages In This Thread
Help with an ATB - by VEE-Chary - 04-20-2014, 01:58 AM
RE: Help with an ATB - by DerVVulfman - 04-20-2014, 03:38 AM
RE: Help with an ATB - by VEE-Chary - 04-20-2014, 03:46 AM
RE: Help with an ATB - by DerVVulfman - 04-21-2014, 08:03 PM
RE: Help with an ATB - by VEE-Chary - 04-21-2014, 11:53 PM
RE: Help with an ATB - by MechanicalPen - 04-22-2014, 12:42 AM
RE: Help with an ATB - by VEE-Chary - 04-22-2014, 03:06 AM



Users browsing this thread: 2 Guest(s)