No Twin Swords Script
Proposed October 29th, 2011
SummaryMy intent for this script is to be able to limit what can be equipped in the off-hand when using the Dual-Wield character option (i.e. cannot use a sword in the off-hand as opposed to, say, a knife).
Features DesiredJust looking for a simple script that does just as the summary asks; I would like the script to disallow a player to select certain weapons for use in the off-hand if a character has the Dual-Wielding function. Here is the example I want to specify: I was planning on making a 'musketeer' class who, in addition to using firearms, could also use a rapier-and-dagger fighting style for when the player runs low on ammunition.
The way the scripting for dual-wielding stands in the original RGSS2, however, is that a character could use ANY weapon that their class permits to begin with. Since I intend for swords such as the rapier to be a medium-strength weapon, I do not wish for players to become overpowered with this class by using nothing but twin swords, hence the name of this script.
Games its been in
Dragon Age: Origins, how you can only use a shield or dagger in your off hand.
What other scripts are you using?
I intend to use the following scripts for my upcoming project: Simple Battle HUD, Max Level Limitation System (located off-site from the forums), Show Slip Damage, Caterpillar, and Dual Wield Fix; of these, I think only Dual Wield Fix would present problems to incorporate this script idea into the game.
Did you search?Yes.
Where did you search?What did you search for?
I had used the search engine for the phrases "Florentine" and "Dual-wielding modification", as well as looked up the Yanfly/Pockethouse Scripts and the RPG Maker VX Scripts Database topics to make sure this was (hopefully) not suggested before.
You could check the 'Two-hand' box in the rapier's database entry. Is that what you want? I'm having trouble understanding what you need.
Em... not really what I meant; sorry about not being able to explain what I want better.
What I basically mean is that I wanted to have it so that a character could use, say, a rapier and dagger OR a rapier and shield, but not two rapiers.
Because I wanted rapiers to do a good amount of damage for my game idea, I didn't want the player to have the option of using two of them at the same time. I recall that in games like Final Fantasy III (the one for the Nintendo DS), I almost never used shields because using two high-power weapons was much more efficient for me. The way I wanted it to work was that the player could opt for slightly more damage with a rapier-and-dagger combination, or sacrifice that extra damage for more defense and evasion with a rapier-and-shield combo.
Something like this?
# Use the tag \no_double in a weapon's notebox to disallow having it equipped
# twice. This script must go at the above all scripts that alter Game_Actor#
# change_equip.
class RPG::Weapon
def no_double
return @no_double if !@no_double.nil?
@no_double = false
self.note.split(/[\r\n]+/i).each { |line|
case line
when /\\NO_DOUBLE/i
@no_double = true
end
}
return @no_double
end
end
class Game_Actor < Game_Battler
def change_equip(equip_type, item, test = false)
last_item = equips[equip_type]
unless test
return if $game_party.item_number(item) == 0 if item != nil
$game_party.gain_item(last_item, 1)
$game_party.lose_item(item, 1)
end
item_id = item == nil ? 0 : item.id
case equip_type
when 0
weapon = $data_weapons[item.id]
@weapon_id = item_id
if !two_hands_legal? or (weapon.no_double and two_swords_style and
@armor1_id == item_id)
change_equip(1, nil, test)
end
when 1
weapon = $data_weapons[item.id]
@armor1_id = item_id
if !two_hands_legal? or (weapon.no_double and two_swords_style and
@weapon_id == item_id)
change_equip(0, nil, test)
end
when 2
@armor2_id = item_id
when 3
@armor3_id = item_id
when 4
@armor4_id = item_id
end
end
end
I am really sorry if I'm not being specific enough -- I don't mean to come off as an annoying twit, or too nitpicky, etc. It's closer to what I wished, but still no cigar. I really do wish I could describe what I mean better... regardless, I'll try one more time; I don't wish to waste too much of your time if I consistently cannot explain what I wish to convey.
IMHO, the easiest way I could explain it is thus: I think I'm looking for a script where the person using it can designate which weapons can or cannot be used in a character's off-hand slot. This would be done by adding in that weapon's number in the database to a certain part of the script itself.
For instance, say I wanted to only have the player be able to use "dagger" weapons in a character's off-hand if they can use dual-wielding. I would then go to the weapons database, find out which numbered items are considered daggers, then go to the script and type in the numbers of those items in the script. If written correctly, this would thus allow only those chosen weapons to be used in the off-hand rather than any other.
Once more, I am really sorry if I am being any kind of a nuisance for you in regards to this script idea.
OH!
This should probably do it.
# Insert the tag \no_offhand into a weapon's notebox to make it impossible to
# equip in the offhand. This script must go at the top of your custom scripts.
class RPG::Weapon
def offhand?
return @offhand if !@offhand.nil?
@offhand = true
self.note.split(/[\r\n]+/i).each { |line|
case line
when /\\NO_OFFHAND/i
@offhand = false
end
}
return @offhand
end
end
class Game_Actor < Game_Battler
def change_equip(equip_type, item, test = false)
last_item = equips[equip_type]
unless test
return if $game_party.item_number(item) == 0 if item != nil
$game_party.gain_item(last_item, 1)
$game_party.lose_item(item, 1)
end
item_id = item == nil ? 0 : item.id
case equip_type
when 0 # Weapon
@weapon_id = item_id
unless two_hands_legal? # If two hands is not allowed
change_equip(1, nil, test) # Unequip from other hand
end
when 1 # Shield
@armor1_id = item_id unless (item.is_a?(RPG::Weapon) and !item.offhand?)
unless two_hands_legal? # If two hands is not allowed
change_equip(0, nil, test) # Unequip from other hand
end
when 2 # Head
@armor2_id = item_id
when 3 # Body
@armor3_id = item_id
when 4 # Accessory
@armor4_id = item_id
end
end
end
That should do it! Many thanks for taking the time to help me out. Just a quick question: what name should I use when crediting you for this awesome snippet?
Pacman.
Dr. Evil is just a name for the forum's Halloween thing.
Ah, I see! Okay then, sounds good. :)