MV (YEP) Skill Cost Items's Text Error

Hello. I have been trying to use Yanfly's Skill Cost Items for a skill who requires items, but no matter what I do, I always end up having that message when I run my project for tests:

this._enemies[index].name is not a function

Is there something to do to make sure the plugin works because I correctly wrote the items's number or names correctly.
The plugin works, but that's not enough information to get any help.

When your game crashes with an error, you need to press F8, go to the Console tab, and provide a screenshot of that window.

Also, show us whatever notetags you're using in the skill.
When your game crashes with an error, you need to press F8, go to the Console tab, and provide a screenshot of that window.
Here is the screenshot of the Console Tab:

xKb75oD.png


And the notetags I used for the skills:


<target action>

motion spell: user

animation 51: user

wait for animation

action effect

</target action>



<Cooldown: 3>



<Item 127 Cost: 1>

<Item Cost: 1 Lunar Gemstone>



<Hide if Learned Skill: 52>
<Item 127 Cost: 1>
<Item Cost: 1 Lunar Gemstone>
Why do you have both of these notetags in the same skill?

Presuming Lunar Gemstone is item 127, that's either going to make it cost two Lunar Gemstones or cause an error in your skill.

Aside from that, a few suggestions:
- Double check the order of your Yanfly plugins in your plugin manager. They should match the order shown on the Yanfly Engine Library Web site.

- Make sure you're starting a new game after making changes and saving your project. Don't load a save game or try a battle test for this.

If neither of those helps, you can try downloading the plugins and copying them over again. The error you show above indicates a typo in code, usually either from a notetag with code in it (which I don't see in your skills) or from an error in the plugin files/order.
Why do you have both of these notetags in the same skill?
Because I thought at first that I had to put both, but now I realize I made a mistake.

Aside from that, a few suggestions:
- Double check the order of your Yanfly plugins in your plugin manager. They should match the order shown on the Yanfly Engine Library Web site.
I did the first one and this is how I ordered the plugins in my project:

If neither of those helps, you can try downloading the plugins and copying them over again. The error you show above indicates a typo in code, usually either from a notetag with code in it (which I don't see in your skills) or from an error in the plugin files/order.
I should download directly on Yanfly's itch.io?
Yes.

I notice from a glance at your plugin manager screenshots that you seem to be using out of date versions of some of the Yanfly plugins.

That could definitely be the cause of your problems.

If your plugin versions aren't correct with each other, and your project version isn't RPG Maker MV 1.6.1 or higher, the actual code could be conflicting. (or if you're using plugins with an old version of MV's code and you have other plugins written for the current version)

You can check the version of your project by opening rpg_core.js in a text editor and looking at the top; and you get the current versions of Yanfly's plugins from his itch page.
Yes.

I notice from a glance at your plugin manager screenshots that you seem to be using out of date versions of some of the Yanfly plugins.

That could definitely be the cause of your problems.

If your plugin versions aren't correct with each other, and your project version isn't RPG Maker MV 1.6.1 or higher, the actual code could be conflicting. (or if you're using plugins with an old version of MV's code and you have other plugins written for the current version)

You can check the version of your project by opening rpg_core.js in a text editor and looking at the top; and you get the current versions of Yanfly's plugins from his itch page.
I did as you wrote and my project is v1.6.2, so it's possible to update some plugins or not since they have to be purchased.
If you're using the free versions of Yanfly's plugins, downloaded before he started charging for them, those are not compatible with MV version 1.6.2.

That is probably the cause of your error.

So you either should buy the plugin library and replace the plugin files in your project, or downgrade your project code to 1.5 to be compatible with the plugins.

I do not recommend downgrading your project unless you absolutely can't possibly afford the plugins.
I guess I shall wait for my pay to buy the plugins and see if it worked.

Thank you for your help 🙂
@Halcyon Days You also have two Main Menu Managers active. Probably want to remove one of them.
@Halcyon Days You also have two Main Menu Managers active. Probably want to remove one of them.
Never realized that, thanks 😅
Update: I bought the Yanfly MV pack and it finally worked. I guess my plugins were really that old...

Either way, thank you ATT_Turan for your help 🙂

Original thread: https://forums.rpgmakerweb.com/threads/yep-skill-cost-itemss-text-error.170505/