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,663
Reaction score
1,112
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 Profile Posts

Government : "Hehehe~ I will spread lies that the earth is round so that I could sell globes~"
Anyone here managed to never burn out on programming? My current limit is 3 months(6-8 hours per day, 7 days per week, 50 hour programming week on average), and then I just have to take a break, sometimes lasting few days(with at most 2 hours on programming per day). I've been always like this so far, so I admire those who can always be so passionate on programming :)
This is starting to become a momochi collection y'all!
Meet Swefo The candy Eater!

Hide your candy... I or I sweefe sweefefooo~~~
Automatic level scaling without an option to turn it off can be a very bad choice for a game. The worst I've ever seen was in Nightmare of Druaga, where if a power outage made your system turn off, the game detects it as an attempted cheat and overwrites your save while taking away your best gear, leaving you unable to progress at the late stages of the game, and unable to recover.

Forum statistics

Threads
99,655
Messages
967,729
Members
131,337
Latest member
Rebells45
Top