(Answered) (Yanfly) Additional Skill Requirements?

Using Yanfly's Skill Core is there a way to add additional weapon requirements for a skill? For example I have a skill called "Burst Shot". In the editor I can have it require up to 2 different kinds of weapons, but I have 4 weapons that I would like to be available.


EG: Burst Shot requires Guns, Bows, Crossbows, or Launchers.


http://yanfly.moe/2015/10/13/yep-8-skill-core/


<Custom Show Eval>


???


</Custom Show Eval>


This seems to be how one would do it.... but I don't know what to put in there. lol


*edit* Thanks to Nekoyoubi for the answer! The correct code is within this link:


https://gist.github.com/nekoyoubi/c360c644036166f619ae820a1ed7b873


Just replace the "2, 4, 6, 8" with the weapon types of your choice.
I actually am considering extending YEP - Skill Core to give notetags for gear and gear types based on this, but in the meantime, you'll find what you need by setting your <Custom Show Eval> to the following...


var wids = [2,4,6,8];
visible = $gameParty.members().reduce(function(a,b) {
return b.equips().reduce(function(c,d) {
return c || ((d !== null && d.wtypeId !== undefined)
? wids.indexOf(d.wtypeId) >=
: false);
}, a);
}, false)


hxTWA0j.png



Replace the "2,4,6,8" with the weapon types you're looking for, and things should be gravy. 😉


Edit: For  space consolidation, and because the RM forums' code box keeps destroying my code, here is a gist that works, and only takes up three total notebox lines: https://gist.github.com/nekoyoubi/c360c644036166f619ae820a1ed7b873
It pops up with "Syntax Error Unexpected Token" after I learn the skill.
It pops up with "Syntax Error Unexpected Token" after I learn the skill.

Any chance you can send me the actual text you have inside the <tags>?
So sorry about that. Fixed the issue. Tested it fully. I just updated the original message so there was no confusion.
So I tried copy/paste the whole thing as one line and that didn't work. Tried breaking to the next line where you had written return and deleting "return" and that didn't work.


Pretty sure my issue right now is I have no idea where to break it into multiple lines.
You don't need to break it at all. I see the issue now. The code box is stripping one of my characters. Namely the "0" directly before the ":". You can either add that back in yourself, or just grab it from this gist: https://gist.github.com/nekoyoubi/c360c644036166f619ae820a1ed7b873
That worked perfectly! Thank you! I'll update my first post with your answer.


And actually.. while I have you here maybe you can answer a question I posted in a different thread about a week ago.


Is there any way I could do this same thing with class/subclass?


Example: I can combine Guardian and Paladin in any order of class/subclass to make a Crusader. There's a skill called Templar Strike that is unlocked in the Paladin skill set if you're equipped with both Paladin and Guardian.


I know this:


<Require Class: 37, 3>


<Require Subclass: 37, 3>


Allows me to have the skill greyed out if you don't have the right class combo, but I would love it if it could just disappear off the list entirely without the right class combo.


Bear in mind a Crusader can be formed from Pal/Guardian or Guardian/Pal.


Here's the link to my other post.






*edit* Ack! There's no "best answer" button!
Nah, no need for a "Best Answer". The [ ♥ Like this ] mostly serves that purpose. The more people "like" the solution, it's generally an indication of acceptance. 😉


Also, let me look into your other post and I'll see what I can come up with. Though, I'm already a bit behind with your extra pools post. ;p
Aye! I liked it.


And yeah.. I've been making a few posts lately. lol


I try to update my initial post once I find the answer.


Off to work for now!
Oh, just a side-note. I have it on pretty good authority, that if your reasoning behind adding "(Yanfly)" to your title is to get a fluffy response, you're going to be disappointed. I would suggest dropping that title-tag from your posts. Noting in the OP that you're using YEP - X is usually more than enough, and in most cases, just based on a well constructed title, we all know what you're using going into it. 😉   But again, I'm just giving you my impressions from comments from the bunny itself; do with them what you will.
On break at the moment. If by "fluffy response" you mean a response by Yanfly himself, then no. I don't expect a response from him when there's probably others who could answer the questions just as well. I put Yanfly I the title so people know before clicking on it that it pertains to his scripts. It would be the same if I put (Yami) or (Victor Engine) in the title. Saves people from clicking on it if it's for a plugin or engine they aren't familiar with.

Original thread: https://forums.rpgmakerweb.com/threads/answered-yanfly-additional-skill-requirements.60416/