Chaos Project

RPG Maker => RPG Maker Scripts => RMXP Script Database => Topic started by: Blizzard on November 25, 2009, 09:39:34 am

Title: [XP] Rapid Fire for Blizz-ABS
Post by: Blizzard on November 25, 2009, 09:39:34 am
Rapid Fire for Blizz-ABS
Authors: Blizzard
Version: 1.0
Type: Blizz-ABS plugin
Key Term: Blizz-ABS Plugin



Introduction

This script will add will allow to use repeated actions (attacks, skills and items) by just holding the assigned action button rather than pressing it repeatedly.

This script is to be distributed under the same terms and conditions like the script it was created for: Blizz-ABS.


Features




Screenshots

N/A for this sort of script.


Demo

N/A


Script

Just make a new script above main and paste this code into it.
Spoiler: ShowHide
#:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=
# Rapid Fire for Blizz-ABS by Blizzard
# Version: 1.0
# Type: Blizz-ABS Add-on
# Date: 25.11.2009
#:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=
#
#  This script is to be distributed under the same terms and conditions like
#  the script it was created for: Blizz-ABS.
#
#:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=
#
# Information:
#
#   This script must be placed below Blizz-ABS and requires Blizz-ABS v2.6 or
#   higher to work properly. It will allow to use repeated actions (attacks,
#   skills and items) by just holding the assigned action button rather than
#   pressing it repeatedly.
#
#
# If you find any bugs, please report them here:
# http://forum.chaos-project.com
#:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=

if !$BlizzABS || BlizzABS::VERSION < 2.6
  raise 'ERROR: The "Rapid Fire" plugin requires Blizz-ABS 2.6 or higher.'
end

module BlizzCFG

#::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::
# START Configuration
#::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::
 
  # add any weapon IDs of rapid action weapons
  RAPID_WEAPONS = [1, 2, 3]
  # add any skill IDs of rapid action skills
  RAPID_SKILLS = [4, 5, 6]
  # add any item IDs of rapid action items
  RAPID_ITEMS = [7, 8, 9]

#::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::
# END Configuration
#::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::

end

#==============================================================================
# BlizzABS::Controls
#==============================================================================

class BlizzABS::Controls
 
  alias check_attack_condition_rapidfire? check_attack_condition?
  def check_attack_condition?
    if BlizzCFG::RAPID_WEAPONS.include?($game_player.battler.weapon_id)
      return ($game_system.attack_button && Input.press?(Input::Attack))
    end
    return check_attack_condition_rapidfire?
  end
 
  alias check_skill_condition_rapidfire? check_skill_condition?
  def check_skill_condition?
    if $game_system.skill_button && !BlizzABS::Config::DIRECT_HOTKEYS &&
        Input.press?(Input::Skill) &&
        BlizzCFG::RAPID_SKILLS.include?($game_player.battler.skill)
      return true
    end
    return check_skill_condition_rapidfire?
  end
 
  alias check_item_condition_rapidfire? check_item_condition?
  def check_item_condition?
    if $game_system.item_button && !BlizzABS::Config::DIRECT_HOTKEYS &&
        Input.press?(Input::Item) &&
        BlizzCFG::RAPID_ITEMS.include?($game_player.battler.item)
      return true
    end
    return check_item_condition_rapidfire?
  end
 
  alias skill_hotkeys_rapidfire? skill_hotkeys?
  def skill_hotkeys?
    triggered = BlizzABS::Cache::Keys.find_all {|i|
        Input.press?(Input::Key[i.to_s]) &&
        $game_player.skill_hotkeys[i] != 0 &&
        BlizzCFG::RAPID_SKILLS.include?($game_player.battler.skill)}
    if triggered.size > 0
      $game_player.battler.skill = $game_player.skill_hotkeys[triggered[0]]
      return true
    end
    return skill_hotkeys_rapidfire?
  end
 
  alias item_hotkeys_rapidfire? item_hotkeys?
  def item_hotkeys?
    triggered = BlizzABS::Cache::Keys.find_all {|i|
        Input.press?(Input::Key[i.to_s]) &&
        $game_player.item_hotkeys[i] != 0 &&
        BlizzCFG::RAPID_ITEMS.include?($game_player.battler.item)}
    if triggered.size > 0
      $game_player.battler.item = $game_player.item_hotkeys[triggered[0]]
      return true
    end
    return item_hotkeys_rapidfire?
  end
 
end

$BlizzABS = BlizzABS::Processor.new



Instructions

In the script in the first comment.


Compatibility

Requires Blizz-ABS to work.


Credits and Thanks




Author's Notes

Keep in mind that this plugin comes UNDER Blizz-ABS. This script was done on request (so people stop asking) and is not fully supported by me as my other scripts are.

If you find any bugs, please report them here:
http://forum.chaos-project.com

That's it! N-Joy! =D
Title: Re: [XP] Rapid Fire for Blizz-ABS
Post by: droneseven on November 25, 2009, 09:46:17 am
Thanks very much indeed, Blizz.


U're a savior. :)
(cuz I really need it!!)
Title: Re: [XP] Rapid Fire for Blizz-ABS
Post by: G_G on November 25, 2009, 11:13:54 am
very nice blizz *lv's up*

EDIT: There's no v 2.6 yet D:

EDIT 2: I read your other posts D:
Title: Re: [XP] Rapid Fire for Blizz-ABS
Post by: Alton Wyte on November 25, 2009, 11:17:30 am
QuoteRequires Blizz-ABS 2.6 or higher to work.

Well, version 2.6 isn't out yet, and it has errors if you have 2.57., the latest one released.
Title: Re: [XP] Rapid Fire for Blizz-ABS
Post by: Blizzard on November 25, 2009, 11:49:38 am
That's because I have changed something in the future v2.6 so this script turns out quite small and compatible. But don't worry, I think I can find some time over the weekend to add the last few things for v2.6 and release it.
Title: Re: [XP] Rapid Fire for Blizz-ABS
Post by: Aqua on November 25, 2009, 01:14:28 pm
:D
Can't wait to test it.
Title: Re: [XP] Rapid Fire for Blizz-ABS
Post by: legacyblade on December 07, 2009, 05:28:22 pm
Wow, this is really useful for a lot of things. I'm using it for the vast majority of the spells in my game. However, I've encountered a problem.

I have everything worked out for a certain skill (praying). You hold down the action button to keep casting a spell that adds the state "praying". When you let go, the state will go away, it works perfectly. (it releases the state after 1 second) But sometimes the animation stops for 1-4 seconds at random times, though the actor stays in his "I'm launching a spell" stance. There doesn't seem to be any pattern to it, any ideas on how to fix this problem?
Title: Re: [XP] Rapid Fire for Blizz-ABS
Post by: Blizzard on December 07, 2009, 05:32:54 pm
I'm not sure what's wrong. I'd need a demo to be able to take a look at it.
Title: Re: [XP] Rapid Fire for Blizz-ABS
Post by: legacyblade on December 07, 2009, 06:04:29 pm
Here's a demo of it. Use the "pray" skill to see what I'm talking about (also, the sprite seems to flash back to the regular sprite charset sometimes)

http://www.sendspace.com/file/z51hd5
Title: Re: [XP] Rapid Fire for Blizz-ABS
Post by: Blizzard on December 07, 2009, 06:12:04 pm
I'll get back to you ASAP.
Title: Re: [XP] Rapid Fire for Blizz-ABS
Post by: legacyblade on December 07, 2009, 11:03:07 pm
Thanks, I appreciate it :)
Title: Re: [XP] Rapid Fire for Blizz-ABS
Post by: Blizzard on December 17, 2009, 06:59:35 am
Ok, I took a quick look at it. Have you thought about increasing the skill penalty? If the state stays for 1 second, a 40 frames penalty should fix the problem.
Title: Re: [XP] Rapid Fire for Blizz-ABS
Post by: legacyblade on December 18, 2009, 11:29:04 pm
That doesn't fix the problem. It just causes there to be a large gap in between the skill casts. (I want this to be a "charge" kind of skill, in that it increases the SP as long as you're holding down the skill button. If there were no breaks inbetween the casting of the skill, this would work perfectly.)
Title: Re: [XP] Rapid Fire for Blizz-ABS
Post by: Blizzard on December 20, 2009, 09:31:09 am
Wouldn't it be easier then just to use a user skill that does negative SP damage?
Title: Re: [XP] Rapid Fire for Blizz-ABS
Post by: legacyblade on December 20, 2009, 03:29:29 pm
It would be easier, but it wouldn't give the effect I'm going for. In this world, you have a Link to your deity. They will give you Vita (think MP) through a process called "praying". You're immobilized during this process. Praying for more than half a second during battle is very risky because you take extra damage while you're praying. So I want the user to be able to time this, rather than just use a "pray" skill with a set time. If they hold the button down for a short amount of time, they won't get enough SP to do much. If they hold it down for awhile, it'll get them enough SP to do some good damage, but they'll also risk getting totally slaughtered while they're praying. A rapid fire skill is ideal for this, provided it doesn't have any "breaks" in between skill launching (when I launch projectiles with a time gap between them, the actor stays in the fireing pose until the button is released. However, that doesn't work when there is supposed to be no delay in between skill launching).
Title: Re: [XP] Rapid Fire for Blizz-ABS
Post by: Blizzard on December 21, 2009, 04:33:45 am
Alright then. I'll try to find a solution for this for you.
Title: Re: [XP] Rapid Fire for Blizz-ABS
Post by: legacyblade on December 21, 2009, 01:15:17 pm
Thank you Blizzard. I really appreciate you doing this for me :)
Title: Re: [XP] Rapid Fire for Blizz-ABS
Post by: legacyblade on January 10, 2010, 05:58:39 pm
Not sure how I got it to work (I really am not sure), but I somehow managed a work around by making the animation (and thus the penalty time) longer. While it doesn't work EXACTLY how I want (they will pray for at least 1 second no matter what you do), it'll pass for now. Thanks for a really great script blizzy :)