[XP] Rapid Fire for Blizz-ABS

Started by Blizzard, November 25, 2009, 09:39:34 am

Previous topic - Next topic

Blizzard

November 25, 2009, 09:39:34 am Last Edit: March 23, 2019, 11:37:15 am by Blizzard
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


  • rapid fire for weapons
  • rapid fire for skills
  • rapid fire for items
  • easy to configure



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


  • Boris "Blizzard" Mikić



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
Check out Daygames and our games:

King of Booze 2      King of Booze: Never Ever
Drinking Game for Android      Never have I ever for Android
Drinking Game for iOS      Never have I ever for iOS


Quote from: winkioI do not speak to bricks, either as individuals or in wall form.

Quote from: Barney StinsonWhen I get sad, I stop being sad and be awesome instead. True story.

droneseven

Thanks very much indeed, Blizz.


U're a savior. :)
(cuz I really need it!!)

G_G

November 25, 2009, 11:13:54 am #2 Last Edit: November 25, 2009, 11:17:19 am by game_guy
very nice blizz *lv's up*

EDIT: There's no v 2.6 yet D:

EDIT 2: I read your other posts D:

Alton Wyte

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.

Blizzard

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.
Check out Daygames and our games:

King of Booze 2      King of Booze: Never Ever
Drinking Game for Android      Never have I ever for Android
Drinking Game for iOS      Never have I ever for iOS


Quote from: winkioI do not speak to bricks, either as individuals or in wall form.

Quote from: Barney StinsonWhen I get sad, I stop being sad and be awesome instead. True story.

Aqua


legacyblade

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?

Blizzard

I'm not sure what's wrong. I'd need a demo to be able to take a look at it.
Check out Daygames and our games:

King of Booze 2      King of Booze: Never Ever
Drinking Game for Android      Never have I ever for Android
Drinking Game for iOS      Never have I ever for iOS


Quote from: winkioI do not speak to bricks, either as individuals or in wall form.

Quote from: Barney StinsonWhen I get sad, I stop being sad and be awesome instead. True story.

legacyblade

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

Blizzard

Check out Daygames and our games:

King of Booze 2      King of Booze: Never Ever
Drinking Game for Android      Never have I ever for Android
Drinking Game for iOS      Never have I ever for iOS


Quote from: winkioI do not speak to bricks, either as individuals or in wall form.

Quote from: Barney StinsonWhen I get sad, I stop being sad and be awesome instead. True story.

legacyblade


Blizzard

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.
Check out Daygames and our games:

King of Booze 2      King of Booze: Never Ever
Drinking Game for Android      Never have I ever for Android
Drinking Game for iOS      Never have I ever for iOS


Quote from: winkioI do not speak to bricks, either as individuals or in wall form.

Quote from: Barney StinsonWhen I get sad, I stop being sad and be awesome instead. True story.

legacyblade

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.)

Blizzard

Wouldn't it be easier then just to use a user skill that does negative SP damage?
Check out Daygames and our games:

King of Booze 2      King of Booze: Never Ever
Drinking Game for Android      Never have I ever for Android
Drinking Game for iOS      Never have I ever for iOS


Quote from: winkioI do not speak to bricks, either as individuals or in wall form.

Quote from: Barney StinsonWhen I get sad, I stop being sad and be awesome instead. True story.

legacyblade

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).

Blizzard

Alright then. I'll try to find a solution for this for you.
Check out Daygames and our games:

King of Booze 2      King of Booze: Never Ever
Drinking Game for Android      Never have I ever for Android
Drinking Game for iOS      Never have I ever for iOS


Quote from: winkioI do not speak to bricks, either as individuals or in wall form.

Quote from: Barney StinsonWhen I get sad, I stop being sad and be awesome instead. True story.

legacyblade

Thank you Blizzard. I really appreciate you doing this for me :)

legacyblade

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 :)