Secondary Weapon for Blizz-ABS
Authors: Blizzard
Version: 1.0b
Type: Blizz-ABS plugin
Key Term: Blizz-ABS Plugin
IntroductionThis script will add a button for a secondary weapon which is equipped in the place of the armor. This plugin only provides the control, not the equipping!
This script is to be distributed under the same terms and conditions like the script it was created for: Blizz-ABS.
Features
- use a second weapon on button press
- easy to configure
- provides only the control, NOT the equipping system
ScreenshotsN/A
DemoN/A
ScriptJust make a new script above main and paste this code into it.
#:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=
# Secondary Weapon for Blizz-ABS by Blizzard
# Version: 1.0b
# Type: Blizz-ABS Add-on
# Date: 4.12.2008
#:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=
#
# 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 require Blizz-ABS v2.1 or
# higher to work properly. It will add a button for a secondary weapon which
# is equipped in the place of the armor. This plugin only provides the
# control, not the equipping!
#
#
# If you find any bugs, please report them here:
# http://forum.chaos-project.com
#:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=
if !$BlizzABS || BlizzABS::VERSION < 2.1
raise 'ERROR: The "Secondary Weapon" plugin requires Blizz-ABS 2.1 or higher.'
end
#::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::
# START Configuration
#::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::
# button for secondary weapon
SECONDARY_WEAPON_BUTTON = Input::Key['G']
#::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::
# END Configuration
#::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::
#==============================================================================
# BlizzABS::Controls
#==============================================================================
class BlizzABS::Controls
alias update_attack_aqua_later update_attack
def update_attack
return true if update_attack_aqua_later
if $game_system.attack_button && Input.trigger?(SECONDARY_WEAPON_BUTTON)
$game_player.use_attack2
return true
end
return false
end
end
#==============================================================================
# Map_Actor
#==============================================================================
class Map_Actor
def use_attack2
self.battler.weapon_id, self.battler.armor1_id =
self.battler.armor1_id, self.battler.weapon_id
result = (self.battler.weapon_id != 0 && use_attack)
self.battler.weapon_id, self.battler.armor1_id =
self.battler.armor1_id, self.battler.weapon_id
return result
end
end
#==============================================================================
# Game_Actor
#==============================================================================
class Game_Actor
attr_accessor :weapon_id
attr_accessor :armor1_id
end
InstructionsNone required.
CompatibilityRequires Blizz-ABS to work.
Credits and Thanks
- Boris "Blizzard" Mikić
- thanks to Aqua for requesting this a long time ago
Author's NotesKeep in mind that this plugin comes UNDER Blizz-ABS. This script was done on request quite some time ago 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
Not compatible with Guiluame's multi-equip?
I don't think so. Well, if you would change that armor1_id is substituted with the the weapon_id, it might work. I might fix this compatibility issue myself later, though.
I'm sorry to bring this topic back up but using this with BABS is there a way to make the second attack show? IE if I have two guns dual weilded? It'll show the character set accompanied with the bullet?
Yes. This add-on swaps the secondary weapon with the real one to execute the attack so all of Blizz-ABS's configurations work normally. Then it swaps it back.
Argh well I can't get it to work. :( not at all. It won't use the attack or show the sprites associated...
Maybe it would be the script order? I'm not to sure though.
Help?
Quote from: Blizzard on December 04, 2008, 10:32:05 am
Author's Notes
Keep in mind that this plugin comes UNDER Blizz-ABS.
Yes I have it under BABS but still nothing at all. :( I'm not to sure whats going on. But I get nothing. No second attack or anything. No damage pops or anything. I even tried it where I have a gun and a sword equipped and nothing at all! I would put together another demo for you but I'm more than certain you're tired of troubleshooting me. XD
You do realize that the second weapon is equipped as shield (which has to have the same ID as the appropriate weapon) and that it doesn't work with custom equipment systems?
I'm not aware of that. So there is no way to get it to work the way I want to have it? At all?
But see with Guille's it adds another weapon slot while keeping the original shields and such intact.
You can use a custom mod. Best you ask Aqua. She made a mod for herself.
Alrighty! :D will do. Thanks a lot Blizz greatly appreciated. But either ways so does this script work with BABS 2.x? Because either if I try to use a sword or shield or anything of that nature it get nothing for a second attack.
Oh wait nevermind. You just explained that. XD
Quote from: Blizzard on December 04, 2008, 10:32:05 am
# This script must be placed below Blizz-ABS and require Blizz-ABS v2.1 or
# higher to work properly. ...
Try using a shield that has the same ID as some weapon. i.e. a sword is ID 6, so equip a shield with armor ID 6.
Could you make a two-handed weapon feature?
No, this is not ABS specific.
This is a cool plugin though I have one question. Is it possible to make it actor specific?
Don't allow equipping another weapon, duh.
How would I make it armor specific? Some Shields I want to shield.. others I want to attack.
You need to distiguish them. Find this line:
if $game_system.attack_button && Input.trigger?(SECONDARY_WEAPON_BUTTON)
Change it to this:
if $game_system.attack_button && Input.trigger?(SECONDARY_WEAPON_BUTTON) && [X, Y, Z].include?($game_player.battler.armor1_id)
Replace X, Y, Z and add/remove armor IDs that can attack.
*whistles*
I found the mod I use for double weapons... XD
http://www.creationasylum.net/index.php?showtopic=1604 (http://www.creationasylum.net/index.php?showtopic=1604)
Necro (for good reason)
I noticed that the secondary button is nothing but a .. secondary button.
Example:
The first weapon is a arm bow with X range
the second weapon would be that as well as opposed to feet or something thats not a arm bow.
Quote from: RoseSkye on August 06, 2009, 07:16:16 am
I noticed that the secondary button is nothing but a .. secondary button.
Well noticed.
>.> *re-reads first post* Ooooh.
I have found a minor ... quirk in the script.I was just being stupid. =)
Quoteif !$BlizzABS || BlizzABS::VERSION < 2.7
raise 'ERROR: The "Blizz-ABS Controller" requires Blizz-ABS 2.7 or higher.'
elsif !defined?(RMXOS) || RMXOS::VERSION < 1.09
raise 'ERROR: The "Blizz-ABS Controller" requires RMX-OS 1.09 or higher.'
end
First: Its elseif
it should be like so:
Quoteif !$BlizzABS || BlizzABS::VERSION < 2.7
raise 'ERROR: The "Blizz-ABS Controller" requires Blizz-ABS 2.7 or higher.'
elseif !defined?(RMXOS) || RMXOS::VERSION < 1.09
raise 'ERROR: The "Blizz-ABS Controller" requires RMX-OS 1.09 or higher.'
end
Um...
It's elsif...
o.o
it is? Well sorry for being wrong. O.o I've never seen it done that way. xd
Oh i didn't have my ruby head on when i read that... >.>
*Necroecho*
I've looked at trying to make this Guillame compatible, and of course, I'm stumped. Could anyone point me in the right direction?
class Map_Actor
def use_attack2
self.battler.weapon_id, self.battler.armor1_id =
self.battler.armor1_id, self.battler.weapon_id
result = (self.battler.weapon_id != 0 && use_attack)
self.battler.weapon_id, self.battler.armor1_id =
self.battler.armor1_id, self.battler.weapon_id
return result
end
end
#==============================================================================
# Game_Actor
#==============================================================================
class Game_Actor
attr_accessor :weapon_id
attr_accessor :armor1_id
end
Change all instances of armor1_id to the name of the variable holding the secondary weapon
That was what I figured I should do, having looked at Blizz's answer to the last time this question was asked. But I can't figure out just what that variable is.
It might be "weapon_ids[1]". And the base weapon could be "weapon_ids[0]" instead of "weapon_id".
Thanks, I'll go ahead and try that.
Nope, not working.
Gah...any ideas? Anyone? :???:
I noticed, for instance, that Guillame used the word slot, so I tried that instead of id, no joy.
More importantly, when I tried what you guys suggested, I get this:
undefined method '[]' for :weapon_ids:Symbol
The code, in case I misinterpreted or other such silly thing:
if !$BlizzABS || BlizzABS::VERSION < 2.1
raise 'ERROR: The "Secondary Weapon" plugin requires Blizz-ABS 2.1 or higher.'
end
#::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::
# START Configuration
#::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::
# button for secondary weapon
SECONDARY_WEAPON_BUTTON = Input::Key['L']
#::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::
# END Configuration
#::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::
#==============================================================================
# BlizzABS::Controls
#==============================================================================
class BlizzABS::Controls
alias update_attack_aqua_later update_attack
def update_attack
return true if update_attack_aqua_later
if $game_system.attack_button && Input.trigger?(SECONDARY_WEAPON_BUTTON)
$game_player.use_attack2
return true
end
return false
end
end
#==============================================================================
# Map_Actor
#==============================================================================
class Map_Actor
def use_attack2
self.battler.weapon_ids[1], self.battler.weapon_ids[1] =
self.battler.weapon_ids[0], self.battler.weapon_ids[1]
result = (self.battler.weapon_ids[0] != 0 && use_attack)
self.battler.weapon_ids[1], self.battler.weapon_ids[0] =
self.battler.weapon_ids[0], self.battler.weapon_ids[1]
return result
end
end
#==============================================================================
# Game_Actor
#==============================================================================
class Game_Actor
attr_accessor :weapon_ids[0]
attr_accessor :weapon_ids[1]
end
It's not called weapon_ids but something else. Just look it up in Guillaume's script. Also, you don't need that last part of the script.
Quote from: Blizzard on January 06, 2011, 04:00:41 am
It's not called weapon_ids but something else. Just look it up in Guillaume's script. Also, you don't need that last part of the script.
Dude what? Defile Blizzard's scriOh no, I already did that by changing it. I'll have another look at the script, but if I end up in an asylum and I start writing it out on the walls, I'm blaming you.
is there anyway to set this so only 1 character could use this button O_o or 1 class lol. Im not good with scripting i dont know much about it but im tryin to learn. sorry any help? :naughty: