Is there a way to make TP bars increase gradually, similar to the way full ATB bars gradually increase? The full ATB bars, by the way, fill continuously, regardless of turn.
Thanks 🙂
Thanks 🙂
module ADIK module TURN_EXTENSION# ==============================================================================# Edit these two for global turn start and turn end methods# ============================================================================== def self.global_turn_start $game_party.battle_members.each {|bat| bat.tp += value} $game_troop.members.each {|bat| bat.tp += value} end def self.global_turn_end end
Then you'll have to specify when that atp bar should fill(i.e., when that atp should increase). The atb bars fill per frame(the atb values increase per frame) whenever they're allowed to fill and aren't already full, but that only makes sense to your atp bars if they're time-based(or frame-based technically) too 🙂
As I still have no idea of what you want to do, I'll instead drop down how CATB full mode fills the atb bar.
#----------------------------------------------------------------------------| # Alias method: catb_pause? | #----------------------------------------------------------------------------| alias catb_wait_addon_pause? catb_pause? def catb_pause? # Added to force the atb to run if FORCE_RUN_WAIT is true and WAIT_KEY is pressed $game_system.catb_wait_type != :full_ani && (!DoubleX_RMVXA::YSA_CATB_Wait_Addon::FORCE_RUN_WAIT || !@force_run_catb) && catb_wait_addon_pause? # end # catb_pause? #----------------------------------------------------------------------------| # Alias method: update_basic | #----------------------------------------------------------------------------| alias catb_wait_addon_update_basic update_basic def update_basic catb_wait_addon_update_basic # Added to check if WAIT_KEY is pressed set_force_run_catb if BattleManager.btype?(:catb) # end # update_basic #----------------------------------------------------------------------------| # Alias method: update_for_wait | #----------------------------------------------------------------------------| alias update_for_wait_catb update_for_wait def update_for_wait update_for_wait_catb # Added to force the atb to run if FORCE_RUN_ANI is true and WAIT_KEY is pressed process_catb if BattleManager.phase != :init && !$game_message.visible && BattleManager.btype?(:catb) && ($game_system.catb_wait_type == :full_ani || DoubleX_RMVXA::YSA_CATB_Wait_Addon::FORCE_RUN_ANI && @force_run_catb) # end # update_for_wait #----------------------------------------------------------------------------| # New method: set_force_run_catb | #----------------------------------------------------------------------------| def set_force_run_catb last_force_run_catb = @force_run_catb @force_run_catb ||= Input.trigger?(DoubleX_RMVXA::YSA_CATB_Wait_Addon::FORCE_RUN_ATB_KEY) @force_run_catb &&= !Input.trigger?(DoubleX_RMVXA::YSA_CATB_Wait_Addon::STOP_FORCE_RUN_ATB_KEY) @catb_wait_window.draw_text(@force_run_catb) if @catb_wait_window && last_force_run_catb != @force_run_catb end # set_force_run_catb
module BattleManager # Edit attr_reader :phase # Read by atp_update? under Scene_Battleend # BattleManagerclass Game_Battler < Game_BattlerBase # Edit def atp_update # New return if @tp >= max_tp @tp += increment # increment is code written by you @tp = max_tp if @tp > max_tp end # atp_updateend # Game_Battlerclass Scene_Battle < Scene_Base # Edit alias update_atp update def update update_atp atp_update if [email protected]? && atp_update? # Added end # update alias update_for_wait_atp update_for_wait def update_for_wait update_for_wait_atp atp_update if @spriteset.animation? && atp_update? # Added end # update_for_wait def atp_update # New $game_party.alive_members.each { |mem| mem.atp_update } $game_troop.alive_members.each { |mem| mem.atp_update } end # atp_update def atp_update? # New return false if scene_changing? || $game_message.visible return false if $game_party.all_dead? || $game_troop.all_dead? BattleManager.phase && BattleManager.phase != :init end # atp_update?end # Scene_Battle
Original thread: https://forums.rpgmakerweb.com/threads/tp-bar-that-increase-gradually.43924/