Chaos Project

RPG Maker => RPG Maker Scripts => RMXP Script Database => Topic started by: Blizzard on November 28, 2009, 05:32:20 pm

Title: [XP] Quick Weapon Switch for Blizz-ABS
Post by: Blizzard on November 28, 2009, 05:32:20 pm
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




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




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
Title: Re: [XP] Quick Weapon Switch for Blizz-ABS
Post by: Aqua on November 28, 2009, 05:34:17 pm
<3
Title: Re: [XP] Quick Weapon Switch for Blizz-ABS
Post by: Ryex on November 28, 2009, 06:31:41 pm
<3
Title: Re: [XP] Quick Weapon Switch for Blizz-ABS
Post by: Blizzard on November 28, 2009, 06:36:09 pm
<3
Title: Re: [XP] Quick Weapon Switch for Blizz-ABS
Post by: fugibo on November 28, 2009, 06:47:16 pm
</3
Title: Re: [XP] Quick Weapon Switch for Blizz-ABS
Post by: RoseSkye on November 28, 2009, 08:17:29 pm
Fuck YEAH Seaking Blizzard!
Title: Re: [XP] Quick Weapon Switch for Blizz-ABS
Post by: Holyrapid on December 01, 2009, 12:54:50 pm
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?
Title: Re: [XP] Quick Weapon Switch for Blizz-ABS
Post by: Blizzard on December 01, 2009, 01:45:46 pm
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.
Title: Re: [XP] Quick Weapon Switch for Blizz-ABS
Post by: droneseven on December 04, 2009, 09:20:50 pm
Will this also switch the ammunition needed for bow 'n arrow weapons?
Title: Re: [XP] Quick Weapon Switch for Blizz-ABS
Post by: Hellfire Dragon on December 05, 2009, 04:10:00 am
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.
Title: Re: [XP] Quick Weapon Switch for Blizz-ABS
Post by: Blizzard on February 23, 2010, 02:18:46 am
Update to v1.01b.
Title: Re: [XP] Quick Weapon Switch for Blizz-ABS
Post by: LiTTleDRAgo on November 26, 2010, 11:49:44 pm
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
Title: Re: [XP] Quick Weapon Switch for Blizz-ABS
Post by: Blizzard on November 28, 2010, 01:31:28 pm
There you go, I fixed it.
Title: Re: [XP] Quick Weapon Switch for Blizz-ABS
Post by: LiTTleDRAgo on December 05, 2010, 06:03:38 am
I changed it to new version and now I can't switch hero's weapon at all  :???:
Title: Re: [XP] Quick Weapon Switch for Blizz-ABS
Post by: Blizzard on December 05, 2010, 06:44:36 am
My bad, I didn't fix it properly. Try the new version 1.11b.