[RMMV] Skill available only if not using missile-type weapons?

Hello!

I think I'm posting this in the right category, if not, please feel free to move my post.

Is there a simple way to make a skill available only if the actor is holding a melee weapon?

I'm trying to make a skill available only if the actor is not using a ranged weapon (bow or crossbow). By default, RMMV allows me to select only 2 weapons... problem is that I have some 10+ type of weapons (swords, axes, hammers, halberd, bows, etc).

I was thinking perhaps use a common event on equip weapon?

Any help or tips would be appreciated.

PS: I have the full suite of Yanfly plugin if there's something in there I could use, even better.

Cheers!
I think you'll need a plugin for that.

Moved to JS Plugin Requests

it might be possible to track down the weapon ID of 1 handed / 2 handed weapon
ID start from 1, so if a weapon ID 1 Handed weapon with ID 4 (hammer) that it might
be possible, but I have no clue how to use the lunatic code.

if it's not possible with lunatic code, than a plugin is required.

I know Driftwood Gaming made a skill available only when they have a full armor set
equiped, else its removed (would only effect if the player exit the menu and re-enter the
menu to see it on the actor), but the same way can be done by weapons as well.

it wont be smooth to add, but its working otherwise.
I think I may have found a plugin that can cover what I intend to do. It's not super clean, but seems to work. I'll share the details below, in case someone else is trying to find a way to make this happen in their game.


The way I made this work is as follow:


Step 1 - Took down the list of all my weapon types:

ID... Type
1 ......Axes
2 ... Spears
3 ... Quarterstaffs
4 ... Daggers
5 ... Flails
6 ... Greatswords
7 ... Bows
8 ... Crossbows
9 ... Instruments
10 ... Swords
11 ... Warhammers
12 ... Others



Step 2 - Defined my groups

Group 1 (Melee) ......... Group 2 (Ranged)
1 ... Axes ..................... 7 Bows
2 ... Spears .................. 8 Crossbows
3 ... Quarterstaffs
4 ... Daggers
5 ... Flails
6 ... Greatswords
9 ... Instruments
10... Swords
11 ... Warhammers
12 ... Others


Step 3 - Add <weapon types: xx> to all the weapons notetags, except the first one of the group. For instance:

All of my axes: added nothing
All of my spears:
Wooden Spear <weapon types: 1>
Metal Spear <weapon types: 1>
Onyx Spear <weapon types: 1>
All of my quarterstaffs:
Wooden Staff <weapon types: 1>
Etc.

All of my bows: added nothing
All of my crossbows:
Light Crossbow <weapon types: 7>
Heavy Crossbow <weapon types: 7>



Step 4 - Select weapon requirements in my skill

Skills that require only melee: select ''Axes'' as a weapon requirement
Skills that require only ranged: select "Bows" as a weapon requirement



Step 5 - Since I'm using Yanfly item core plugin, I had to enable Midgame Note Parsing.




I will probably have to tweak this later on as I want to have skills only available when using blades, but I think this shall work.
If you're using Yanfly's SkillCore, you can just do this:
<Custom Requirement> if (user.isWtypeEquipped(1) || user.isWtypeEquipped(2) || user.isWtypeEquipped(3)) { value = true; } else { value = false; } </Custom Requirement>
I also made a plugin (still unreleased) to do exactly this, but it looks like you've already solved the issue?
I also made a plugin (still unreleased) to do exactly this, but it looks like you've already solved the issue?

Yes, but I’ll keep an eye out for your plugin if it comes out. I would rather use something that works as intended than something that I had to modify (an ugly hack job, really) to suit my needs, not knowing if it will interfere with other plugins down the road.
Will a Custom Requirement tag using Skill Core not work for you?
The Custom Requirement tag I proposed would be pretty safe and not interfere with other plugins, nothing I can think of anyway. Yanfly plugins are generally pretty compatible overall.

This thread is being closed, due to being solved. If for some reason you would like this thread re-opened, please report this post and leave a message why. Thank you.

Original thread: https://forums.rpgmakerweb.com/threads/rmmv-skill-available-only-if-not-using-missile-type-weapons.122332/