When asked how to teach a skill with Yanfly's Item upgrade plugin, people stated "use the eval code to teach a skill". But when asked what this code is, nobody seems to know the answer.
So does anybody know what eval code i can use in the notetag area to teach a skill (in this case, when using Yanfly's item upgrade plugin)?
eval, essentially, executes a string as JavaScript code, but it should mainly be used to do simple JavaScript expressions, like formula.
For example, the following code:
var x = 11;var y = 13;var z = eval('x * y'); console.log(z);outputs "143" to the console.
EDIT:
Right.
<Upgrade Effect>Eval: item.traits.push({"code": x, "dataId": y, "value": z})</Upgrade Effect>That's the Yanfly method. I'll just recommend reading the plugin help extensively. It should explain everything clearly.
EDIT2:
Okay, I figured out that Eval does execute code. In this case, it pushes a new trait to the item.traits array. That's the farthest I can take you, since I'm more of a programmer.
Thank you! With this code and the help files I should be able to find a way. If so, i'll post again here. If anyone already has the code working, i'd be still happy if you share it 🙂
I do get why some people have slight problems with the plugin, though, as it really isn't all that well documented. I should know, I write crappy documentation myself. It is often assumed most people using these functions are programmers, but that shouldn't ever be the assumption.
Update: Yanfly posted a Tips & Tricks video that makes this possible:
It's mainly to add autostates to items/weapons/armors but through a state you can also teach a skill. Thanks once more to Yanfly!