[XP] Secondary Weapon for Blizz-ABS

Started by Blizzard, December 04, 2008, 10:32:05 am

Previous topic - Next topic

Blizzard

December 04, 2008, 10:32:05 am Last Edit: March 23, 2019, 11:37:05 am by Blizzard
Secondary Weapon for Blizz-ABS
Authors: Blizzard
Version: 1.0b
Type: Blizz-ABS plugin
Key Term: Blizz-ABS Plugin



Introduction

This 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



Screenshots

N/A


Demo

N/A


Script

Just make a new script above main and paste this code into it.
Spoiler: ShowHide
#:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=
# 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



Instructions

None required.


Compatibility

Requires Blizz-ABS to work.


Credits and Thanks


  • Boris "Blizzard" Mikić
  • thanks to Aqua for requesting this a long time ago



Author's Notes

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

Punn

Not compatible with Guiluame's multi-equip?

Blizzard

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

Makasu

December 17, 2008, 09:43:11 am #3 Last Edit: December 17, 2008, 09:58:13 am by Makasu
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?
Dead on Arrival is the name of my project. Topic thread coming sooner or later.

Me on deviantart.com
My talents: ShowHide

  • Spriting
  • drawing
  • html coding
  • website design
  • skating
             PM now for a personal quote!
[[Will draw character art for you for $$$ or scripts!]]




Blizzard

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

Makasu

December 17, 2008, 10:14:14 am #5 Last Edit: December 17, 2008, 10:19:51 am by Makasu
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?
Dead on Arrival is the name of my project. Topic thread coming sooner or later.

Me on deviantart.com
My talents: ShowHide

  • Spriting
  • drawing
  • html coding
  • website design
  • skating
             PM now for a personal quote!
[[Will draw character art for you for $$$ or scripts!]]




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.

Makasu

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
Dead on Arrival is the name of my project. Topic thread coming sooner or later.

Me on deviantart.com
My talents: ShowHide

  • Spriting
  • drawing
  • html coding
  • website design
  • skating
             PM now for a personal quote!
[[Will draw character art for you for $$$ or scripts!]]




Blizzard

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

Makasu

December 17, 2008, 11:40:22 am #9 Last Edit: December 17, 2008, 11:42:20 am by Makasu
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.
Dead on Arrival is the name of my project. Topic thread coming sooner or later.

Me on deviantart.com
My talents: ShowHide

  • Spriting
  • drawing
  • html coding
  • website design
  • skating
             PM now for a personal quote!
[[Will draw character art for you for $$$ or scripts!]]




Blizzard

You can use a custom mod. Best you ask Aqua. She made a mod for herself.
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.

Makasu

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
Dead on Arrival is the name of my project. Topic thread coming sooner or later.

Me on deviantart.com
My talents: ShowHide

  • Spriting
  • drawing
  • html coding
  • website design
  • skating
             PM now for a personal quote!
[[Will draw character art for you for $$$ or scripts!]]




Blizzard

December 17, 2008, 12:08:48 pm #12 Last Edit: December 17, 2008, 12:10:02 pm by Blizzard
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.
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.

Kagutsuchi

Could you make a two-handed weapon feature?

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.

G_G

This is a cool plugin though I have one question. Is it possible to make it actor specific?

Blizzard

March 17, 2009, 02:26:38 am #16 Last Edit: March 17, 2009, 02:27:39 am by Blizzard
Don't allow equipping another weapon, duh.
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.

RoseSkye

How would I make it  armor specific? Some Shields I want to shield.. others I want to attack.

Blizzard

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