MV Formula Error for BattleEngineCore

So the Console from CoreEngine printed the error below. Can you tell me the mistake I made?
This was what I put into "Escape Ratio"
($gameParty.luck() * 5 + $gameParty.agility()) / $gameTroop.agility()
So the Console from CoreEngine printed the error below. Can you tell me the mistake I made?
This was what I put into "Escape Ratio"
($gameParty.luck() * 5 + $gameParty.agility()) / $gameTroop.agility()
Also, the "console" doesn't really seem to be a console at all. There is a strange glitch I somehow caused recently that constantly sets my params to 1. Is there a way to see the code run as I play, so I can maybe pinpoint what is causing it? Changed the formula but get the same problem:
0.7 * $gameParty.agility() + $gameParty.luck() / $gameTroop.agility() How come Luck is invalid here?
It tells you exactly what your mistake is in the screenshot you posted. $gameParty.luck isn't a function. If you want to use the party's average luck, you'll have to code the calculation yourself.
It tells you exactly what your mistake is in the screenshot you posted. $gameParty.luck isn't a function. If you want to use the party's average luck, you'll have to code the calculation yourself.
So I can't calculate Luck here? What do I do?
(($gameParty.members().reduce((accumulator, currentValue) => { return accumulator + currentValue.agi }, 0) / $gameParty.members().length) * 5 + $gameParty.agility()) / $gameTroop.agility()
Have you done tutorials for MV, that walk you through how to configure actors and classes? You seem to be jumping ahead to advanced JavaScript usage without understanding the basics of the software - there is no such thing as "the party's luck," only "the luck of this specific actor."

If you want to reference a specific actor's Luck value, you can do it by referencing that actor's ID in the database: $gameActors.actor(ID).param(7)

Trihan's suggestion is helpful if you are trying to reference the average agility of all the party members, and you can do something similar for luck, but still - I would suggest you complete some more tutorials to build a sample game, then play it to get a better idea of how the mechanics work.
Have you done tutorials for MV, that walk you through how to configure actors and classes? You seem to be jumping ahead to advanced JavaScript usage without understanding the basics of the software - there is no such thing as "the party's luck," only "the luck of this specific actor."

If you want to reference a specific actor's Luck value, you can do it by referencing that actor's ID in the database: $gameActors.actor(ID).param(7)

Trihan's suggestion is helpful if you are trying to reference the average agility of all the party members, but I am not convinced that's what you're actually trying to do - I would suggest you complete some more tutorials to build a sample game, then play it to get a better idea of how the mechanics work.
I assumed it was meant to be the party's average luck since that's what $gameParty.agility() returns.
(($gameParty.members().reduce((accumulator, currentValue) => { return accumulator + currentValue.agi }, 0) / $gameParty.members().length * 5) + $gameParty.agility()) / $gameTroop.agility()
So that allows Luck to be calculated? Sweet! Another thing, is it possible to view the runtime while playing? There's a glitch I am trying to figure out.
So that allows Luck to be calculated? Sweet! Another thing, is it possible to view the runtime while playing? There's a glitch I am trying to figure out.
If you want something to output its current value when executing the code, you can add a "console.log" to the part of the code you're debugging. You can also go to the "source" tab and set breakpoints.

$gameParty.members().reduce((accumulator, currentValue) => { return accumulator + currentValue.agi }, 0) / $gameParty.members().length)

will get the average luck of your current battle party: basically the reduce function runs through each member and adds that member's luck to a running total, then after it calculates the total luck, divides it by the number of party members.
If you want something to output its current value when executing the code, you can add a "console.log" to the part of the code you're debugging. You can also go to the "source" tab and set breakpoints.
Where can I find the values for Base Parameters? A glitch is forcing these values to thier minimum possible value for some strange reason. So can I have it so whenever the HP param is set it will show me the value when typing console.log? Ehere do I do that? Also I want to find what causes it to become 1.
There are a number of places in the code that affect HP value and more which access the property's value, so you can't just set a breakpoint for that. If you caused the problem recently, I would recommend turning plugins off one by one until you no longer get the issue, at which point you know which one caused it.
There are a number of places in the code that affect HP value and more which access the property's value, so you can't just set a breakpoint for that. If you caused the problem recently, I would recommend turning plugins off one by one until you no longer get the issue, at which point you know which one caused it.
Not sure which plugin it is, but I turnedoff all the best candidates and the params are normal again! I hope I can pinpoint the issue soon.
Not sure which plugin it is, but I turnedoff all the best candidates and the params are normal again! I hope I can pinpoint the issue soon.

It was the BuffsStatesCore. That means this MUST be the issue. I apparently need the + 1 at the end. Let me see if adding it back fixes it.
Ah, yeah. With the formula you have there, when a stat is unbuffed, it becomes its value * 0 * 0.2, and multiplying something by 0 always returns 0. Stats can't be 0, so they go to their minimum of 1.
Ah, yeah. With the formula you have there, when a stat is unbuffed, it becomes its value * 0 * 0.2, and multiplying something by 0 always returns 0. Stats can't be 0, so they go to their minimum of 1.
Ah, so THAT's why! BTW the params are fixed now, thanks for the help man!

Original thread: https://forums.rpgmakerweb.com/threads/formula-error-for-battleenginecore.136181/