RMMV (MV) How do you make right hand left hand weapon equip system?

Yiggityyoo

Warper
Member
Joined
May 12, 2021
Messages
4
Reaction score
1
First Language
English
Primarily Uses
RMMV
I hope I posted this is the right area..
I am trying to find out how to to make it so specific weapons can be equip in more than one slot (left hand or right hand).

I renamed weapon slot to "Right hand", shield slot to "Left Hand", my trouble is finding out how to make it so a weapon (dagger) can be equip in either slot, and how to make it so having certain weapons equip (two handed weapons) will force the left hand to be empty.

I have Yanfly's EquipCore so that my characters can wear multiple rings, and this makes it so any ring can be worn in any of the multiple ring slots EquipCore creates. This wont work for weapons because it simply duplicates the weapon slot, meaning there is no limitations on what weapon fits there.

I have a common event that runs every time a menu is closed that changes the character sprite to match the clothes/armor they are wearing. I think I could put an IF THEN condition in there for every single two handed weapon, saying if this weapon is equip, unequip whatever is in left hand slot. But that would get very repetitive as the list of weapons grows, and I am at a loss for thinking up any possible way to make the daggers wieldable in both slots.

If anybody has any ideas, suggestions, or know of any plugins that could help me achieve this please leave a comment down below. I would really appreciate any help :)
Thanks to those of you who took the time to read through this!
 

ramza

Lunatic Coder
Veteran
Joined
Jan 28, 2013
Messages
938
Reaction score
585
First Language
English
Primarily Uses
RMMV
I hope I posted this is the right area..
I am trying to find out how to to make it so specific weapons can be equip in more than one slot (left hand or right hand).

I renamed weapon slot to "Right hand", shield slot to "Left Hand", my trouble is finding out how to make it so a weapon (dagger) can be equip in either slot, and how to make it so having certain weapons equip (two handed weapons) will force the left hand to be empty.

I have Yanfly's EquipCore so that my characters can wear multiple rings, and this makes it so any ring can be worn in any of the multiple ring slots EquipCore creates. This wont work for weapons because it simply duplicates the weapon slot, meaning there is no limitations on what weapon fits there.

I have a common event that runs every time a menu is closed that changes the character sprite to match the clothes/armor they are wearing. I think I could put an IF THEN condition in there for every single two handed weapon, saying if this weapon is equip, unequip whatever is in left hand slot. But that would get very repetitive as the list of weapons grows, and I am at a loss for thinking up any possible way to make the daggers wieldable in both slots.

If anybody has any ideas, suggestions, or know of any plugins that could help me achieve this please leave a comment down below. I would really appreciate any help :)
Thanks to those of you who took the time to read through this!
You can mostly achieve this using the Equip Requirements plugin from yanfly. Basically, you can use the <Custom Equip Requirement Condition> note tag to check if the player is trying to equip an item in weapon slot 0 or 1 (the right or left hand). You can add a similar check to weapons that can only be placed in the left hand to check if the weapon in the right hand exists, and is one handed, as well, which should prevent you from equipping a left hand weapon when a two-hander is equipped.

You'd wanna look at SceneManager._scene._slotWindow.index() for determining which slot the player is trying to equip the weapon into. That would return 0 on the right hand slot, and 1 on the left hand. Then you wanna set the actor to dual wield type in the database, or give them two weapon slots via equip core.

The problem with this solution is that you need to work a lot of logic into those note tags, to check what is or isn't equipped, and on each weapon, plus if you set the actor to dual wield, or give them two weapon slots, they'll never be able to put a shield in their left hand.

There are several Dual Wield plugins available for RMMV that do allow you to specify certain weapons as only being wieldable in the offhand, or disallowing weapons in the offhand, or allowing shields to still be equipped in the second weaponslot. The two I linked in that sentence are free, although Victor's probably doesn't work very well with Yanfly's plugins. A third option is my dual wield plugin, which is not free, and might do some extra stuff you might not be interested in. Check it out though.
 

Yiggityyoo

Warper
Member
Joined
May 12, 2021
Messages
4
Reaction score
1
First Language
English
Primarily Uses
RMMV
You can mostly achieve this using the Equip Requirements plugin from yanfly. Basically, you can use the <Custom Equip Requirement Condition> note tag to check if the player is trying to equip an item in weapon slot 0 or 1 (the right or left hand). You can add a similar check to weapons that can only be placed in the left hand to check if the weapon in the right hand exists, and is one handed, as well, which should prevent you from equipping a left hand weapon when a two-hander is equipped.

You'd wanna look at SceneManager._scene._slotWindow.index() for determining which slot the player is trying to equip the weapon into. That would return 0 on the right hand slot, and 1 on the left hand. Then you wanna set the actor to dual wield type in the database, or give them two weapon slots via equip core.

The problem with this solution is that you need to work a lot of logic into those note tags, to check what is or isn't equipped, and on each weapon, plus if you set the actor to dual wield, or give them two weapon slots, they'll never be able to put a shield in their left hand.

There are several Dual Wield plugins available for RMMV that do allow you to specify certain weapons as only being wieldable in the offhand, or disallowing weapons in the offhand, or allowing shields to still be equipped in the second weaponslot. The two I linked in that sentence are free, although Victor's probably doesn't work very well with Yanfly's plugins. A third option is my dual wield plugin, which is not free, and might do some extra stuff you might not be interested in. Check it out though.

I could not have asked for a better, more in depth response. You are honestly the greatest. I'm probably going to pick up your plugin, it looks exactly like what I need.
I have one question though, I read through your plugin's page and I did not see anything on this, forgive me if I missed it. So for example take two characters, one is stronger and the other is weaker, would I be able to make it so all or specific one handed swords are wielded as a two handed sword for the weaker character?
 

ramza

Lunatic Coder
Veteran
Joined
Jan 28, 2013
Messages
938
Reaction score
585
First Language
English
Primarily Uses
RMMV
I could not have asked for a better, more in depth response. You are honestly the greatest. I'm probably going to pick up your plugin, it looks exactly like what I need.
I have one question though, I read through your plugin's page and I did not see anything on this, forgive me if I missed it. So for example take two characters, one is stronger and the other is weaker, would I be able to make it so all or specific one handed swords are wielded as a two handed sword for the weaker character?
That isn't something that's included in the plugin by default, no. There are some work arounds you could do to make it sort of work that way, though.
You could make the second actor not able to dual wield at all, that way all weapons cannot be wielded with another, although that'd stop them from being able to dual wield daggers, per se.

The plugin disable state, which, when active on a battler stops their second attack from happening, though it doesn't stop them from being able to slot a second weapon in their offhand. You could use YEP_AutoPassiveStates to make it so the disable state is a passive on the weaker actor, with the condition that it's only active if there is a certain type of weapon in the mainhand.

Alternatively, the Monkeygrip extension can allow an actor to wield a two handed weapon in one hand (or both hands, optionally) so you could use that the make the swords two handed for everyone, and give monkeygrip to the strong actor so he can still dual wield them, or use them with a shield.
 

Yiggityyoo

Warper
Member
Joined
May 12, 2021
Messages
4
Reaction score
1
First Language
English
Primarily Uses
RMMV
That isn't something that's included in the plugin by default, no. There are some work arounds you could do to make it sort of work that way, though.
You could make the second actor not able to dual wield at all, that way all weapons cannot be wielded with another, although that'd stop them from being able to dual wield daggers, per se.

The plugin disable state, which, when active on a battler stops their second attack from happening, though it doesn't stop them from being able to slot a second weapon in their offhand. You could use YEP_AutoPassiveStates to make it so the disable state is a passive on the weaker actor, with the condition that it's only active if there is a certain type of weapon in the mainhand.

Alternatively, the Monkeygrip extension can allow an actor to wield a two handed weapon in one hand (or both hands, optionally) so you could use that the make the swords two handed for everyone, and give monkeygrip to the strong actor so he can still dual wield them, or use them with a shield.
I like the monkeygrip idea, that sounds like it would work the best. Though this raises a few more questions.

I use yanfly's utility common events plugin so every time the menu is closed a common event runs a long conditional branch for each character, narrowing down what they are wearing and wielding until it gets to a dead end with a change character sprite command for their exact combination of armor and weapon(s). This also selects SV battler sprites. (There's probably a better way to do this, probably with a plugin)

Looking at the common event I have set up, conditional branches don't seem to have be ability to check if a slot is empty, it can only check if an actor has a specific item equipped in a slot. Which works for narrowing down what armor is worn. However I'm not sure how I would get the game to detect how a weapon is held in order to apply the proper sprite sheet, I could only have the conditional branch look to see if the weapon is in the weapon slot. Do you have any suggestions on how I might get the game to detect how a weapon is held and apply the proper sprite sheet?

I would like it done like this because I'm not using the default weapon display, the way that SV battler weapons only appear when they strike bugs me. I want the weapons built into the SV battler sprites, but to do this I need the game to know how a weapon is being wielded so it can change the sprite sheet to the one with the corresponding 1hand or 2hand animations.
 

ramza

Lunatic Coder
Veteran
Joined
Jan 28, 2013
Messages
938
Reaction score
585
First Language
English
Primarily Uses
RMMV
I like the monkeygrip idea, that sounds like it would work the best. Though this raises a few more questions.

I use yanfly's utility common events plugin so every time the menu is closed a common event runs a long conditional branch for each character, narrowing down what they are wearing and wielding until it gets to a dead end with a change character sprite command for their exact combination of armor and weapon(s). This also selects SV battler sprites. (There's probably a better way to do this, probably with a plugin)

Looking at the common event I have set up, conditional branches don't seem to have be ability to check if a slot is empty, it can only check if an actor has a specific item equipped in a slot. Which works for narrowing down what armor is worn. However I'm not sure how I would get the game to detect how a weapon is held in order to apply the proper sprite sheet, I could only have the conditional branch look to see if the weapon is in the weapon slot. Do you have any suggestions on how I might get the game to detect how a weapon is held and apply the proper sprite sheet?

I would like it done like this because I'm not using the default weapon display, the way that SV battler weapons only appear when they strike bugs me. I want the weapons built into the SV battler sprites, but to do this I need the game to know how a weapon is being wielded so it can change the sprite sheet to the one with the corresponding 1hand or 2hand animations.
As a matter of fact, you can check that in an if condition, you just have to use the script box instead of the normal buttons you'd use.

You can use $gameActors.actor(x).equips()[1] === null which will return true if the left hand is empty. Alternatively, you can use equips()[0] to check the right hand. You could also check $gameActors.actor(x).equips()[0] && $gameActors.actor(x).equips()[0]._isTwoHanded === true to see if they've got a weapon in their right hand, AND that it is twohanded.

And you're right, there probably is a better way to do it, but since it works, why mess with it?
 

Yiggityyoo

Warper
Member
Joined
May 12, 2021
Messages
4
Reaction score
1
First Language
English
Primarily Uses
RMMV
Thank you for your time responding to all these questions. I'm definitely sold on your plugin and its extensions. Sounds like they will accomplish everything I want done. Going to pick them up tomorrow, and I will make sure your name gets a spot high up in the credits. Thanks again for all the help!
 

Latest Threads

Latest Profile Posts

Looks like I'm going to have to cancel another game.
For now it is in testing phase: Changing the game icon from Rm2k/2k3 without needing to edit the executable.
Rm2k-DinChangeIcon.png
When there's a will, there's a lifehack. :ninja:

Before i mess with battle UI further, does it look decent enough? :hswt:
Free MZ? That's good. I should go try it out then.

Forum statistics

Threads
112,528
Messages
1,068,945
Members
146,209
Latest member
ebivy
Top