Charge Turn Battle (CTB) System (Final Fantasy X / Tactics style)

MobiusXVI

Game Maker
Veteran
Joined
Mar 20, 2013
Messages
383
Reaction score
91
First Language
English
Primarily Uses
Hello ! your script it's working like a charm, i am really happy with this combat sytsem, is there a way to make it compatible with this script ? https://forum.chaos-project.com/index.php/topic,12640.0.html
I took a look at that script, and I think I can make a patch to make them compatible (if XP was more like Ace, they probably would've been compatible out of the box). If I have time this weekend, I'll make it and let you know.


i watched the video, and it look like the Persona 3/4/5 turn battle mechanic.
you know where in Persona 3/4/5 when its your turn, you take an action IMMEDIATELY.
and after you took an action, the next battler does an action when its their turn.
and when a battler has the highest Agility Stat (A.K.A. Speed Stat)
that certain battler goes first at Turn 0/1.
I've never played the Persona games so I'll have to take your word for it lol :D:guffaw:
 

MarioWidjaya123

Veteran
Veteran
Joined
May 16, 2020
Messages
187
Reaction score
6
First Language
English
Primarily Uses
RMXP
@MobiusXVI
its ok, its just that in the Persona 3/4/5 Turn Battle Mechanic
where you strike an enemy's weakness (or land a critical hit),
they get knocked down (not dead) and you get a "1 More",
but you can't get that "1 More" again
when the enemy is ALREADY knocked down.
(and also the same "1 More" mechanic applies to the enemies as well.)
 

MobiusXVI

Game Maker
Veteran
Joined
Mar 20, 2013
Messages
383
Reaction score
91
First Language
English
Primarily Uses
@Fred_than_dead I think this will work for you. I haven't tested it though so let me know if you encounter any bugs.
Ruby:
#===============================================================================
# Mobius' Charge Turn Battle System + Target Anyone Scope PATCH
# Author: Mobius XVI (CTB) + KK20 (TAS)
# Version: 1.0
# Date: 14 NOV 2020
#===============================================================================
#
# Introduction:
#
#   This is a patch script to make KK20's TAS script compatible with Mobius's
#   CTB script.
#
# Instructions:
#
#  - Place this script below all the default scripts but above main.
#  - The order of scripts should be:
#   Default scripts
#   TAS
#   CTB
#   PATCH
#   Main
#
#  Credits/Thanks:
#    - Mobius XVI, author
#    - KK20, TAS script: https://forum.chaos-project.com/index.php/topic,12640.0.html
#
#  License
#    This script is licensed under the MIT license, so you can use it for
#    both commercial and non-commercial games.
#
#==============================================================================
class Scene_Battle
  #--------------------------------------------------------------------------
  # * Frame Update (actor command phase : skill selection)
  #--------------------------------------------------------------------------
  def update_phase3_skill_select
    # Make skill window visible
    @skill_window.visible = true
    # Update skill window
    @skill_window.update
    # If B button was pressed
    if Input.trigger?(Input::B)
      # Play cancel SE
      $game_system.se_play($data_system.cancel_se)
      # End skill selection
      end_skill_select
      return
    end
    # If C button was pressed
    if Input.trigger?(Input::C)
      # Get currently selected data on the skill window
      @skill = @skill_window.skill
      # If it can't be used
      if @skill == nil or not @active_battler.skill_can_use?(@skill.id)
        # Play buzzer SE
        $game_system.se_play($data_system.buzzer_se)
        return
      end
      # Play decision SE
      $game_system.se_play($data_system.decision_se)
      # Set action
      @active_battler.current_action.skill_id = @skill.id
      # Make skill window invisible
      @skill_window.visible = false
            
            ### PATCHING IN ANY TARGET ###
            
            # If effect scope is single enemy or single ally and can target anyone
      if @skill.element_set.include?($data_system.elements.index(TARGET_ANYONE_TAG)) and
      (@skill.scope == 1 or @skill.scope == 3)
        # Define starting position of the arrow
        @orig_scope = @skill.scope
        @any_target = true
            end
            
            ### END PATCH ###
            
      # If effect scope is single enemy
      if @skill.scope == 1
        # Start enemy selection
        start_enemy_select
      # If effect scope is all enemy - Mobius
      elsif @skill.scope == 2
        # Start all enemy selection
        start_all_enemy_select
      # If effect scope is single ally
      elsif @skill.scope == 3 or @skill.scope == 5
        # Start actor selection
        start_actor_select
      # If effect scope is all ally - Mobius
      elsif @skill.scope == 4 or @skill.scope == 6
        # Start all actor selection
        start_all_actor_select
      # If effect scope is not single
      else
        # End skill selection
        end_skill_select
        # Go to command input for next actor
        start_phase4
      end
      return
    end
  end
  #--------------------------------------------------------------------------
  # * Frame Update (actor command phase : item selection)
  #--------------------------------------------------------------------------
  def update_phase3_item_select
    # Make item window visible
    @item_window.visible = true
    # Update item window
    @item_window.update
    # If B button was pressed
    if Input.trigger?(Input::B)
      # Play cancel SE
      $game_system.se_play($data_system.cancel_se)
      # End item selection
      end_item_select
      return
    end
    # If C button was pressed
    if Input.trigger?(Input::C)
      # Get currently selected data on the item window
      @item = @item_window.item
      # If it can't be used
      unless $game_party.item_can_use?(@item.id)
        # Play buzzer SE
        $game_system.se_play($data_system.buzzer_se)
        return
      end
      # Play decision SE
      $game_system.se_play($data_system.decision_se)
      # Set action
      @active_battler.current_action.item_id = @item.id
      # Make item window invisible
      @item_window.visible = false
            
            ### PATCHING IN ANY TARGET ###
            
            # If effect scope is single enemy or single ally and can target anyone
      if @item.element_set.include?($data_system.elements.index(TARGET_ANYONE_TAG)) and
      (@item.scope == 1 or @item.scope == 3)
        # Define starting position of the arrow
        @orig_scope = @item.scope
        @any_target = true
            end
            
            ### END PATCH ###
            
      # If effect scope is single enemy
      if @item.scope == 1
        # Start enemy selection
        start_enemy_select
      # If effect scope is all enemy - Mobius
      elsif @item.scope == 2
        # Start all enemy selection
        start_all_enemy_select
      # If effect scope is single ally
      elsif @item.scope == 3 or @item.scope == 5
        # Start actor selection
        start_actor_select
      # If effect scope is all ally - Mobius
      elsif @item.scope == 4 or @item.scope == 6
        # Start all actor selection
        start_all_actor_select
      # If effect scope is not single
      else
        # End item selection
        end_item_select
        # Go to command input for next actor
        start_phase4
      end
      return
    end
  end
  #--------------------------------------------------------------------------
  # * Frame Update (actor command phase : enemy selection)
  #--------------------------------------------------------------------------
  def update_phase3_enemy_select
    # Update enemy arrow
    @enemy_arrow.update
        # If Beastiary is added
        if Mobius::Charge_Turn_Battle::BEASTIARY
            # If Beastiary access button is pressed
            if Input.trigger?(Input::BEASTIARY_BATTLE_ACCESS_BUTTON)
                # Set enemy
                enemy = @enemy_arrow.enemy
                # If enemy has been scanned -- Mobius added
                if enemy.state?(Mobius::Charge_Turn_Battle::SCAN_STATE_ID)
                # Play decision SE
                $game_system.se_play($data_system.decision_se)
                # Start turn order window
                start_enemy_detail_window(enemy)
                return
                else
                # Play buzzer SE
                $game_system.se_play($data_system.buzzer_se)
                end
            end
        end
    # If this skill/item can target anyone
    if @any_target == true
      # If player pressed the key to change targets
      if Input.trigger?(Input::DOWN)
        # Play decision SE
        $game_system.se_play($data_system.cursor_se)
        # Initialize actor select, end enemy select
        end_enemy_select
        start_actor_select
        @active_battler.changed_scope = !@active_battler.changed_scope
        # Stop processing
        return
      end
    end
        # If B button was pressed
    if Input.trigger?(Input::B)
      # Play cancel SE
      $game_system.se_play($data_system.cancel_se)
      # End enemy selection
      end_enemy_select
            @active_battler.changed_scope = false     
      @any_target = false
      return
    end
    # If C button was pressed
    if Input.trigger?(Input::C)
      # Play decision SE
      $game_system.se_play($data_system.decision_se)
      # Set action
      @active_battler.current_action.target_index = @enemy_arrow.index
      # End enemy selection
      end_enemy_select
      # If skill window is showing
      if @skill_window != nil
        # End skill selection
        end_skill_select
      end
      # If item window is showing
      if @item_window != nil
        # End item selection
        end_item_select
      end
      # Go to command input for next actor
      start_phase4
    end
  end
  #--------------------------------------------------------------------------
  # * Frame Update (actor command phase : actor selection)
  #--------------------------------------------------------------------------
  def update_phase3_actor_select
    # Update actor arrow
    @actor_arrow.update
        # If this skill/item can target anyone
    if @any_target == true
      # If player pressed the key to change targets
      if Input.trigger?(Input::UP)
        # Play decision SE
        $game_system.se_play($data_system.cursor_se)
        # Initialize actor select, end enemy select
        end_actor_select
        start_enemy_select
        @active_battler.changed_scope = !@active_battler.changed_scope
        # Stop processing
        return
      end
    end
    # If B button was pressed
    if Input.trigger?(Input::B)
      # Play cancel SE
      $game_system.se_play($data_system.cancel_se)
      # End actor selection
      end_actor_select
            @active_battler.changed_scope = false     
      @any_target = false
      return
    end
    # If C button was pressed
    if Input.trigger?(Input::C)
      # Play decision SE
      $game_system.se_play($data_system.decision_se)
      # Set action
      @active_battler.current_action.target_index = @actor_arrow.index
      # End actor selection
      end_actor_select
      # If skill window is showing
      if @skill_window != nil
        # End skill selection
        end_skill_select
      end
      # If item window is showing
      if @item_window != nil
        # End item selection
        end_item_select
      end
      # Go to command input for next actor
      start_phase4
    end
  end
 
end
 

Users Who Are Viewing This Thread (Users: 0, Guests: 1)

Latest Threads

Latest Posts

Latest Profile Posts

People3_5 and People3_8 added!

so hopefully tomorrow i get to go home from the hospital i've been here for 5 days already and it's driving me mad. I miss my family like crazy but at least I get to use my own toiletries and my own clothes. My mom is coming to visit soon i can't wait to see her cause i miss her the most. :kaojoy:
Couple hours of work. Might use in my game as a secret find or something. Not sure. Fancy though no? :D
Holy stink, where have I been? Well, I started my temporary job this week. So less time to spend on game design... :(
Cartoonier cloud cover that better fits the art style, as well as (slightly) improved blending/fading... fading clouds when there are larger patterns is still somewhat abrupt for some reason.

Forum statistics

Threads
105,868
Messages
1,017,090
Members
137,587
Latest member
Usagiis
Top