Today, 01:20 AM
Tactical Input Attacks
Version: 1.0
Version: 1.0
Introduction
Initally, this is a reworked version of Claihm's 'Tactical Skills' script, a script that forced the user to press a proper key combination as a challenge in order to get the full effect of a skill attack, otherwise the power to an attack would be cut in half.
This version now works with both melee attacks with key combinations based on the weapon being used, and the individual skills.
Script
The Script
Code:
#==============================================================================
# Tactical Input Attacks
#------------------------------------------------------------------------------
# by DerVVulfman
# version 1.0
# 2026-08-12 (YYYY-MM-DD)
# RPGMaker XP / RGSS
#------------------------------------------------------------------------------
# based on Tactical Skills Ver.1.4.0 by Claimh
#------------------------------------------------------------------------------
#
# Initally, this is a reworked version of Claihm's 'Tactical Skills' script, a
# script that forced the user to press a proper key combination as a challenge
# in order to get the full effect of a skill attack, otherwise the power to an
# attack would be cut in half.
#
# This version now works with both melee attacks with key combinations based on
# the weapon being used, and the individual skills.
#
# Yes, it is double in size to the original. But it has a larger configuration
# section almost 3x in size to handle most changes and repaire to the original,
# and covers both melee and skill attacks.
#
#------------------------------------------------------------------------------
#
# Current version: Allows both melee attacks and skills in combat to require
# accurate button input in order to deliver the full-powered
# attack and/or skill effects, or else the effective power
# to those actions be cut in half.
#
# The original version only covered skills, and stated that
# some skills could be changed to both All Enemy / All Ally
# skills assuming the skills were accurately performed. Not
# true. However, theis new edition may now convert properly
# executed skills to All Enemy, All Ally and All Ally O-HP
# action scopes.
#
# The All Enemy / All Ally feature does not exist for melee
# attacks as weapon attacks have no such scope without major
# changes.
#
# Certain effects were hard-coded into the original verion,
# these being Failure or Success sound effects, text that
# appeared on success or failure,the input that shows in the
# Tactical bar window, and the bar window itself. As of now,
# much of this can be edited in the already existing config-
# uration section.
#
# Some values and naming conventions have changed since the original.
#
#
#------------------------------------------------------------------------------
#
# REQUIRED GRAPHIC:
#
# You need a bar graphic suitable for the window display. The bar is to be
# of the width of your Tactical window minus 32px (or 16px on each side).
#
# For a standard 160px wide window that hovers over each player, the bar is
# typically 128px x 10px (or so). This can change if using a fixed window.
#
#------------------------------------------------------------------------------
#
# COMPATABILITY:
#
# Designed for RPGMaker XP.
#
#------------------------------------------------------------------------------
#
# TERMS OF USE:
#
# Free for use, even in commercial projects. Credit must be given to Claihm
# and myself.
#
#==============================================================================
module TacticalInput
#----------------------------------------------------------------------------
WEAPON, SKILL = {}, {} # Do Not Touch
#----------------------------------------------------------------------------
# INPUT CONSTANTS (Generally this is DO NOT TOUCH)
# ================================================
# The defined input contants recognized by the Tactical Input system.
#--------------------------------------------------------------------------
# It is advised not to touch unless you have a suitable full-keyboard sys-
# tem employed that functions with this script & you know what you're doing
#--------------------------------------------------------------------------
A = Input::A # Keyboard Input : Z
B = Input::B # Keyboard Input : X
C = Input::C # Keyboard Input : C
X = Input::X # Keyboard Input : A
Y = Input::Y # Keyboard Input : S
Z = Input::Z # Keyboard Input : D
L = Input::L # Keyboard Input : Q
R = Input::R # Keyboard Input : W
UP = Input::UP # Directional Arrow: Up
DOWN = Input::DOWN # Directional Arrow: Down
LEFT = Input::LEFT # Directional Arrow: Left
RIGHT = Input::RIGHT # Directional Arrow: Right
#------------------------------------------------------------------------
# DISPLAYED INPUT KEYS
# ====================
# Here, we define what keys are requested within the Tactical Bar window.
# This is actually editable in the event of different keyboard layouts and
# has two options: Keyboard and Gamepad. This because the button layout of
# gamepads are different than keyboards.
#--------------------------------------------------------------------------
KEY_TYPE_ID = 4 # The RMXP switch that determines if the
# system displays gamepad input keys or
# typical keyboard keys (OFF = keyboard)
#------------------------------------------------------------------------
KEYBOARD_A = "<Shf/Z>" # Both Shift and Z
KEYBOARD_B = "<Cancel>" # Cancel: Esc, X and Numpad 0
KEYBOARD_C = "<Select>" # Select: Enter, Space and C
KEYBOARD_X = "<A>" # A only
KEYBOARD_Y = "<S>" # S only
KEYBOARD_Z = "<D>" # D only
KEYBOARD_L = "<Q>" # Q (Previous Actor)
KEYBOARD_R = "<W>" # L (Next Actor)
#------------------------------------------------------------------------
GAMEPAD_A = "[A]" # Button A
GAMEPAD_B = "[B]" # Button B
GAMEPAD_C = "[X]" # Button X
GAMEPAD_X = "[Y]" # Button Y
GAMEPAD_Y = "[L Btn]" # Left button
GAMEPAD_Z = "[R Btn]" # Right Button
GAMEPAD_L = "[L Tgr]" # Left Trigger
GAMEPAD_R = "[R Tgr]" # Right Trigger
#------------------------------------------------------------------------
SHOW_UP = "<▲>" # Directional Pad Up or Numpad 8
SHOW_DOWN = "<▼>" # Directional Pad Down or Numpad 2
SHOW_LEFT = "<◄>" # Directional Pad Left or Numpad 4
SHOW_RIGHT = "<►>" # Directional Pad Right or Numpad 6
#------------------------------------------------------------------------
# TACTICAL BAR
# ============
# Here, we define the bar that is filled during a tactical attack. It will
# determine the bar graphic used, the direction it renders, and how fast or
# slow it fills. A '1.0' speed rate suggests 1 second per key in the combo.
# But this is also dependent upon the assumed frame rate of your game.
#
# NOTE: The bar does not auto-adjust in size to fit the designed window.
# The default width is 128px, or 32px less than your standard 160px
# actor battle window. The width of your custom bar needs to be 32px
# less in width than your custom window.
#
#--------------------------------------------------------------------------
BAR_NAME = "bar" # Bar filename (in Graphics/Windowskin)
BAR_REVERSE = false # If bar fills right-to-left
BAR_SPEED = 1.0 # Speed rate of bar per key (Default 1.0)
# 0.25 = fastest, 5.0 = slowest
#------------------------------------------------------------------------
# CUSTOMIZED WINDOW
# =================
# Here, you may alter the position and dimensions of the tactical actions
# bar if you opt to have the bar window in a fixed position. Otherwise, the
# bar will float over each actor.
#--------------------------------------------------------------------------
WINDOW_FIXED = false # If true, uses custom position and size
WINDOW_X = 0 # -(CUSTOM ONLY)- X coordinate of window
WINDOW_Y = 0 # -(CUSTOM ONLY)- Y coordinate of window
WINDOW_WIDTH = 640 # -(CUSTOM ONLY)- Width of window
WINDOW_HEIGHT = 80 # -(CUSTOM ONLY)- Height of window
WINDOW_Z_DEPTH = 100 # (ALL USE) Z-Depth of window
WINDOW_OPACITY = 160 # (ALL USE) Window opacity
#------------------------------------------------------------------------
# CUSTOMIZED TEXTS
# ================
# Here, you can alter the left-margin and spacing of the text that appears
# in the tactical window. These would either be the phrases that indicate
# what keys to press, or if you failed and pressed the wrong buttons. Added
# is the ability to set the color of the text in the tactical window, both
# before a key is presse, and after to denote which input keys have.
#--------------------------------------------------------------------------
TEXT_MARGIN = 0 # Distance from left edge (Default: 0)
TEXT_SPACING = 32 # Spacing per key entry (Default: 32)
TEXT_WIDTH = 100 # Alloted space for text (Default: 100)
#------------------------------------------------------------------------
TEXT_CLR_NORMAL = Color.new(255,255,255,255) # Color of un-pressed text
TEXT_CLR_PRESS = Color.new(255, 0, 0,255) # Color of pressed key text
#------------------------------------------------------------------------
# TACTICAL ALERTS
# ===============
# Here, we define the alerts that occur if the player fails at the tactical
# input for a given action, or succeeds upon completion. Though the audio
# settings are optional, the text is not.
#--------------------------------------------------------------------------
MISS_SE = nil # SE to play on failure (in Audio/SE)
MISS_TEXT = "Miss!" # Text to show upon failure
COMPLETE_SE = nil # SE to play on success (in Audio/SE)
COMPLETE_TEXT = "Complete!" # Text to show upon success
#------------------------------------------------------------------------
# ALL-SCOPE SKILLS
# ================
# Here, we define skills that change from delivering a single-target effect
# to one which will affect all applicable targets. A single ally skill will
# become an all-allies skill on success. It doesn't work with either 'none'
# scopes nor 'user' scopes.
#--------------------------------------------------------------------------
ALL_SCOPE = false # If system is engaged (true/false)
ALL_SKILLS = [57, 61] # Array of skill IDs
#------------------------------------------------------------------------
# WEAPON TACTICAL SETTINGS
# ========================
# Weapon ID = [ Fail Reduction in percent, Fail Animation ID, Key Combos]
# Key Combos are based on In-Script Constants
#--------------------------------------------------------------------------
#
# Skill ID Fail Anim Key Combos
# ========= ==== ==== ====================
WEAPON[1] = [ 50, 0, [RIGHT, LEFT, RIGHT] ]
# SKILL TACTICAL SETTINGS
# =======================
# Skill ID = [ Fail Reduction in percent, Fail Animation ID, Key Combos]
# Key Combos are based on In-Script Constants
#--------------------------------------------------------------------------
#
# Skill ID Fail Anim Key Combos
# ========= ==== ==== ====================
SKILL[7] = [ 50, 0, [UP, DOWN] ]
SKILL[8] = [ 50, 0, [X, C, Z] ]
SKILL[9] = [ 50, 0, [DOWN, X, A, B] ]
SKILL[10] = [ 50, 0, [LEFT, UP] ]
SKILL[11] = [ 50, 0, [L, X, R] ]
SKILL[12] = [ 50, 0, [X, C, RIGHT, R] ]
SKILL[13] = [ 50, 0, [UP, RIGHT] ]
SKILL[14] = [ 50, 0, [L, Z, A] ]
SKILL[15] = [ 50, 0, [R, X, X, DOWN] ]
SKILL[16] = [ 50, 0, [DOWN, RIGHT] ]
SKILL[17] = [ 50, 0, [A, B, C] ]
SKILL[18] = [ 50, 0, [Y, X, DOWN, B] ]
SKILL[19] = [ 50, 0, [LEFT, DOWN] ]
SKILL[20] = [ 50, 0, [Z, Y, A] ]
SKILL[21] = [ 50, 0, [B, C, X, L] ]
SKILL[22] = [ 50, 0, [RIGHT, DOWN] ]
SKILL[23] = [ 50, 0, [A, B, R] ]
SKILL[24] = [ 50, 0, [X, Y, LEFT, R] ]
SKILL[25] = [ 50, 0, [LEFT, RIGHT] ]
SKILL[26] = [ 50, 0, [X, L, B] ]
SKILL[27] = [ 50, 0, [LEFT, X, C, Z] ]
SKILL[28] = [ 50, 0, [LEFT, DOWN] ]
SKILL[29] = [ 50, 0, [C, X, A] ]
SKILL[30] = [ 50, 0, [X, Z ,C, UP] ]
SKILL[31] = [ 50, 0, [UP, DOWN, X] ]
SKILL[32] = [ 50, 0, [LEFT, RIGHT, L, R] ]
SKILL[57] = [ 50, 0, [A, C] ]
SKILL[58] = [ 50, 0, [C, X, UP] ]
SKILL[59] = [ 50, 0, [A, UP, RIGHT,A] ]
SKILL[60] = [ 50, 0, [Z, C, A, B] ]
SKILL[61] = [ 50, 0, [X, C] ]
SKILL[62] = [ 50, 0, [UP, X, DOWN] ]
SKILL[63] = [ 50, 0, [LEFT, C, Y, A] ]
SKILL[64] = [ 50, 0, [X, C, Y, A] ]
SKILL[65] = [ 50, 0, [Y, A] ]
SKILL[66] = [ 50, 0, [RIGHT, B, A] ]
SKILL[67] = [ 50, 0, [LEFT, UP, Z, A] ]
SKILL[68] = [ 50, 0, [Y, B, Y, A] ]
SKILL[69] = [ 50, 0, [LEFT, A] ]
SKILL[70] = [ 50, 0, [A, C, A] ]
SKILL[71] = [ 50, 0, [B, B, A, A] ]
SKILL[72] = [ 50, 0, [A, B, X, Y] ]
SKILL[73] = [ 50, 0, [X, A] ]
SKILL[74] = [ 50, 0, [Y, A, B] ]
SKILL[75] = [ 50, 0, [LEFT, RIGHT, Y, A] ]
SKILL[76] = [ 50, 0, [A, C, L, A] ]
SKILL[77] = [ 50, 0, [R, X] ]
SKILL[78] = [ 50, 0, [L, C, R] ]
SKILL[79] = [ 50, 0, [LEFT, L, RIGHT, R] ]
SKILL[80] = [ 50, 0, [C, C, Z, RIGHT] ]
end
#==============================================================================
# ** Input
#------------------------------------------------------------------------------
# A module that handles input data from a gamepad or keyboard.
#==============================================================================
module Input
#--------------------------------------------------------------------------
# * Define below as functional instance methods
#--------------------------------------------------------------------------
module_function
#--------------------------------------------------------------------------
# * Key-in decision other than designated key
#--------------------------------------------------------------------------
def n_trigger?(num)
#
# Exit false if a normal input
return false if trigger?(num)
#
# Exit true if a designated input
return true if n_drigger_desig?
#
# Exit false if no match
return false
#
end
#--------------------------------------------------------------------------
# * Key-in decision other than designated key
#--------------------------------------------------------------------------
def n_drigger_desig?
#
# DERVV Note: Can I get the In-game constants as hash KEYs for testing?
return true if trigger?(A)
return true if trigger?(B)
return true if trigger?(C)
return true if trigger?(X)
return true if trigger?(Y)
return true if trigger?(Z)
return true if trigger?(L)
return true if trigger?(R)
return true if trigger?(UP)
return true if trigger?(DOWN)
return true if trigger?(RIGHT)
return true if trigger?(LEFT)
#
return false
#
end
#--------------------------------------------------------------------------
# * Key transformation table (for characters on screen acquisition)
#--------------------------------------------------------------------------
def key_converter(key)
#
# Get if controller is gamepad (IF ON)
type = $game_switches[TacticalInput::KEY_TYPE_ID]
#
if type
# Branch on Gamepad input
case key
when A ; return TacticalInput::GAMEPAD_A
when B ; return TacticalInput::GAMEPAD_B
when C ; return TacticalInput::GAMEPAD_C
when X ; return TacticalInput::GAMEPAD_X
when Y ; return TacticalInput::GAMEPAD_Y
when Z ; return TacticalInput::GAMEPAD_Z
when L ; return TacticalInput::GAMEPAD_L
when R ; return TacticalInput::GAMEPAD_R
end
else
# Branch on keyboard input
case key
when A ; return TacticalInput::KEYBOARD_A
when B ; return TacticalInput::KEYBOARD_B
when C ; return TacticalInput::KEYBOARD_C
when X ; return TacticalInput::KEYBOARD_X
when Y ; return TacticalInput::KEYBOARD_Y
when Z ; return TacticalInput::KEYBOARD_Z
when L ; return TacticalInput::KEYBOARD_L
when R ; return TacticalInput::KEYBOARD_R
end
end
# Directional control
case key
when UP ; return TacticalInput::SHOW_UP
when DOWN ; return TacticalInput::SHOW_DOWN
when LEFT ; return TacticalInput::SHOW_LEFT
when RIGHT ; return TacticalInput::SHOW_RIGHT
end
#
end
end
#==============================================================================
# ** Game_Battler
#------------------------------------------------------------------------------
# This class deals with battlers. It's used as a superclass for the Game_Actor
# and Game_Enemy classes.
#==============================================================================
class Game_Battler
#--------------------------------------------------------------------------
# * Public Instance Variables
#--------------------------------------------------------------------------
attr_accessor :tact_flag # Tactical Multi-Key Attack Flag
#--------------------------------------------------------------------------
# * Alias Listings
#--------------------------------------------------------------------------
alias initialize_tactical initialize
alias attack_effect_tactical attack_effect
alias skill_effect_tactical skill_effect
#--------------------------------------------------------------------------
# * Object Initialization
#--------------------------------------------------------------------------
def initialize
#
initialize_tactical # Run the original method
@tact_flag = false # Set Tactical Flag OFF
#
end
#--------------------------------------------------------------------------
# * Applying Normal Attack Effects
# attacker : battler
#--------------------------------------------------------------------------
def attack_effect(attacker)
#
atkr = attacker # Get Attacker (short)
id = atkr.weapon_id # Get ID of Weapon
#
# Reduce weapon attack upon tactical miss
if $scene.is_a?(Scene_Battle) # If in battle
if attacker.tact_flag # If Tact Miss ON
weap_copy = $data_weapons[id].dup # Get backup of weapon
atk = $data_weapons[id].atk # Get weapon ATK score
power_mult = TacticalInput::WEAPON[id][0] # Get Config adjustment
atk = atk * power_mult / 100 # Adjust atk by strike
$data_weapons[id].atk = atk # Alter weapon atk itself
end
end
#
ret = attack_effect_tactical(atkr) # Get original return
#
# Restore weapon attack
if $scene.is_a?(Scene_Battle) # If in battle
if attacker.tact_flag # If Tact Miss ON
atkr.tact_flag = false # Set Tactical Flag OFF
$data_weapons[id] = weap_copy.dup # Restore weapon w backup
end
end
#
return ret # Exit method w return
#
end
#--------------------------------------------------------------------------
# * Apply Skill Effects
# user : the one using skills (battler)
# skill : skill
#--------------------------------------------------------------------------
def skill_effect(user, skill)
#
id = skill.id # Get ID of Skill
#
# Reduce skill powe upon tactical miss
if $scene.is_a?(Scene_Battle) # If in battle
if user.tact_flag # If Tact Miss ON
skill_copy = $data_skills[id].dup # Get backup of skill
power_mult = TacticalInput::SKILL[id][0] # Get Config adjustment
skill.power = skill.power * power_mult / 100 # Adjust power by strike
skill.hit = 0 if skill.power == 0 # Remove hit if no power
end
end
#
ret = skill_effect_tactical(user, skill) # Get original return
#
# Restore skill power
if $scene.is_a?(Scene_Battle) # If in battle
if user.tact_flag # If Tact Miss ON
user.tact_flag = false # Set Tactical Flag OFF
$data_skills[id] = skill_copy.dup # Restore skill w backup
end
end
#
return ret # Exit method w return
#
end
end
#==============================================================================
# ** Window_Base
#==============================================================================
class Window_Base < Window
#--------------------------------------------------------------------------
# * Draw Tactical Input Bar
# x : window x-coordinate
# y : window y-coordinate
# current : Progress ratio (%)
#--------------------------------------------------------------------------
def draw_tactical_input_bar(x, y, current)
#
filename = TacticalInput::BAR_NAME
bitmap = RPG::Cache.windowskin(filename)
cw = bitmap.width * current / 100
ch = bitmap.height
src_rect = Rect.new(0, 0, cw, ch)
self.contents.blt(x, y, bitmap, src_rect)
#
end
end
#==============================================================================
# ** Window_TactTextDisplay
#------------------------------------------------------------------------------
# The window which indicates the key which it inputs.
#==============================================================================
class Window_TactTextDisplay < Window_Base
#--------------------------------------------------------------------------
# * Object Initialization
# key : key combo for action defined
#--------------------------------------------------------------------------
def initialize(key)
#
x = 0 # Default X coordinate
y = 220 # Default Y coordinate
z = 0 # Default Z-depth
w = 150 # Default width
h = 80 # Default height
if TacticalInput::WINDOW_FIXED # If window is fixed
x = TacticalInput::WINDOW_X # Custom X coordinate
y = TacticalInput::WINDOW_Y # Custom Y coordinate
z = TacticalInput::WINDOW_Z_DEPTH # Custom Z-depth
w = TacticalInput::WINDOW_WIDTH # Custom width
h = TacticalInput::WINDOW_HEIGHT # Custom height
end
#
super(x, y, w, h) # Use superclass to create
w = width - 32 # Calc drawing area width
h = height - 32 # Calc drawing area height
@width = width
self.contents = Bitmap.new(w, h) # Set drawing content area
self.opacity = TacticalInput::WINDOW_OPACITY # Set the window opacity
self.z = TacticalInput::WINDOW_Z_DEPTH # Set the window Z-Depth
@key = key # Set key combo @instance
@key_count = 0 # Clear the counter
refresh # Refresh
#
end
#--------------------------------------------------------------------------
# * Refresh
#--------------------------------------------------------------------------
def refresh
#
margin = TacticalInput::TEXT_MARGIN # Get text left margin
spacing = TacticalInput::TEXT_SPACING # Get spacing per key
width = TacticalInput::TEXT_WIDTH # Get text max width
#
self.contents.clear # Clear the window
#
for i in 0...@key.size # Loop keys in combo
#
x = margin + (i * spacing) # Set x-coord spaced apart
# - - - - - - - - - - - - - - - - - - - - - - -
if i < @key_count # If key appears pressed
clr = TacticalInput::TEXT_CLR_PRESS # Get press/success color
else # -- otherwise --
clr = TacticalInput::TEXT_CLR_NORMAL # Get normal color
end
self.contents.font.color = clr # Set text color
# - - - - - - - - - - - - - - - - - - - - - - -
text = Input.key_converter(@key[i]) # Get text for the key
self.contents.draw_text(x, 0, width, 32, text) # Draw key text in place
end
#
end
#--------------------------------------------------------------------------
# * Register the number of player input presses (called from Scene_Battle)
#--------------------------------------------------------------------------
def key_in
#
@key_count += 1 # Increase count by 1
refresh # Refresh
#
end
#--------------------------------------------------------------------------
# * Set text to content given (called from Scene_Battle)
# text : text
#--------------------------------------------------------------------------
def text_in(text)
#
x = TacticalInput::TEXT_MARGIN # Get text left margin
spacing = TacticalInput::TEXT_SPACING # Get spacing per key
width = TacticalInput::TEXT_WIDTH # Get text max width
#
self.contents.clear # Clear the window
self.contents.draw_text(x, 0, width, 32, text, 1) # Draw text centered
#
end
end
#==============================================================================
# ** Window_TactBarDisplay
#------------------------------------------------------------------------------
# This window draws the actual progress bar. The window itself is transparent
# and drawn atop the window displaying the necessary player input.
#==============================================================================
class Window_TactBarDisplay < Window_Base
#--------------------------------------------------------------------------
# * Object Initialization
#--------------------------------------------------------------------------
def initialize
#
x = 0 # Default X coordinate
y = 256 # Default Y coordinate
w = 150 # Default width
h = 80 # Default height
if TacticalInput::WINDOW_FIXED # If window is fixed
x = TacticalInput::WINDOW_X # Custom X coordinate
y = TacticalInput::WINDOW_Y + 36 # Custom Y coordinate
w = TacticalInput::WINDOW_WIDTH # Custom width
h = TacticalInput::WINDOW_HEIGHT # Custom height
end
#
super(x, y, w, h) # Use superclass to create
w = width - 32 # Calc drawing area width
h = height - 32 # Calc drawing area height
self.contents = Bitmap.new(w, h) # Set drawing content area
self.opacity = 0 # Set fully transparent
self.z = TacticalInput::WINDOW_Z_DEPTH + 1 # Set Z-Depth
refresh(0) # Refresh start position
#
end
#--------------------------------------------------------------------------
# * Refresh
# current : Progress ratio (%)
#--------------------------------------------------------------------------
def refresh(current)
#
self.contents.clear # Clear the drawing area
if TacticalInput::BAR_REVERSE # If reversing the bar
draw_tactical_input_bar(0, 0, 100-current) # Bar draws right-to-left
return # Exit method
end
draw_tactical_input_bar(0, 0, current) # Draw bar left-to-right
#
end
end
#==============================================================================
# ** Scene_Battle
#------------------------------------------------------------------------------
# This class performs battle screen processing.
#==============================================================================
class Scene_Battle
#--------------------------------------------------------------------------
# * Alias Listings
#--------------------------------------------------------------------------
alias update_phase4_step2_tactical update_phase4_step2
alias make_basic_action_result_tactical make_basic_action_result
alias make_skill_action_result_tactical make_skill_action_result
#--------------------------------------------------------------------------
# * Frame Update (main phase step 2 : start action)
#--------------------------------------------------------------------------
def update_phase4_step2
#
update_phase4_step2_tactical # Run the original method
#
@active_battler.tact_flag = false # Set Tactical Flag OFF
@tact_skill_ok = false # All-Targets flag OFF
@miss_flag = false # Set Miss Tactical OFF
#
end
#--------------------------------------------------------------------------
# * Make Basic Action Results
#--------------------------------------------------------------------------
def make_basic_action_result
#
w_id = @active_battler.weapon_id # Get weapon ID
#
# Process Tactical Input for actor if exists
if @active_battler.is_a?(Game_Actor) # If attacker is an actor
if TacticalInput::WEAPON.has_key?(w_id) # If Tactical Skill exists
make_tactical_weapon_result # Run Tactic Input Method
end
end
#
make_basic_action_result_tactical # Run the Original Method
#
if @miss_flag # If a tactical miss
@miss_flag = false # Turn miss flag OFF
unless TacticalInput::WEAPON[w_id][1].nil? # If a valid anim ID
id = TacticalInput::WEAPON[w_id][1] # Get animation ID
@animation2_id = id # Apply as target anim
end
end
#
end
#--------------------------------------------------------------------------
# * Make Skill Action Results
#--------------------------------------------------------------------------
def make_skill_action_result
#
s_id = @active_battler.current_action.skill_id # Get Skill ID
@skill = $data_skills[s_id] # Get Skill
#
# Mirror of original first statement block
unless @active_battler.current_action.forcing # If not a forcing action
unless @active_battler.skill_can_use?(s_id) # If unable to use skill
$game_temp.forcing_battler = nil # Clear forced to action
@phase4_step = 1 # Shift to step 1
return # And exit method
end
end
#
# Process Tactical Input for actor if exists
if @active_battler.is_a?(Game_Actor) # If attacker is an actor
if TacticalInput::SKILL.has_key?(s_id) # If Tactical Skill exists
make_tactical_skill_result # Run Tactic Input Method
end
end
#
# Process All-Range Skill option
if TacticalInput::ALL_SCOPE # If All Attack is ON
if @tact_skill_ok # If All-Targets flagged
if @skill.scope !- 0 && @skill.scope != 7 # If valid target range
if TacticalInput::ALL_SKILLS.include?(s_id) # If an All-Attack defined
skill_copy = @skill.dup # Make backup of skill
case @skill.scope # Base on current scope
when 1 ; @skill.scope = 2 # 1 enemy to all enemies
when 3 ; @skill.scope = 4 # 1 ally to all allies
when 5 ; @skill.scope = 6 # 1 0-hp to all 0-hp
end
end
end
end
end
#
make_skill_action_result_tactical # Run the Original Method
#
if TacticalInput::ALL_SCOPE # If All Attack is ON
if @tact_skill_ok # If All-Targets flag ON
if TacticalInput::ALL_SKILLS.include?(s_id) # If an All-Attack defined
@tact_skill_ok = false # Turn All-Targets OFF
@skill = skill_copy.dup # Restore from backup
$data_skills[s_id] = skill_copy.dup # Restore from backup
end
end
end
#
if @miss_flag # If a tactical miss
@miss_flag = false # Turn miss flag OFF
unless TacticalInput::SKILL[s_id][1].nil? # If a valid anim ID
id = TacticalInput::SKILL[s_id][1] # Get animation ID
@animation2_id = id # Apply as target anim
end
end
#
end
#--------------------------------------------------------------------------
# * Make Tactical Input Basic Results
#--------------------------------------------------------------------------
def make_tactical_weapon_result
#
w_id = @active_battler.weapon_id # Get Skill ID
#
tact_weaps = TacticalInput::WEAPON[w_id][2] # Get key combo for skill
rate = make_tactical_rate # Get speed rate setting
time = make_tactical_time(tact_weaps, rate # Get total elapsed time
key_count = 0 # Reset key loop counter
#
@active_battler.tact_flag = true # Set Tactical Flag ON
#
win_tacttext = Window_TactTextDisplay.new(tact_weaps) # Make Text window
win_tactbar = Window_TactBarDisplay.new # Make bar window
make_tactical_position(win_tacttext,win_tactbar) # Set windows in position
#
# Perform Tacical loop
for i in 0...time # Loop through set time
#
# Test input and break on failure
if Input.trigger?(tact_weaps[key_count]) # On successful key input
key_count += 1 # Increase key count by 1
win_tacttext.key_in # Register key press count
#
elsif Input.n_trigger?(tact_weaps[key_count]) # On incorrect key input
make_tactical_fail # Perform Fail effects
break # And Exit loop (Failed!)
end
#
# Completion of all the key-in
if key_count >= tact_weaps.size # If all combo keys used
text = TacticalInput::COMPLETE_TEXT # Get Complete message
win_tacttext.text_in(text) # Set Complete message
se_filename = TacticalInput::COMPLETE_SE # Get Complete SE filename
unless se_filename.nil? # If a valid SE
Audio.se_play("Audio/SE/" + se_filename) # Play Complete SE
end
@active_battler.tact_flag = false # Set Tactical Flag OFF
break # Exit Loop -all keys used
end
#
make_tactical_progress(win_tactbar, i, time)
#
end
#
miss_tactical_result(win_tacttext,win_tactbar) # Perform miss and exit
#
end
#--------------------------------------------------------------------------
# * Make Tactical Input Skill Results
#--------------------------------------------------------------------------
def make_tactical_skill_result
#
s_id = @active_battler.current_action.skill_id # Get Skill ID
#
tact_skill = TacticalInput::SKILL[s_id][2] # Get key combo for skill
rate = make_tactical_rate # Get speed rate setting
time = make_tactical_time(tact_skill, rate)# Get total elapsed time
key_count = 0 # Reset key loop counter
#
@active_battler.tact_flag = true # Set Tactical Flag ON
#
win_tacttext = Window_TactTextDisplay.new(tact_skill) # Make Text window
win_tactbar = Window_TactBarDisplay.new # Make bar window
make_tactical_position(win_tacttext,win_tactbar) # Set windows in position
#
# Perform Tacical loop
for i in 0...time # Loop through set time
#
# Test input and break on failure
if Input.trigger?(tact_skill[key_count]) # On successful key input
key_count += 1 # Increase key count by 1
win_tacttext.key_in # Register key press count
#
elsif Input.n_trigger?(tact_skill[key_count]) # On incorrect key input
make_tactical_fail # Perform Fail effects
break # And Exit loop (Failed!)
end
#
# Completion of all the key-in
if key_count >= tact_skill.size # If all combo keys used
text = TacticalInput::COMPLETE_TEXT # Get Complete message
win_tacttext.text_in(text) # Set Complete message
se_filename = TacticalInput::COMPLETE_SE # Get Complete SE filename
unless se_filename.nil? # If a valid SE
Audio.se_play("Audio/SE/" + se_filename) # Play Complete SE
end
@active_battler.tact_flag = false # Set Tactical Flag OFF
if TacticalInput::ALL_SCOPE # If all-range attack ON
@tact_skill_ok = true # Set All-targets flag ON
end
break # Exit Loop -all keys used
end
#
make_tactical_progress(win_tactbar, i, time) # Update the tactical bar
#
end
#
miss_tactical_result(win_tacttext,win_tactbar) # Perform miss and exit
#
end
#--------------------------------------------------------------------------
# * Get speed adjustment and keep in range
#--------------------------------------------------------------------------
def make_tactical_rate
#
tact_rate = TacticalInput::BAR_SPEED # Get speed for key input
tact_rate = 0.25 if tact_rate < 0.25 # Keep within ranges
tact_rate = 5.0 if tact_rate > 5.0
return tact_rate # Exit with speed/rate
#
end
#--------------------------------------------------------------------------
# * Calculate time spent for tactical input
# tact_keys : total keys used for tactical action
# tact_rate : Increase decrease speed rate
#--------------------------------------------------------------------------
def make_tactical_time(tact_keys, tact_rate)
#
tact_size = tact_keys.size # Get number of keye
tact_time = tact_size * Graphics.frame_rate # Set duration for keys
time = tact_rate * tact_time # Set time for key loop
#
end
#--------------------------------------------------------------------------
# * Position Tactical Windows
# win_tacttext : tactical text window
# win_tactbar : tactical bar window
#--------------------------------------------------------------------------
def make_tactical_position(win_tacttext, win_tactbar)
#
# BELOW ARE INSTRUCTIONS FROM CLAIHM - EXPANDED UPON
# --------------------------------------------------
# Remove the hashtags(#) in the block of code below if also employing the
# "Battle Position Adjustment" script by Claihm.
#------------------------------------------------------------------------
#
# - - - - - - - - - - - - - - - - - - - - - - - -
#case $game_party.actors.size
#when 1
# actor_x = 240
#when 2
# actor_x = @active_battler.index * 240 + 120
#when 3
# actor_x = @active_battler.index * 200 + 40
#when 4
actor_x = @active_battler.index * 160 # Default X position
#end
# - - - - - - - - - - - - - - - - - - - - - - - -
#
unless TacticalInput::WINDOW_FIXED # If window is not fixed
win_tacttext.x = win_tactbar.x = actor_x # Set to float above actor
end
#
end
#--------------------------------------------------------------------------
# * Make Tactical Fail effect
#--------------------------------------------------------------------------
def make_tactical_fail
#
@miss_flag = true # Set MISS key flag
se_filename = TacticalInput::MISS_SE # Get Miss SE filename
unless se_filename.nil? # If a valid SE
Audio.se_play("Audio/SE/" + se_filename) # Play Miss SE
end
#
end
#--------------------------------------------------------------------------
# * Perform Tactical Progress of the Bar
# win_tactbar : tactical bar window
# i : current time index
# time : alloted time for all keys
#--------------------------------------------------------------------------
def make_tactical_progress(win_tactbar, i, time)
#
win_tactbar.refresh((i*100/time).truncate) # Update the progress bar
Graphics.update # Update game screen
Input.update # Update input information
#
end
#--------------------------------------------------------------------------
# * Perform Tactical Result Miss
# win_tacttext : tactical text window
# win_tactbar : tactical bar window
#--------------------------------------------------------------------------
def miss_tactical_result(win_tacttext, win_tactbar)
#
# It did not input at all = mistake
if @active_battler.tact_flag # Tactical flag still ON ?
text = TacticalInput::MISS_TEXT # Get miss message
win_tacttext.text_in(text) # Set miss message
end
for i in 0...10 # Wait 10 frames for Miss
Graphics.update # Update game screen
@spriteset.update # Update sprite set
end
#
win_tacttext.dispose # Remove counter window
win_tactbar.dispose # Remove bar window
#
end
endInstructions
The script has a large configuration section with plenty of instructions all around.
You need a bar graphic suitable for the window display. The bar is to be of the width of your Tactical window minus 32px (or 16px on each side).
For a standard 160px wide window that hovers over each player, the bar is typically 128px x 10px (or so). This can change if using a fixed window.
Compatibility
Designed for RPGMaker XP.
Terms and Conditions
Free for use, even in commercial projects. Credit must be given to Claihm and myself.
Up is down, left is right and sideways is straight ahead. - Cord "Circle of Iron", 1978 (written by Bruce Lee and James Coburn... really...)
Above are clickable links

![[Image: QrnbKlx.jpg]](https://i.imgur.com/QrnbKlx.jpg)
![[Image: sGz1ErF.png]](https://i.imgur.com/sGz1ErF.png)
![[Image: liM4ikn.png]](https://i.imgur.com/liM4ikn.png)
![[Image: fdzKgZA.png]](https://i.imgur.com/fdzKgZA.png)
![[Image: sj0H81z.png]](https://i.imgur.com/sj0H81z.png)
![[Image: QL7oRau.png]](https://i.imgur.com/QL7oRau.png)
![[Image: uSqjY09.png]](https://i.imgur.com/uSqjY09.png)
![[Image: GAA3qE9.png]](https://i.imgur.com/GAA3qE9.png)
![[Image: 2Hmnx1G.png]](https://i.imgur.com/2Hmnx1G.png)
![[Image: BwtNdKw.png%5B]](https://i.imgur.com/BwtNdKw.png%5B)