MV Skillcore custom requirement

I'm working with Yanfly's "skill core" plugin. I need to make sure that for a skill to be cast by the character, the character must have armor. I saw that in the guide there is the following code to insert in the notes:

<Custom requirement>
if ($ gameParty.gold ()> 1000) {
value = true;
} else {
value = false;
}
</ Custom requirement>
Well, instead of "$ game.Party.gold", how do I write that that armor is needed?
I have already asked something similar, a user replied but unfortunately the code he wrote me does not work. I can't tell him because a moderator has closed the thread.
The code he recommended to me is:
<Custom requirement>
value = user.isEquipped ($ dataArmors [1]);
</ Custom requirement>
By "it doesn't work" I mean that regardless of whether the character is equipped with this armor or not, he can still cast the ability.
I then tried to rewrite the original code by replacing "$ game.Party.gold" with "$ gameParty.numItems ($ dataArmors [1])", but that doesn't work either. That is, instead of "param1" I wrote 1, that is "the indicator" of the necessary armature (in the database this armature corresponds to the first row). As expected, if the character doesn't equip it, he can't cast the ability, but, even when he wears it, the ability can't be cast. So what is the right code to enter?
I have already asked something similar, a user replied but unfortunately the code he wrote me does not work. I can't tell him because a moderator has closed the thread.
First of all, your thread https://forums.rpgmakerweb.com/index.php?threads/help-for-skillcore-plugin.143389/ got closed for being a duplicate of your very own thread https://forums.rpgmakerweb.com/index.php?threads/skill-core-custom-requirement.143381/ that you posted ca. 2 hours earlier. The original thread is still open and you can ask clarifying questions there. As you have received the same answer from the same user in both threads it shouldn't matter in which of them you ask.

Secondly, please make sure you copy the code you received as an answer exactly as provided. I noticed how you used $ dataArmors, $ gameParty or even $ game.Party in your post. These objects do not exist and you should see an undefined error if you open the console with F8. The correct objects would be $dataArmors and $gameParty without the whitespace after the $.
Ok I didn't know a thread was still open, so I reopened it. I actually opened two of them because I had problems with one. However, I only put the space here in the thread request, but not in the game
This should do it. Assuming you want the skill to require a specific piece of armor to be equipped.

JavaScript:
<Custom Requirement>
if (user.isEquipped($dataArmors[1])) {
  value = true; // enable skill
} else {
  value = false; // disable skill
}
</Custom Requirement>

If you want it to require ANY piece of armor you can use this:

JavaScript:
<Custom Requirement>
if (user.armors().length > 0) {
  value = true; // enable skill
} else {
  value = false; // disable skill
}
</Custom Requirement>
dont add extra spaces that dont exist in the codes already provided as extra spaces will break it.
the code you say was provided from the other thread would have work if you didnt have those extra spaces (although it would only work for 1 exact piece of armor, since that doesnt look like its armor 'type' or just wearing armor in general)
@Giator

It doesn't work because I copied your notetags and pasted over the code you typed in your first post:
JavaScript:
<Custom requirement>
if ($ gameParty.gold ()> 1000) {
value = true;
} else {
value = false;
}
</ Custom requirement>

<Custom requirement> should have been <Custom Requirement>
</ Custom requirement> should have been </Custom Requirement>

My bad! 😮

There must be something wrong with your text processing software if you simply copied that exact same code snippet over from Skill Core (YEP) and then it managed to mangle it to that extent. If that's the case, even if the guys here provide you with correct code and you simply copy and paste them you'll still have issues.
@wolfr136a1
I understand, thank you very much for the clarification! Actually I didn't notice that copying and pasting the text changed it. I didn't think that for such a small thing the program wouldn't process the code, so to speak. Thanks again for the info! However, know that it is not your fault, but mine as I missed what was said before. The fact is that I write the message first on the translator and then I copy it in English (in this case I also copied the code)
@wolfr136a1
I understand, thank you very much for the clarification! Actually I didn't notice that copying and pasting the text changed it. I didn't think that for such a small thing the program wouldn't process the code, so to speak. Thanks again for the info! However, know that it is not your fault, but mine as I missed what was said before. The fact is that I write the message first on the translator and then I copy it in English (in this case I also copied the code)
Well, did it work now? If still no we'll work at it. 😉
Javascript is case sensitive so wrong capitalizations (as well as spaces) will screw over otherwise perfectly fine code.

Edit: @Giator, I think you should close this thread or the other open thread as they're discussing the same issue. Otherwise the mods might get pissed and do that for you.

Edit: @Giator, for us to better help you with your problem, can you be more specific about what you require?
1. Should the CHARACTER EQUIP a specific armor with armor ID#1? This means the character is wearing the armor ID#1. The code I gave you previously should work:
JavaScript:
<Custom Requirement>
value = user.isEquipped($dataArmors[1]);
</Custom Requirement>
Just be careful with the spaces and capitalizations.
2. Should the PARTY have in its INVENTORY a specific armor with armor ID#1? This means party has armor ID#1 and doesn't necessarily mean anybody is wearing it.
3. Should the CHARACTER EQUIP a specific ARMOR TYPE? Armor types are under Types > Armor Types. They include 01 General Armor, 02 Magic Armor, 03 Light Armor, etc.
4. Should the CHARACTER EQUIP a specific EQUIPMENT TYPE? Equipment types are under Types > Equipment Types. Armors will include 02 Shield, 03 Head, 04 Body and 05 Accessory.
5. Do you require something else entirely?
Sorry, but it still doesn't work. Most likely, as you said, I didn't explain myself well, so here are some screenshots:

View attachment 211478
Here there is the famous "first amor". Now, I'd like this armor to be equipped, but doesn't "dataArmors" refer to the first armor in the "Types of Armor" section? In that case the Custom Requirement command would be useless.

View attachment 211480

SORRY FOR THE ITALIAN TERMINOLOGY OF THE DATABSE, BUT ITALIAN IS MY MOTHER LANGUAGE. HOWEVER WE ARE ONLY INTERESTED IN SOME THINGS, SO I THINK IT IS NOT A PROBLEM.
So, to then cast the "Fire" ability, the character must equip "Fire Armor". By writing the code, however, this does not happen. Now I've tried again, and the actor can independently cast the ability if I enter the code:
<Custom Requirement>
value = user.isEquipped ($ dataArmors [1]);
</ Custom Requirement
Instead he fails to cast the ability if the code is:
<Custom Requirement>
if (user.isEquipped ($ dataArmors [1])) {
value = true;
} else {
value = false;
}
</ Custom Requirement>
I can't figure out what's wrong. However, if it fails to resolve, I will find another system. In any case, thanks anyway for your help and patience
im curious as to why cant just put 'add skill: fire' as a default engine trait on the armor
yes, I thought about it, but because of the game I'm making I don't know if it can go well ... oh well I think I'm at the point, I'll accept it. Thanks everyone for the help
doesn't "dataArmors" refer to the first armor in the "Types of Armor" section?
No. Everyone who has given you this solution is correct, the $dataArmors array is listing the armor objects as you see in the Armor tab of your database.
<Custom Requirement>
value = user.isEquipped ($ dataArmors [1]);
</ Custom Requirement
Instead he fails to cast the ability if the code is:
<Custom Requirement>
if (user.isEquipped ($ dataArmors [1])) {
value = true;
} else {
value = false;
}
</ Custom Requirement>
You still have multiple places where the syntax is wrong. This is not valid JavaScript code.

Go back to the code you were originally given and copy it again - you have extra spaces all over, each of which is breaking the code.
user.isEquipped ( needs to be user.isEquipped(
$ dataArmors [1] needs to be $dataArmors[1]
that's just the first line.

You still have a space in </Custom Requirement> (and missing one angled bracket), which was already fixed for you above by wolf.

The single line of code you quoted in your first post will work perfectly, if you just copy it the way it was given to you the first time.
No. Everyone who has given you this solution is correct, the $dataArmors array is listing the armor objects as you see in the Armor tab of your database.
Perfect, I just wanted to clarify and be sure of this point.
Hai ancora più punti in cui la sintassi è sbagliata. Questo non è un codice JavaScript valido.

Torna al codice che ti è stato originariamente fornito e copialo di nuovo: hai spazi extra dappertutto , ognuno dei quali sta rompendo il codice.
user.isEquipped (deve essere user.isEquipped(
$ dataArmors [1]deve essere $dataArmors[1]
questa è solo la prima riga.

Hai ancora uno spazio </Custom Requirement>(e manca una parentesi angolata), che è già stato fissato per te sopra da wolf.

La singola riga di codice che hai citato nel tuo primo post funzionerà perfettamente, se la copi come ti è stata data la prima volta.
Regarding the spaces, I assure you that they are not in the game, but as I copy the code on the forum they are created.

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/skillcore-custom-requirement.143498/