Class with Two-handed Weapon & Dual Wield

Hello!


I would like to create a class which can use bows (two-handed weapon) and also daggers/swords/axes (one-handed weapons).


The problem is, if I use the dual wield tag the character can also carry two bows. I want to prevent this.  


The other issue: Swords & Axes are also used by other classes and they should only be able to equip those 2 types once. (So I cannot tag the weapon itself with dual-wield)


I am using a lot of Yanfly's plugins so it's very likely that I run into compatibility issues if I use other plugins. Is there a way to accomplish this with the help of Yanfly's plugins? Or is there a trick?


Thank you very much for your help in advance.
I haven't used Yanfly's Equip scripts (yet), but by looking through them my instinct is that you could probably pull this off using some combination of Equip Core and Equip Requirements - use Lunatic Mode checks to determine whether or not a certain type of equipment is already present on the actor.
https://victorenginescripts.wordpress.com/rpg-maker-mv/dual-wield/



I used this plugin but it duplicated all my items when I switched the class with my characters and the weapon/armor couldn't be used by the switched class. So I cannot use this plugin.


@Wavelength
Thank you for the tip! I will try it with the equip requirement. (I haven't used it before.) I'm not really experienced at lunatic mode but I'll try it...
Okay, I'm at a loss.

I know I have to use this code from Equip Requirements (http://yanfly.moe/2016/02/27/yep-75-equip-requirements/)

<Custom Equip Requirement Condition>
if (user.name() === ‘Harold’) {
condition = true;
} else {
condition = false;
}
</Custom Equip Requirement Condition>


So I think I have to put this in every weapon which can be used by my class (Adventurer [class id: 8] in this case).


I think it has to look something like that, but I don't have experience in this:

<Custom Equip Requirement Condition>
if (user.class() === ‘Adventurer’) {
condition = true;
}
</Custom Equip Requirement Condition>


And now I have to add "dual wield" to this command, but how?


After that, it should grant the class Adventurer the ability to be dual wield if it equips this weapon so it can equip another weapon. I suppose...


However I think the next problem would be, if someone equips a sword/dagger/axe with this condition then they could equip a bow in the off hand.


Has anyone an idea for this problem and knows how I can add the dual wield command to this above-mentioned code?


Edit: I could also give the class the dual wield and then lock it if it uses a bow. But still, I don't know how I can add the command/trait "disable dual wield" :/
This should be doable without the use of plugins.  You can add the dual wield trait (and any weapon equip options) to any class you wish.  If the player switches classes, they will lose that ability.  Or, you could attach the trait to a permanent state and add/remove it as conditions change.  As for two-handed weapons, you have the right idea.  Just add an equip slot seal trait to each two-handed weapon and it will automatically remove items equipped in the shield slot, including dual wield weapons.


So basically:


-add the dual wield trait to classes, not weapons


-add an equip slot seal to weapons you want to be two-handed


That really should be all you need to do.
This should be doable without the use of plugins.  You can add the dual wield trait (and any weapon equip options) to any class you wish.  If the player switches classes, they will lose that ability.  Or, you could attach the trait to a permanent state and add/remove it as conditions change.  As for two-handed weapons, you have the right idea.  Just add an equip slot seal trait to each two-handed weapon and it will automatically remove items equipped in the shield slot, including dual wield weapons.


So basically:


-add the dual wield trait to classes, not weapons


-add an equip slot seal to weapons you want to be two-handed


That really should be all you need to do.





 






 







 

Yes, I added dual wield to my classes but if you add dual wield to the class, it has 2x type: "weapon" and if I add "seal equip: off-hand/shield" then there will be no effect because this equip type was replaced by the type "weapon" and when I say "seal equip: weapon" then you cannot equip the weapon anymore.


I need something that disables the second weapon slot when I use a bow/two-handed weapon. :/


Edit: I also tried to switch back from "dual wield" to "normal" when a bow is equipped but it doesn't work, I think the program handles classes > weapon for this case.
Oh, right.  Dual wield changes it to another weapon slot.  Been a while since I made a dual wielding character and just plain forgot.  My bad.
I don't get it.

I tried to do it the other way round: Since I cannot change the class' property from dual wield to "normal" again I tried to set all classes who cannot dual wield to "normal" and added in the weapon the dual wield trait. However, in this case, the weapon's property overwrites the class' trait and the class can dual wield if it equips the weapon although it has the trait "normal" and not dual wield.

It's like the program doesn't let you set up a dual wielding class which can also use two-handed weapons. That's a bit ridiculous.


Where's the logic? I cannot overwrite the class' dual wield trait with a weapon's trait if it's normal but a weapon with dual wield trait can overwrite a class' trait "normal"...


What weighs more now? -.-


Edit: I have another idea, you could add two equipment types to the weapon (Main-hand and off-hand), whereas "off-hand" is actually not the "normal" off-hand but a duplicate which is only used by the classes which dual wield. (Yep_EquipCore)
Then you could equip both slots with the weapons and seal the 2nd if you use a two-handed weapon. So the other classes which cannot use dual wield really cannot use dual wield.

 But... does anybody know a plugin which adds more weapon types to weapons and is compatible with Yanfly's plugins? :/


2.Edit: Another idea ~ Is it possible to restrict a weapon to be only equipped to the first slot? So it can't be equipped to the second slot no matter which type it is?
Okay, I'm at a loss.

I know I have to use this code from Equip Requirements (http://yanfly.moe/2016/02/27/yep-75-equip-requirements/)

<Custom Equip Requirement Condition>
if (user.name() === ‘Harold’) {
condition = true;
} else {
condition = false;
}
</Custom Equip Requirement Condition>


So I think I have to put this in every weapon which can be used by my class (Adventurer [class id: 8] in this case).


I think it has to look something like that, but I don't have experience in this:

<Custom Equip Requirement Condition>
if (user.class() === ‘Adventurer’) {
condition = true;
}
</Custom Equip Requirement Condition>


And now I have to add "dual wield" to this command, but how?



I think you'd want to simulate the dual wield logic in the custom equip requirement condition itself.  So you'd check the class, you'd check how many of the user's slots are currently empty, you'd check what types of weapons (one-hand, two-hand, etc.) were equipped in the slots that are equipped (non-empty), and you'd put all that logic together to determine whether it would be legal to equip this weapon at the current time (if legal, return true - otherwise return false, I think).


I've never worked with these plugins before, nor have I done much with Equips in MV, so it wouldn't be easy for me to provide an example of a properly logiced or syntaxed tag.  It could take me hours to figure out because of my lack of expertise in these specific areas... and that's not worth my time.  But I think it would be doable.  Hopefully someone with more knowledge in these specific areas can help you out in this thread, or maybe you can ask for help on the plugin somewhere.  Worst comes to worst, you could probably get help by offering a small commission in the Classifieds subforum (I think it requires 30 posts to see that subforum).
I ran into an issue like this myself when I was experimenting with the Plugins to see what I could do with them.  I had mocked up a rudimentary Job System like that of Final Fantasy V / Final Fantasy Dimensions/ Bravely Default, where you could equip skills learned from other classes.  So naturally, I chose to test if I could make a classic pair of FFV skills: the Knight's Two-Handed, and the Ninja's Dual-Wield.  


I figured out how to disable shields with Two-Handed.  And Dual-Wield worked fine as an equipped ability on its own.  But put them together... and you suddenly have a character Dual-Wielding 2H swords (presumably because the Two-Handed Ability only sealed shields, while Dual-Wield makes that available to another weapon).


In the end, I rolled with it, mainly for rule of cool.  I just tweaked my Two-Handed Ability to "Equip 2H Swords" and gave the swords higher attack power rather than an attack bonus for wielding a 1H weapon with two hands.  But I'd be interested to see how it could be done properly.
If you aren't over trying different plugins, you could give mine a shot.




If you tag your bow with <twohand>, it will only be equippable in the first equip slot (And nothing else could be put in the second.)


I'm not quite sure why Victor's plugin didn't work for you, but if it's because of YF compatibility issues, mine should work ok.
Dual wield can be done without script


Dual Wield.png


Edit: Sorry didn't read the previous replies, but you can still do it without script. You can change the character's class when they equip certain weapon (borrowing the concept of FF XIV)
If you aren't over trying different plugins, you could give mine a shot.





If you tag your bow with <twohand>, it will only be equippable in the first equip slot (And nothing else could be put in the second.)


I'm not quite sure why Victor's plugin didn't work for you, but if it's because of YF compatibility issues, mine should work ok.





 






 



Yeaaah! Thank you very much, I've tested it and it doesn't duplicate the items like the plugin from Victor.


If someone is looking for a nice plugin which can combine two-handed and dual wield in one class then this is the plugin! 🙂


I placed it above Yanfly's plugins since when I place it below it the interface would not work properly. 


~ Sorry that I didn't answer but I have changed the class a bit in order to make a playable demo first so that I get feedback for my game. Now I can experiment with my game again. I'm glad that I can make the class like I intended it 🙂


If there is a bug or something which causes problems with other plugins I'll let you know in your thread! ^^

Original thread: https://forums.rpgmakerweb.com/threads/class-with-two-handed-weapon-dual-wield.65672/