Shield as a Weapon

Gregaur

Veteran
Veteran
Joined
Jan 3, 2017
Messages
134
Reaction score
20
First Language
french
Primarily Uses
RMMV
Hello everyone,

For my game player can change weapon in combat. I use the plugin you can find in the original plugin list (or something like this). I can't use the Yanfly plugin cause it is not compatible with my BattleHUD.

It almost work nicely but I have a problem.

I have a one handed/two handed system of weapon. Some weapon need two hands like Spears. So if, in the middle of the fight I decide to change from a two handed weapon to a one handed weapon, I have a problem.
Indeed the Change weapon plugin only check for the weapon list. So I can equip a one handed weapon, but I can't equip the shield with it.

So I was wondering. Is it possible to make the shield being in this weapon list ?

Anyway, thanks a lot and stay safe !
 

ShadowDragon

Veteran
Veteran
Joined
Oct 8, 2018
Messages
2,788
Reaction score
977
First Language
Dutch
Primarily Uses
RMMV
you might try this plugin because there are ppl asking for those as well.
which is a dual weapon system, to allow 2 weapons, 1 weapon + shield into combat and use them.

there is a better one as well for dual wield, but that is a paid plugin.

if there are other ones for free, no clue.
 

Gregaur

Veteran
Veteran
Joined
Jan 3, 2017
Messages
134
Reaction score
20
First Language
french
Primarily Uses
RMMV
you might try this plugin because there are ppl asking for those as well.
which is a dual weapon system, to allow 2 weapons, 1 weapon + shield into combat and use them.

there is a better one as well for dual wield, but that is a paid plugin.

if there are other ones for free, no clue.
Hello !

I am sorry the site didn't alert me that your answered me !

I am actually using the Ramza plugin. But I didn't see a way to turn a shield into a weapon. Maybe I am missing something....
 

ShadowDragon

Veteran
Veteran
Joined
Oct 8, 2018
Messages
2,788
Reaction score
977
First Language
Dutch
Primarily Uses
RMMV
I dont have the plugin, so I can't help you, the only thing I think off,
if you have Weapon category and Weapon2 category, that weapon2 includes
a shield to be used? but I have no idea how to make it different though.

there is a demo included if you bought it, so the answer might be somewhere
in there, or someone else can help you if those 2 cant do what you want.

Ramza's plugin should work, bu I cant read the description how it works,
 

ramza

Lunatic Coder
Veteran
Joined
Jan 28, 2013
Messages
767
Reaction score
476
First Language
English
Primarily Uses
RMMV
Hello !

I am sorry the site didn't alert me that your answered me !

I am actually using the Ramza plugin. But I didn't see a way to turn a shield into a weapon. Maybe I am missing something....
I wouldn't recommend setting a shield as a weapon with my plugin. Many of the dual wielding functions check to see if the offhand item is a shield, and they do so by checking the etypeId of the item in that slot. If you make shields a weapon, this check won't work right, and all kinds of stuff will go wrong. I'll take a quick look at that weapon change in battle plugin and see if I can tweak it to do what you want.

@Gregaur I have managed to get that window to show shields in the offhand slot, as they should, but there's an issue with dual wielding actors on this window, as the dual wield plugin does not consider an actor as dual wield type in the battle scene if they are wearing a shield. This results in some wonkiness on this scene, where a dual wield actor wearing two weapons can swap the second weapon out for a shield, but can no longer equip weapons in the shield slot until he removes the shield.

Additionally, the mainhand/offhand attack display on the tiny parameters window is broken real bad. Since you didn't mention this as a problem, maybe you're someone who doesn't have split attack enabled for this plugin, or maybe one of the rare users who uses it and doesn't even dual wield!

At any rate, if you save the below code to a blank .js file and load it in your plugin manager after the ChangeWeaponOnBattle plugin, it should work.

JavaScript:
Window_TinyEquipSlot.prototype.select = function(index) {
    Window_Selectable.prototype.selecte.call(this, index)
    if (this._itemWindow) {
        this._itemWindow._slotId = this._index
        this._itemWindow.refresh()
    }
};
Edit2: As you can see from the code snippet here, the issue was that the equipslot window wasn't passing it's index to the equipItemWindow. My plugin modified the item window to allow shields to be shown in the offhand slot, but did so using the index of the slot window. Since that was missing in this scene, with my plugin enabled, the offhand slot would simply never allow anything to be equipped in it (by dual wielding actors, anyway).
 
Last edited:

Gregaur

Veteran
Veteran
Joined
Jan 3, 2017
Messages
134
Reaction score
20
First Language
french
Primarily Uses
RMMV
@ramza

Hello !

First, thank you for taking the time to answer and to find a solution.

I think I may do something wrong.

I copy your code in a blank file and load it in my plugin list. But I still have the same problem.

I tried few situation with two characters :

- Hero SH (Single Hand)
He can use 1H sword with a shield
He can use 2H axe

- Hero DH (double Hand)
He can use 1H sword with a second 1H sword (the same weapon)
He can use 1H sword with a shield
He can use 2H axe

Situation 1
If I start the fight with both heroes with 1 sword et 1 shield :
I can change HeroSH with a 2H axe, it will remove Sword and shield.
I can change HeroDH with a 2H axe it will remove Sword and shield.

then
I put 1 1H sword in HeroSH and Hero DH it correctly take off the 2H axe and replace it with the 1H sword.

but then, for both heroes If I want to add somethings in the second hand, I can see every weapon except shield. If i select a weapon that can't be equip (like a 1H sword for HeroeSH or a 2H axe for both of them) it will just delete the weapon.

I think they don't work well together :s Maybe I should not keep this feature but it was a big part of my battle system.
 

ramza

Lunatic Coder
Veteran
Joined
Jan 28, 2013
Messages
767
Reaction score
476
First Language
English
Primarily Uses
RMMV
I only briefly tested it in my test project and only with a DW actor, but it did work. Perhaps the load order is affecting it?

I put the ChangeWeaponOnBattle plugin below YEP_EquipCore in the load order. My DW Menu Extension should be loaded sometime after that, closer to the bottom of the load order. Maybe try putting the code snippet below even that? When I was testing, I just put the new function directly in the ChangeWeaponOnBattle plugin and it seemed to work. I've attached the modified version here.

I just tested again and my non-dualwielding actor does not see weapons in the offhand list, and both can see a shield.
 

Attachments

Gregaur

Veteran
Veteran
Joined
Jan 3, 2017
Messages
134
Reaction score
20
First Language
french
Primarily Uses
RMMV
@ramza
It works ! Thank you very much ! It even fixe my problem with disappearing weapon !

The only "thing" I notice is, if my Dual Wielding Heroes use 1H+Shield, when I want to change the shield with a weapon the weapon is not in the list. But if I choose, take off the shield and then click again to choose something for the second hand I can see 1H sword and Shield. I can totally live with that !

Anyway, thank you very much for your help, it was a terrible issue I had !

Your work helps me a lot to add some "deep" gameplay to my game !
 

ramza

Lunatic Coder
Veteran
Joined
Jan 28, 2013
Messages
767
Reaction score
476
First Language
English
Primarily Uses
RMMV
Yeah, that is a problem I identified, the cause is that in battle, an actor is only considered dual wield type by my dual wield plugin of they are currently dual wielding weapons. Once they equip a shield, they are not considered dual wield type again unless you remove it first.

I can correct this in an update. I used the battler.isDualWield() function when I should have made my own function for that instead, which leads to compatibility problems like this happening.
 

Gregaur

Veteran
Veteran
Joined
Jan 3, 2017
Messages
134
Reaction score
20
First Language
french
Primarily Uses
RMMV
@ramza
I think my need is very specific and you don't need to spend time on that :)
 

ramza

Lunatic Coder
Veteran
Joined
Jan 28, 2013
Messages
767
Reaction score
476
First Language
English
Primarily Uses
RMMV
@ramza
I think my need is very specific and you don't need to spend time on that :)
Since I was messing around in the dual wield plugin to fix a bug in it, I just uploaded a new version you should check out. It removes the logic that makes the engine think an actor isn't dual wield type in battle when they're using a shield. Like I said above, I should have originally made my own function for this check, instead of overwriting the default dual wield check, so I went in and corrected it.

This will correct the problem where actors can't swap directly from a shield to a weapon without first unequipping the shield. It should also make any other plugins that allow equipment swapping in battle to be a bit more compatible.
 

Users Who Are Viewing This Thread (Users: 0, Guests: 1)

Latest Threads

Latest Posts

Latest Profile Posts

Was stressing about this plugin earlier, but pretty happy with how its looking now! Purple makes it pop more too!! :)
A friend requested me to do a pfp for his twitch channel, so far he approved one of my sketches, so going to digital now. The style he's looking for is quite different from my usual, hopefully I can get it right... :kaoback:
I am so hyped! A new post update and im anxious to see reactions..eeeeeeee
When a youtuber plays your project or game made by you using MAKERs, you will just be awe struck

Forum statistics

Threads
105,478
Messages
1,014,003
Members
137,117
Latest member
Deli
Top