11-19-2009, 12:03 AM
I have thought a little about this and I think that the most simple and effective way to solve the two-hands weapons problem is the following.
Add the following snippet of code at the beginning of the script page "Enhanced Equipment" (EDIT: updated)
Modify the beginning of the initialize method for the class Enhanced_Weapon making it look like this:
Wherever the arrays Two_Hands_Weapons, Right_Hand_Weapons and Left_Hand_Weapons are used in the AAS script, apply these changes (updated):
For example, in order for the script variation you posted on Nov 15 to work, it must be changed like this:
Add the following snippet of code at the beginning of the script page "Enhanced Equipment" (EDIT: updated)
Code:
class Game_System
attr_accessor :two_hands_enhanced_weapons
attr_accessor :left_hand_enhanced_weapons
attr_accessor :right_hand_enhanced_weapons
alias ee_initialize initialize
def initialize
ee_initialize
@two_hands_enhanced_weapons=[]
@left_hand_enhanced_weapons=[]
@right_hand_enhanced_weapons=[]
end
end
Modify the beginning of the initialize method for the class Enhanced_Weapon making it look like this:
Code:
def initialize(ref_id)
@ref_id=ref_id
@id = $game_party.max_used_weapon_id + 1
$game_system.two_hands_enhanced_weapons.push(@id) if Two_Hands_Weapons.include?(ref_id)
$game_system.right_hand_enhanced_weapons.push(@id) if Right_Hand_Weapons.include?(ref_id)
$game_system.left_hand_enhanced_weapons.push(@id) if Left_Hand_Weapons.include?(ref_id)
...
Wherever the arrays Two_Hands_Weapons, Right_Hand_Weapons and Left_Hand_Weapons are used in the AAS script, apply these changes (updated):
Code:
Two_Hands_Weapons => (Two_Hands_Weapons|$game_system.two_hands_enhanced_weapons)
Left_Hand_Weapons => (Left_Hand_Weapons|$game_system.left_hand_enhanced_weapons)
Right_Hand_Weapons => (Right_Hand_Weapons|$game_system.right_hand_enhanced_weapons)
For example, in order for the script variation you posted on Nov 15 to work, it must be changed like this:
Code:
#==============================================================================
# ** Window_EquipItem
#------------------------------------------------------------------------------
# This window displays choices when opting to change equipment on the
# equipment screen.
#==============================================================================
class Window_EquipItem < Window_Selectable
#--------------------------------------------------------------------------
attr_accessor :data
#--------------------------------------------------------------------------
def initialize(actor, equip_type)
case Equip_Menu_Syle
when 0,2
super(0, 256, 640, 224)
@column_max = 2
when 1
super(0, 288, 640, 192)
@column_max = 2
when 3
super(272, 256, 368, 224)
@column_max = 1
when 4
super(0, 256, 368, 224)
@column_max = 1
end
@actor = actor
@equip_type = equip_type
refresh
self.active = false
self.index = -1
end
#--------------------------------------------------------------------------
# * Refresh
#--------------------------------------------------------------------------
def refresh
if self.contents != nil
self.contents.dispose
self.contents = nil
end
@data = []
# Add equippable weapons
if @equip_type == 0 or (@equip_type == 1 and @actor.two_swords_style)
weapon_set = $data_classes[@actor.class_id].weapon_set
for i in 1...$data_weapons.size
next if (Two_Hands_Weapons|$game_system.two_hands_enhanced_weapons).include?(i) and @equip_type == 1
next if (Right_Hand_Weapons|$game_system.right_hand_enhanced_weapons).include?(i) and @equip_type == 1
next if (Left_Hand_Weapons|$game_system.left_hand_enhanced_weapons).include?(i) and @equip_type == 0
if $game_party.weapon_number(i) > 0 and weapon_set.include?(i)
@data.push($data_weapons[i])
end
# CHARLIE: add new weapons which cannot be part of the weapon set
if i > $game_party.max_database_weapon_id
if $game_party.weapon_number(i) > 0 and weapon_set.include?($data_weapons[i].ref_id)
@data.push($data_weapons[i])
end
end
end
end