Edit: Solved - just needed to add the following at the top of the .js file:
/*:
* @target MZ
*/
I'm trying to make a plugin to hold my damage formula (example below). However, I keep getting 0 damage, which seems to be the default for when a formula's invalid. If I open the debug console (F8), I don't see any errors getting thrown. However, if I write 'my_formula', I get an uncaught reference error so presumably I didn't properly scope my function.
How can I fix this so I can use my function in the 'formula' section for skills? The example here's short, but sometimes the formulas get long and it's annoying to type/scroll through the little textbox.
Example (.../js/plugins/my_plugin.js):
function my_formula(a, b) {
return a.atk * 4 - b.def * 2;
}
I have imported my plugin and made sure it's active (on).
/*:
* @target MZ
*/
I'm trying to make a plugin to hold my damage formula (example below). However, I keep getting 0 damage, which seems to be the default for when a formula's invalid. If I open the debug console (F8), I don't see any errors getting thrown. However, if I write 'my_formula', I get an uncaught reference error so presumably I didn't properly scope my function.
How can I fix this so I can use my function in the 'formula' section for skills? The example here's short, but sometimes the formulas get long and it's annoying to type/scroll through the little textbox.
Example (.../js/plugins/my_plugin.js):
function my_formula(a, b) {
return a.atk * 4 - b.def * 2;
}
I have imported my plugin and made sure it's active (on).