Is there a Yanfly plugin that alters weapon requirements for skills?

For some reason I thought I saw this feature mentioned in one of Yanfly's videos, but now I can't find what plugin does it. Maybe I'm remembering Skill Core wrong, since you can add new requirements to skill using Skill Core via Lunatic Mode. IDK

What I'm looking for is a plugin that allows me to set additional weapon requirements for skill, including "No Weapon" (i.e. the skill can only be used unarmed). What I'm trying to do is create a skill that can be used if the actor is either unarmed or has a "Gloves" weapon equipped but will not work with any other weapon.

If there is a good plugin for doing this (Yanfly or not), please link here. Also, if there is a plugin like this that comes with the Steam version of RPG Maker MV, let me know! I don't want to download a plugin if I already have a good one that does the job.
There's equip requirements which does this for equipment. I don't think there's a skill one.... THAT SAID I think you could kinda do this with Action Sequences. Worth a shot.

[EDIT]
wait wait wait, I think you can do this with skill core's Lunatic mode.
The sample code below only shows the skill if the user's level is greater than 50.
Code:
Skill Notetag:
<Custom Show Eval>
if (user.level > 50) {
visible = true;
} else {
visible = false;
}
</Custom Show Eval>

So yes, actually this can be done with skill core. Check the help file or the plugin's page http://yanfly.moe/2015/10/13/yep-8-skill-core/ for the details~! 😀
You can just use a <custom requirement> tag if you want to disable the skill without hiding it, too.

There's also the Truthseeker Tips & Tricks, which has sample code for detecting the equipped weapon type- unarmed would be checking if the "equipped weapon" doesn't exist.
There's equip requirements which does this for equipment. I don't think there's a skill one.... THAT SAID I think you could kinda do this with Action Sequences. Worth a shot.

[EDIT]
wait wait wait, I think you can do this with skill core's Lunatic mode.
The sample code below only shows the skill if the user's level is greater than 50.
Code:
Skill Notetag:
<Custom Show Eval>
if (user.level > 50) {
visible = true;
} else {
visible = false;
}
</Custom Show Eval>

So yes, actually this can be done with skill core. Check the help file or the plugin's page http://yanfly.moe/2015/10/13/yep-8-skill-core/ for the details~! 😀

I already look through Skill Core's help file. I'm not trying to hide the skill, I'm trying to restrict it. Like, make it so that the skill always shows in the list but will only work if the character has either a glove or nothing equipped. I'll see if I can do it with Skill Core, but I was hoping for a plugin that would just let me use note tags like:
<Require Weapon: Glove>,
<Require Weapon: none>,
<Require Weapon: Glove, none>, or
<Require Weapon>
Glove
none
</Require Weapon>.
This isn't too important, I just thought it would be good to have punching skills that require a character to either be unarmed or wearing gloves.
There is probably some IF statement I could use in Lunatic Mode to restrict the usage but if I have to go that far I'd rather just set it to require Gloves.
You can just use a <custom requirement> tag if you want to disable the skill without hiding it, too.

There's also the Truthseeker Tips & Tricks, which has sample code for detecting the equipped weapon type- unarmed would be checking if the "equipped weapon" doesn't exist.

I know JavaScript, but I'm not familiar with all of the functions/classes/variables/etc that are built into MV, which is why I haven't tried to make my own plugins yet. Do you know what I would have to put in the IF statement to check what weapon the character has equipped?
Copy-pasted from the Tips & Tricks I linked:
Code:
// Set the default condition to false.
condition = false;
// Check if the party is in battle.
if ($gameParty.inBattle()) {
  // Check if the user is an actor.
  if (user.isActor()) {
    // Get the sword weapon-type ID
    var swordTypeId = 2;
    // get the user's currently equipped weapons.
    var weapons = user.weapons();
    // Loop through each weapon
    for (var i = 0; i < weapons.length; ++i) {
      // Get the currently looped weapon
      var weapon = weapons[i];
      // Check if the weapon exists and if the weapon's type is a sword
      if (weapon && weapon.wtypeId === swordTypeId) {
        // Set the condition to true
        condition = true;
      }
    }
  }
}

Just take this and replace condition with value as your variable, since that's what a <custom requirement> tag expects, and you'll have one that detects swords.

From there, you should be able to make it detect gloves, and if a particular weapon doesn't exist, then you have an empty slot.

You might also be able to remove the $gameParty.inBattle() if you already set the skill to "only in battle," but that should be a simple experiment to make sure it can't be used from the map menu.
Could somebody help with my trance state question?
Copy-pasted from the Tips & Tricks I linked:

...

Just take this and replace condition with value as your variable, since that's what a <custom requirement> tag expects, and you'll have one that detects swords.

From there, you should be able to make it detect gloves, and if a particular weapon doesn't exist, then you have an empty slot.

You might also be able to remove the $gameParty.inBattle() if you already set the skill to "only in battle," but that should be a simple experiment to make sure it can't be used from the map menu.

The script isn't working. I may have done something wrong or the script might just not work. I currently have this:
Code:
<Custom Requirement>
// Set the default condition to false.
value = false;
// Check if the user is an actor.
if (user.isActor()) {
  // Get the sword weapon-type ID
  var gloveTypeId = 11;
  // get the user's currently equipped weapons.
  var weapons = user.weapons();
  // Loop through each weapon
  for (var i = 0; i < weapons.length; ++i) {
    // Get the currently looped weapon
    var weapon = weapons[i];
    // Check if the weapon exists and if the weapon's type is a sword
    if (weapon && weapon.wtypeId === gloveTypeId) {
      // Set the condition to true
      value = true;
    }else if (weapon && weapon.wtypeId === null) {   //I also tried "0" in place of "null"
      value = true;
    }
  }
}
</Custom Requirement>
I tried changing the ELSE IF statement to just an ELSE statement and it also didn't work, so there is something with this script that just isn't working. Let me know if you see anything that I need to fix. Like I've mentioned, it's not that big a deal, but it would be nice to get it working.
Debugging tip if you haven't tried it already- add this bit before you go into the if block, or so:
Code:
if (weapon) {
  console.log("weapon "+i+" type = "+weapon.wtypeId);
} else {
  console.log("weapon "+i+" does not exist");
}

It's some really simply print statement debugging- just open up a skill window in battle back out, and check the console. It should give you one of three results, when you test your problem case:
  1. The first statement happens, and you can find the wtypeId of bare hands
  2. The second statement happens, and you know that a bare hand has no weapon structure, so 'weapon' will be null.
  3. It skips over the bare hand completely, and the next weapon shows up as if there were no slot- in this case, checking for bare hands means seeing if they have fewer weapons than slots. Or checking if they have 0 weapons equipped.
  4. Or something shows up undefined or otherwise in error and we can debug further.
The only messages I'm getting are three "Failed to load resource: net::ERR_FILE_NOT_FOUND" errors for pixi.js.map, pixi-tilemap.js.map, & pixi-picture.js.map. This repeats every time I open the debug window (except for the first time). I'm not sure if this is even related; actually, I'm not even sure if I'm opening the right window. The window that is showing these messages opens when I hit F8.
@Doktor_Q
Does that code I'm trying to use require any other plugins aside from Core Engine & Skill Core?
The only messages I'm getting are three "Failed to load resource: net::ERR_FILE_NOT_FOUND" errors for pixi.js.map, pixi-tilemap.js.map, & pixi-picture.js.map. This repeats every time I open the debug window (except for the first time). I'm not sure if this is even related; actually, I'm not even sure if I'm opening the right window. The window that is showing these messages opens when I hit F8.

Those message imply something else in your project is failing to load. Repeatedly. I'd look and see if you tried to remove any standard image resources entirely. It's probably unrelated, to this- the code I gave you is just general javascript you put in a skill core tag, and the debugging is just javascript raw.

Original thread: https://forums.rpgmakerweb.com/threads/is-there-a-yanfly-plugin-that-alters-weapon-requirements-for-skills.76648/