I'm not sure if this goes here or in Learning Javascript, but
Right now I'm using plugins (mostly Yanfly, some others) to customize a lot of my formulas. As of now, the formulas are pretty long and cluttered, so I want to add some basic functions to clean them up. Unfortunately I've tried two different plugin templates (this and this) and spoken to some experienced coders, but I haven't been able to get any of them to work.
I have an RNG function that I'd like to be able to use in my damage formula through YEP_DamageCore.
I then put this in the notebox for the skill I'm using, just as a test.
Unfortunately while DoveUtil2 does show up in the Sources in the console, no matter what I do the attack does 0 damage and the console just says something like this. I don't know how to "define" DoveUtil and so far no one's been able to tell me.
Some of my functions are more complex, using information from other plugins (like ICFSoft_ParamsCore and YEP_RowFormation) but for now I'm just going to focus on the simplest. Here's the complete current version of my plugin so far: and, just in case it helps, the list of cleaned-up formulas with the functions they need to reference: .
Right now I'm using plugins (mostly Yanfly, some others) to customize a lot of my formulas. As of now, the formulas are pretty long and cluttered, so I want to add some basic functions to clean them up. Unfortunately I've tried two different plugin templates (this and this) and spoken to some experienced coders, but I haven't been able to get any of them to work.
I have an RNG function that I'd like to be able to use in my damage formula through YEP_DamageCore.
JavaScript:
function spread(a) {
return Math.floor(Math.random() * (a + 1))
}
I then put this in the notebox for the skill I'm using, just as a test.
JavaScript:
<damage formula>
value = spread(10);
</damage formula>
Unfortunately while DoveUtil2 does show up in the Sources in the console, no matter what I do the attack does 0 damage and the console just says something like this. I don't know how to "define" DoveUtil and so far no one's been able to tell me.
Some of my functions are more complex, using information from other plugins (like ICFSoft_ParamsCore and YEP_RowFormation) but for now I'm just going to focus on the simplest. Here's the complete current version of my plugin so far: and, just in case it helps, the list of cleaned-up formulas with the functions they need to reference: .