Envision, Create, Share

Welcome to HBGames, a leading amateur game development forum and Discord server. All are welcome, and amongst our ranks you will find experts in their field from all aspects of video game design and development.

[VX] Blitz

Blitz
by Dargor
Version 1.1


Introduction

I originally made this script for my Final Fantasy VI SDK and I felt like I had to to it for VX.
"Blitz" is a battle command also called "Deathblows" in FF6J. You guessed it, It requires my Custom Commands script!

How does it works? When selecting the Blitz command, you must Input a series of keys, like UP-Down-Up-L-R, to cast a skill.
Obviously, the actor must have learned the skill before casting it and the input must be right.
No Timing is required but if the input is wrong, nothing will happen and the actor will lose it's turn.

Script

Code:
#==============================================================================

# ** Blitz

#------------------------------------------------------------------------------

#  © Dargor, 2008

#  08/06/08

#  Version 1.1

#------------------------------------------------------------------------------

#  VERSION HISTORY:

#   - 1.0 (27/05/08), Initial release

#   - 1.1 (08/06/08), Updated to work with Custom Commands 1.5+

#------------------------------------------------------------------------------

#  INSTRUCTIONS:

#   - Paste this above main

#   - Edit the constants in Blitz module  

#------------------------------------------------------------------------------

#  INPUT KEYS:

#     12 keys are available. Here's the list of the 12 different keys

#     with their code.

#       - DOWN:         '2'

#       - LEFT:         '4'

#       - RIGHT:        '6'

#       - UP:           '8'

#       - DOWN-LEFT:    '1'

#       - UP-LEFT:      '3'

#       - UP-RIGHT:     '7'

#       - DOWN-RIGHT:   '9'

#       - PageUP(L):    'L'

#       - PageDOWN(R):  'R'

#       - SHIFT(A):     'A'

#       - X(X):         'X'

#==============================================================================

 

# Command name

Vocab::CommandBlitz = 'Blitz'

Vocab::IncorrectBlitz = 'Incorrect Blitz input!'

 

#==============================================================================

# ** Blitz Customization Module

#==============================================================================

 

module Blitz

  # Inputs Code

  # SYNTAX: Skill_ID => [CODE]

  Inputs = {

            75 => ['4','6','4'],

            76 => ['2','1','4'],

            77 => ['L','R','2','8'],

            78 => ['4','1','2','3','6'],

            79 => ['R','L','R','L','A','X'],

            80 => ['8','9','6','3','2','1','4'],

            81 => ['R','L','A','X','6','4'],

            82 => ['4','7','8','9','6','3','2','1','4',]

           }

  Actors = [1,2]

end

 

#==============================================================================

# ** Game_Actor

#------------------------------------------------------------------------------

#  This class handles actors. It's used within the Game_Actors class

# ($game_actors) and referenced by the Game_Party class ($game_party).

#==============================================================================

 

class Game_Actor < Game_Battler

  #--------------------------------------------------------------------------

  # * Alias Listing

  #--------------------------------------------------------------------------

  alias dargor_vx_blitz_actor_setup setup

  #--------------------------------------------------------------------------

  # * Setup

  #     actor_id : actor ID

  #--------------------------------------------------------------------------

  def setup(actor_id)

    dargor_vx_blitz_actor_setup(actor_id)

    # Add battle commands

    if Blitz::Actors.include?(@actor_id)

      # Add 'Burst' to actor 1

      add_command(0, self.class.command_name(Vocab::CommandBlitz))

    end

  end

end

 

#==============================================================================

# ** Game_BattleAction

#------------------------------------------------------------------------------

#  This class handles battle actions. This class is used within the

# Game_Battler class.

#==============================================================================

 

class Game_BattleAction

  #--------------------------------------------------------------------------

  # * Alias Listing

  #--------------------------------------------------------------------------

  alias dargor_vx_blitz_action_clear clear

  #--------------------------------------------------------------------------

  # * Clear

  #--------------------------------------------------------------------------

  def clear

    dargor_vx_blitz_action_clear

    @blitz = false

    @incorrect_blitz = false

  end

  #--------------------------------------------------------------------------

  # * Set Blitz

  #     skill_id : skill ID

  #--------------------------------------------------------------------------

  def set_blitz(skill_id)

    @kind = 1

    @skill_id = skill_id

    @blitz = true

    @incorrect_blitz = false

  end

  #--------------------------------------------------------------------------

  # * Set Blitz

  #     skill_id : skill ID

  #--------------------------------------------------------------------------

  def set_incorrect_blitz(skill_id)

    set_blitz(skill_id)

    @incorrect_blitz = true

  end

  #--------------------------------------------------------------------------

  # * Blitz Determination

  #--------------------------------------------------------------------------

  def blitz?

    return @kind == 1 && @blitz

  end

  #--------------------------------------------------------------------------

  # * Incorrect Blitz Determination

  #--------------------------------------------------------------------------

  def incorrect_blitz?

    return @kind == 1 && @blitz && @incorrect_blitz

  end

end

 

#==============================================================================

# ** Scene_Battle

#------------------------------------------------------------------------------

#  This class performs battle screen processing.

#==============================================================================

 

class Scene_Battle < Scene_Base

  #--------------------------------------------------------------------------

  # * Alias Listing

  #--------------------------------------------------------------------------

  alias dargor_vx_blitz_update_actor_command_selection update_actor_command_selection

  alias dargor_vx_blitz_update update

  alias dargor_vx_blitz_execute_action_skill execute_action_skill

  #--------------------------------------------------------------------------

  # * Update Actor Command Selection

  #--------------------------------------------------------------------------

  def update_actor_command_selection

    dargor_vx_blitz_update_actor_command_selection

    if Input.trigger?(Input::C)

      case @actor_command_window.commands[@actor_command_window.index]

      when @active_battler.class.command_name(Vocab::CommandBlitz)

        Sound.play_decision

        start_blitz_selection

      end

    end

  end

  #--------------------------------------------------------------------------

  # * Frame Update

  #--------------------------------------------------------------------------

  def update

    if @blitz_window.nil?

      dargor_vx_blitz_update

    else

      super

      update_basic(true)

      update_info_viewport                  # Update information viewport

      if $game_message.visible

        @info_viewport.visible = false

        @message_window.visible = true

      end

      unless $game_message.visible          # Unless displaying a message

        return if judge_win_loss            # Determine win/loss results

        update_scene_change

        if @blitz_window.active

          update_blitz_selection            # Select party changer command

        end

      end

    end

  end

  #--------------------------------------------------------------------------

  # * Start Blits Selection

  #--------------------------------------------------------------------------

  def start_blitz_selection

    @input = []

    @actor_command_window.active = false

    @help_window = Window_Help.new

    @help_window.set_text('Blitz Input...',1)

    @help_window.pause = true

    @blitz_window = Window_Command.new(128,[''],1,1)

    @blitz_window.visible = false

    @blitz_window.active = true

  end 

  #--------------------------------------------------------------------------

  # * Update Blitz Selection

  #--------------------------------------------------------------------------

  def update_blitz_selection

    @help_window.update

    if Input.trigger?(Input::B)

      Sound.play_cancel

      end_blitz_selection

      return

    end

    if Input.trigger?(Input::C)

      Sound.play_decision

      if Blitz::Inputs.has_value?(@input)

        skill_id = Blitz::Inputs.index(@input)

        if @active_battler.skill_learn?($data_skills[skill_id])

          @active_battler.action.set_blitz(skill_id)

          @active_battler.action.forcing = true

        else

          @active_battler.action.set_incorrect_blitz(1)

          @active_battler.action.forcing = true

        end

      else

        @active_battler.action.set_incorrect_blitz(1)

        @active_battler.action.forcing = true

      end

      end_blitz_selection

      next_actor

      return

    end

    update_blitz_input

  end

  #--------------------------------------------------------------------------

  # * End Blitz Selection

  #--------------------------------------------------------------------------

  def end_blitz_selection

    @blitz_window.dispose

    @blitz_window = nil

    @help_window.dispose

    @help_window = nil

    @input = []

  end

  #--------------------------------------------------------------------------

  # * Update Blitz Input

  #--------------------------------------------------------------------------

  def update_blitz_input

    return if @input.nil?

    case Input.dir8

    when 1,2,3,4,6,7,8,9

      unless @input[@input.size-1] == "#{Input.dir8}"

        Sound.play_cursor

        @input << "#{Input.dir8}" 

      end

    end

    if Input.trigger?(Input::X) or Input.press?(Input::X)

      unless @input[@input.size-1] == 'X'

        Sound.play_cursor

        @input << 'X'

      end

    end

    if Input.trigger?(Input::A) or Input.press?(Input::A)

      unless @input[@input.size-1] == 'A'

        Sound.play_cursor

        @input << 'A' 

      end

    end

    if Input.trigger?(Input::L) or Input.press?(Input::L)

      unless @input[@input.size-1] == 'L'

        Sound.play_cursor

        @input << 'L' 

      end

    end

    if Input.trigger?(Input::R) or Input.press?(Input::R)

      unless @input[@input.size-1] == 'R'

        Sound.play_cursor

        @input << 'R'

      end

    end

  end

  #--------------------------------------------------------------------------

  # * Execute Battle Action: Skill

  #--------------------------------------------------------------------------

  def execute_action_skill

    if @active_battler.action.incorrect_blitz?

      text = Vocab::IncorrectBlitz

      wait(10)

      @message_window.add_instant_text(text)

      wait(60)

      return

    else

      dargor_vx_blitz_execute_action_skill

    end

  end

end

 
Note
If a key is not working, try changing it by pressing F1 while in game, in the Keyboard tab.
Don't forget to credit me!
[/code]
 
Awesome script! Is there a way to make it so the command can't be used at first, i.e. an event needs to happen before you can use the Blitz command?
 
@Krobelus
Thanks, I'm glad you like it :)

@Ryuxaki
Sure. First of all, you need an event at the beginning of your game to remove the command.
Use a script call with this line of code
$game_actors[actor_id].remove_command(Vocab::CommandBlitz)
Then, when you want to add the command, use another script call with this line of code
$game_actors[actor_id].add_command(command_index, Vocab::CommandBlitz)
actor_id is the ID of the actor
command_index is the position of the command in the command window (between 0 and whatever you want)
 
I'm getting the same problem as Mirku, and this is the only script I currently have in my VX. The error occurs when I try to start my game, and I haven't changed anything about the script or the game aside from adding skill #94 so that I can test it.
 
Dargor":1nvh4qwm said:
I originally made this script for my Final Fantasy VI SDK and I felt like I had to to it for VX.
"Blitz" is a battle command also called "Deathblows" in FF6J. You guessed it, It requires my Custom Commands script!

It's because you don't have the Custom Commands script :thumb:
 
This may be necro posting but I was wondering if it was possible to use the custom command built into RMVX to display the name of the Blitz command... Like if you were a Paladin your blitz command would read: "Holy", a Hunter: "Hunt" ect. Is this possible?

I have sorta been play around with ...

Code:
actor.class.skill_name

...but cant seem to get things to work.
 
You're not necro posting at all. :thumb:
Right now, you can only have one command name but I can tweak it so it's different depending on the class.
 
I have updated the script. Now you also need the new version (1.5) of the custom commands script to be able to create substitutes of the Blitz command.
 
Sorry it took me so long to respond. The text is replaced just fine when i use...

Code:
Vocab::CommandBlitz

however, when I select the blitz command during the battle menu nothing happens. I doesn't prompt me to input the blitz combination. Also, I noticed that when you don't succeed in completing a blitz or you execute a blitz that by default Dual Attack is used. Is this intentional? I never noticed it before...
 

Thank you for viewing

HBGames is a leading amateur video game development forum and Discord server open to all ability levels. Feel free to have a nosey around!

Discord

Join our growing and active Discord server to discuss all aspects of game making in a relaxed environment. Join Us

Content

  • Our Games
  • Games in Development
  • Emoji by Twemoji.
    Top