Jump to content
Fomar0153

Dual Wield -> Free Hands

Recommended Posts

Dual Wield -> Free Hands

Version 1.0

by Fomar0153

 

Introduction

This script changes the functionality of Dual Wield to allow the equipping of shield or one handed weapons in the off hand (shield slot) also supports two handed weapons.

 

Features

+ Can equip one handed weapons or shields in off-hand.

+ Two handed weapons.

 

Screenshot

SS0012.png

 

How to Use

First copy the script into your scripts section then consult further instruction located at the top of the script.

 

Script

The most update version of this script can always be found on my blog.

 

F.A.Q.

No questions asked.

 

Credits and Thanks

Fomar0153

 

Author's Notes

Not 100% that there are no bugs, let me know if you find any. Thanks.

Share this post


Link to post
Share on other sites

I have a Gem in my game that allows dual wielding.

This script will still work right, when the gem is equipped?

(Fomar0153 I am using your equipment slot script as well)

Edited by Shadow Fox

Share this post


Link to post
Share on other sites

I have a Gem in my game that allows dual wielding.

This script will still work right, when the gem is equipped?

(Fomar0153 I am using your equipment slot script as well)

 

Why can't you test it yourself?

 

Er. I was about to edit my post after testing it out myself. It clashed with the settings of the equipment slot, and the gems

(And other pieces of armour) that should have been in their own slots weren't in their own slots but the accessory slot.

Share this post


Link to post
Share on other sites

@Hesufo, Knightmare, Maliki, Patrick: Thanks, let me know if there are any problems further down the line.

 

@ShadowFox: This and my custom equip slots script are not compatible, unfortunately I had to overwrite some of the same methods. I am planning on updating my custom slots script to include note tagging which will reduce it's need to overwrite methods in the future.

Share this post


Link to post
Share on other sites

@Fomar0153 - mate, as always (second time already) I am surprised by your scripts. This is damn good idea, only thing I'm looking forward when this and your custom slot script will be compatible (if you plan to do it in future). But I'm thinking that I can make something like dual wield with custom slots already.

Share this post


Link to post
Share on other sites

@Fomar0153 - mate, as always (second time already) I am surprised by your scripts. This is damn good idea, only thing I'm looking forward when this and your custom slot script will be compatible (if you plan to do it in future). But I'm thinking that I can make something like dual wield with custom slots already.

In the future, presently I'm working the scripts for my own game and the scripts for someone else.

Oh well. Thanks Fomar0153. Wish I could have PM'd you that question, instead of posting in the forum.

No that's what the forum topics are for.

Share this post


Link to post
Share on other sites

@Mister Big T- Umm...wouldn't that defeat the purpose of calling it a two handed weapon? Might as well label it a big ass sword instead. Makes more sense. Otherwise it wouldn't really be two handed.

Share this post


Link to post
Share on other sites

A very useful script indeed. I'm going to use it.

 

Just a question: is there a way I can force a shield to be equipped on one of the weapon's slot? Like a script call?

Share this post


Link to post
Share on other sites

Can you make it so that certain character can dual wield even two handed weapons?

A small edit:

 

=begin
Duel Wield -> Free Hands
by Fomar0153
Version 1.0
----------------------
Notes
----------------------
No requirements
Changes dual wielding to allow characters to equip shield or one handed
weapons in the shield slot. Also allows for two handed weapons.
----------------------
Instructions
----------------------
Notetag two handed weapon with <two-handed> and have them
disable the shield slot.
I would reccomend changing the slot name to Main Hand and Off Hand
or something similiar
----------------------
Known bugs
----------------------
None
=end
class Game_Actor

 def equip_slots
return [0,0,2,3,4] if @actor_id == 1 # edit here and copy line for every character who is able to duel wield two-handed weapons but they will be unable to use shields
return [0,1,2,3,4]
 end

 def change_equip(slot_id, item)
return unless trade_item_with_party(item, equips[slot_id])
return if (item && equip_slots[slot_id] != item.etype_id) and
  not (dual_wield? and (equip_slots[slot_id] == 1 and item.etype_id == 0))
@equips[slot_id].object = item
refresh
 end

 def release_unequippable_items(item_gain = true)
@equips.each_with_index do |item, i|
  if !equippable?(item.object,equip_slots[i]) || (item.object.etype_id != equip_slots[i] and
	  not (dual_wield? and (equip_slots[i] == 1 and item.object.etype_id == 0)))
	trade_item_with_party(nil, item.object) if item_gain
	item.object = nil
  end
end
 end

 def equippable?(item, slot = nil)
unless slot.nil?
  if slot == 1 and dual_wield?
	return (super(item) and not equip_type_sealed?(1)) if item.is_a?(RPG::Weapon)
  end
end
return super(item)
 end

end

class RPG::Weapon

 def two_handed?
return self.note.include?("<two-handed>")
 end

end

class Window_EquipItem < Window_ItemList

 def include?(item)
return true if item == nil
return false unless item.is_a?(RPG::EquipItem)
return false if @slot_id < 0
return false if @actor.equip_slots[@slot_id] == 1 and
  (item.is_a?(RPG::Weapon) and item.two_handed?)
return false if (item.etype_id != @actor.equip_slots[@slot_id]) and
  not (@actor.dual_wield? and (@actor.equip_slots[@slot_id] == 1 and item.etype_id == 0))
return @actor.equippable?(item,@actor.equip_slots[@slot_id])
 end

end

 

A very useful script indeed. I'm going to use it.

 

Just a question: is there a way I can force a shield to be equipped on one of the weapon's slot? Like a script call?

 

No. This script does not feature the ability to duel wield shields.

If you need to force it you could do something like:

	b = Game_BaseItem.new
b.object = $data_armors[1]

And then force it onto the actor either through a new method call or by making @equips accessible.

Edited by Fomar0153

Share this post


Link to post
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now

  • Recently Browsing   0 members

    No registered users viewing this page.

×