Custom Show Eval with Yanfly Skill CORE

yeahchris

Veteran
Veteran
Joined
Apr 14, 2020
Messages
86
Reaction score
23
First Language
English
Primarily Uses
RMMV
So, I have a spellcaster that is like a parlour magician. She draws cards (items added to inventory) from a deck, consuming MP, and then uses those items to cast her spells (the spells have an item cost, she does not "use" the item as an item). She can expend MP to reshuffle cards, draw additional cards, etc.

I realized that the usability of her skill menu would be significantly improved if I hid all of her normal spells until there is at least one card item in party's inventory.

This way she will have only the option to draw cards initially. And and thereafter all of her actual attack spells can be set up to appear at the top of her skill list.

I tried adding this restriction onto one of her spells using Yanfly Skill CORE:

Code:
<Custom Show Eval>
if($gameParty.numItems(19) > 0){
  visible = true;
} else {
  visible = false;
}
</Custom Show Eval>
However, I never see the skill. Even if I have one or more of item 19. Anyone know why?
 

caethyril

^_^
Veteran
Joined
Feb 21, 2018
Messages
1,652
Reaction score
1,105
First Language
EN
Primarily Uses
RMMV
numItems expects an item object (database reference), not just an item ID. This is because there are different types of item: "Item", "Weapon", "Armor". :)

Try this instead:
Code:
<Custom Show Eval>
if ($gameParty.numItems($dataItems[19]) > 0) {
  visible = true;
} else {
  visible = false;
}
</Custom Show Eval>
 

yeahchris

Veteran
Veteran
Joined
Apr 14, 2020
Messages
86
Reaction score
23
First Language
English
Primarily Uses
RMMV
numItems expects an item object (database reference), not just an item ID. This is because there are different types of item: "Item", "Weapon", "Armor". :)

Try this instead:
Code:
<Custom Show Eval>[/INDENT]
[INDENT]if ($gameParty.numItems($dataItems[19]) > 0) {[/INDENT]
[INDENT]  visible = true;[/INDENT]
[INDENT]} else {[/INDENT]
[INDENT]  visible = false;[/INDENT]
[INDENT]}[/INDENT]
[INDENT]</Custom Show Eval>
Perfect -- thank you.
 

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

Latest Threads

Latest Posts

Latest Profile Posts


:3c here's a thing i made a while while while back
Tried mochi for the first time. It's quite nice. Has a pleasant smell and taste, and is nice and chewy.
made a bio for the protag in my project!
Beggar : "I haven't eat for days..."
Kid : "Just do crime! You will get daily necessity for free in prison~"

Forum statistics

Threads
99,158
Messages
962,449
Members
130,725
Latest member
teendinsaikha
Top