Yanfly SkillCore - Check number of items

Vollerei

Villager
Member
Joined
Mar 31, 2016
Messages
12
Reaction score
0
First Language
English
Primarily Uses
I'm using Yanfly's SkillCore plugin and I have just one function I need that I'm not sure how to achieve. This is the example that the plugin's help file gives:

For those who would like to show certain skills and disable them under any


custom conditions using their JavaScript knowledge, use the following:


Skill Notetag:


<Custom Show Eval>


if (user.level > 50) {


visible = true;


} else {


visible = false;


}


I have the plugin "SkillCostsItems" and now I just want to make sure that the skills you can't afford aren't shown in your skill list. This seems like it will be the solution, so I just need another variable than "user.level" to reflect on an individual item instead. Appreciate any and all help!
 

SumRndmDde

Follower of RNGesus
Veteran
Joined
Jul 30, 2013
Messages
225
Reaction score
423
First Language
English
Primarily Uses
RMMV
Use:


$gameParty.numItems($dataItems[itemID]);


to get the number of items in a party.


Simply replace "itemID" with the ID of the Item you wish to check.


For example:


if($gameParty.numItems($dataItems[5]) > 10) {
}


Checks to see if the party has more than 10 of Item ID 5
 
Last edited by a moderator:

Wavelength

MSD Strong
Global Mod
Joined
Jul 22, 2014
Messages
5,624
Reaction score
5,104
First Language
English
Primarily Uses
RMVXA
You might be able to get away with


if (item.isCurrentItemEnabled) {


as the first line after the <Custom Show Eval> for all skills that you want to hide when the player can't afford them.  But if that doesn't work, I think @SumRndmDde's solution above should be solid.
 

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

Latest Threads

Latest Posts

Latest Profile Posts

Couple hours of work. Might use in my game as a secret find or something. Not sure. Fancy though no? :D
Holy stink, where have I been? Well, I started my temporary job this week. So less time to spend on game design... :(
Cartoonier cloud cover that better fits the art style, as well as (slightly) improved blending/fading... fading clouds when there are larger patterns is still somewhat abrupt for some reason.
Do you Find Tilesetting or Looking for Tilesets/Plugins more fun? Personally I like making my tileset for my Game (Cretaceous Park TM) xD
How many parameters is 'too many'??

Forum statistics

Threads
105,867
Messages
1,017,062
Members
137,575
Latest member
akekaphol101
Top