[XP] Quick Weapon Switch for Blizz-ABS

Started by Blizzard, November 28, 2009, 05:32:20 pm

Previous topic - Next topic

Blizzard

November 28, 2009, 05:32:20 pm Last Edit: March 23, 2019, 11:37:39 am by Blizzard
Quick Weapon Switch for Blizz-ABS
Authors: Blizzard
Version: 1.11b
Type: Blizz-ABS Plugin
Key Term: Blizz-ABS Plugin



Introduction

This script will allow to quickly switch the weapon by pressing one out of two possible keys.

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


Features


  • easy to configure
  • no need to open the menu during heated action fights to change the weapon



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
#:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=
# Quick Weapon Switch for Blizz-ABS by Blizzard
# Version: 1.11b
# Type: Blizz-ABS Add-on
# Date: 28.11.2009
# Date v1.01b: 23.2.2010
# Date v1.1b: 28.11.2010
# Date v1.11b: 5.12.2010
#:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=
#
#  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.7 or
#   higher to work properly. It will allow to quickly switch the weapon by
#   pressing one out of two possible keys.
#
#
# If you find any bugs, please report them here:
# http://forum.chaos-project.com
#:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=

if !$BlizzABS || BlizzABS::VERSION < 2.7
  raise 'ERROR: The "Quick Weapon Switch" plugin requires Blizz-ABS 2.7 or higher.'
end

module BlizzCFG

#::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::
# START Configuration
#::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::
 
  LEFT_BUTTON = Input::Prevpage
  RIGHT_BUTTON = Input::Nextpage

#::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::
# END Configuration
#::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::
 
  $blizzabs_wswitch = 1.11

end

#==============================================================================
# Scene_Map
#==============================================================================

class Scene_Map

  alias update_wswitch_later update
  def update
    update_wswitch_later
    return if !$game_player.valid? || $game_player.battler.equip_fix?(0)
    array = []
    if $game_player.battler.weapon_id > 0
      start = $game_player.battler.weapon_id
      if Input.trigger?(BlizzCFG::LEFT_BUTTON)
        array = ((start + 1)...(start + $data_weapons.size)).to_a.reverse
      elsif Input.trigger?(BlizzCFG::RIGHT_BUTTON)
        array = ((start + 1)...(start + $data_weapons.size)).to_a
      end
    end
    array.each {|id|
        id = (id + $data_weapons.size) % $data_weapons.size
        if id != 0 && $game_party.weapon_number(id) > 0 &&
            $game_player.battler.equippable?($data_weapons[id])
          $game_system.se_play($data_system.cursor_se)
          $game_player.battler.equip(0, id)
          break
        end}
  end
 
end



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

Aqua


Ryex

I no longer keep up with posts in the forum very well. If you have a question or comment, about my work, or in general I welcome PM's. if you make a post in one of my threads and I don't reply with in a day or two feel free to PM me and point it out to me.<br /><br />DropBox, the best free file syncing service there is.<br />

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.

fugibo


RoseSkye


Holyrapid

I´m not sure, since i have yet to test this, but is this sort of like in Castlevania Dawn of Sorrow, where you can make two equipment settings A and B, and by pressing a button, it switches to the other one. But, only for weapons, if i´ve understood things correctly? Would it be possible then to extend to being like in CV:DoS, so that your weapon, armor, accesory/accesories (if using some multiequip), all would change to another previosly set up in the menu?

Blizzard

This cycles through weapon IDs and switches if another weapon along the way exists. Of course it can be done, I just won't do 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.

droneseven

Will this also switch the ammunition needed for bow 'n arrow weapons?

Hellfire Dragon

I didn't download it yet but it's supposed to only switch weapons and players have to hoykey ammunition themselves anyway so I'm pretty sure it doesn't.

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.

LiTTleDRAgo

sorry for reviving an ancient thread but,
when I use this script, my character can switch with weapon that should can't be used
ex : archer can switch his bow to a sword

how do I fix this?


~please don't mind my bad english

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.

LiTTleDRAgo

I changed it to new version and now I can't switch hero's weapon at all  :???:

Blizzard

My bad, I didn't fix it properly. Try the new version 1.11b.
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.