MV Victor Engine MV is fundamentally broken ("action.item is not a function") [SOLVED]

So I'm not going to mince words with you all, but I'm stumped.

I've been using Victor's MV scripts to see how they work, but every time I try to use them for anything I've gotten some peculiar crashes.

vF1sV6G.png


Details:
  • This error comes up when any form of damage is done to either actor or enemy
    • Specifically, GetAllElements is acting up because apparently it's not a function. I have no intelligent way to fix this because I barely know javascript.
  • I have no other scripts active other than Basic Module, Victor Action Dodge and/or Victor Action States, so this is not a compatibility or plugin order issue
  • Happens on a fresh project as well, so it's not anything in my actual projects either

1vlJoYa.png


As well as what it looks like in console.

I've looked around and saw people posting similar issues with this exact error on this exact forum, the "action.item is not a function" part. Some people managed to fix it, but they never actually posted their bugfixes for other people to see which was insanely frustrating.

It's a problem because I have big plans to use both scripts for certain things.
if you upload the project..
perhaps we can help from your project
recommended.. put on google doc
I haven't tried it, only read the plugins. However, this might solve it.

Inside VE_ActionStates.js in function Game_Action.prototype.getActionStatesData
search for line containing
Code:
VictorEngine.getAllElements(subject, item).reduce...etc
(it's at the end of the plugin file).

Replace the word "item" in the bracket with the word "this".
To make it look like:
Code:
VictorEngine.getAllElements(subject, this).reduce...etc
What Poryg posted is what the poster in the other thread said was the fix for them.

So try that and see if it works.
I haven't tried it, only read the plugins. However, this might solve it.

Inside VE_ActionStates.js in function Game_Action.prototype.getActionStatesData
search for line containing
Code:
VictorEngine.getAllElements(subject, item).reduce...etc
(it's at the end of the plugin file).

Replace the word "item" in the bracket with the word "this".
To make it look like:
Code:
VictorEngine.getAllElements(subject, this).reduce...etc

Wow, I can't believe that actually worked. Thank you so much!

... Though I can't help but feel immense amounts of existential dread knowing that I could have gone in circles trying to figure this out myself, not realizing that the fix was something small like this.
I've looked around and saw people posting similar issues with this exact error on this exact forum, the "action.item is not a function" part. Some people managed to fix it, but they never actually posted their bugfixes for other people to see which was insanely frustrating.
In all fairness, the OP of that other post actually *did* explain what they did to fix it:

VICTORY! passing in "this" which is the action, fixed the issue.

Victor's TOU doesn't explicitly state whether or not people are allowed to re-distribute his plugins, so I suspect that the person was concerned about whether or not they were allowed to post the fixed version. Unfortunately, a lot of MV plugins have this issue--the authors never applied a proper license to their source code, nor explained their stance on edits/redistribution, and have gone AWOL... so now there are a lot of plugins out there that can't receive bug fixes, and can't get ported to MZ, even though the authors probably wouldn't mind.
In all fairness, the OP of that other post actually *did* explain what they did to fix it:

Victor's TOU doesn't explicitly state whether or not people are allowed to re-distribute his plugins, so I suspect that the person was concerned about whether or not they were allowed to post the fixed version. Unfortunately, a lot of MV plugins have this issue--the authors never applied a proper license to their source code, nor explained their stance on edits/redistribution, and have gone AWOL... so now there are a lot of plugins out there that can't receive bug fixes, and can't get ported to MZ, even though the authors *probably* wouldn't mind.

Oops. Yeah, that makes sense. I also figured that since the thread was years old by this point that I couldn't just ring Omega Weapon up for an elaboration on his fix.

I interpreted the "this" fix as going into the Basic Module and not in Action States/Dodge, which is why I was confused.
Though I can't help but feel immense amounts of existential dread knowing that I could have gone in circles trying to figure this out myself, not realizing that the fix was something small like this.
I can only recommend learning programming better to avoid such existential dreads.
If you can learn to read like a machine, you'll be able to spot mistakes like that just by reading the code.

Original thread: https://forums.rpgmakerweb.com/threads/victor-engine-mv-is-fundamentally-broken-action-item-is-not-a-function-solved.154643/