MZ Repurposing LUK stat

Hello, I am using a script I believe I saw @caethyril post a while back

Game_BattlerBase.prototype.lukEffect = function(target) { return 1; };

However in game when using a skill with the damage formula:

-10 - a.luk * .05

I get the following error:

TypeError: Cannot read property 'luk' of undefined

Thoughts?

I am using battle core and having an Action Sequence set up that formula if it matters


For context, cause I may be using the wrong script, I am trying to nullify luks normal purpose as it pertains to states and instead use it like any other parameter
The correct plugin code would be:
JavaScript:
Game_Action.prototype.lukEffectRate = function(target) { return 1; };
That said, there is no core method on Game_BattlerBase named lukEffect, so the code you posted (wherever you got it from) will do nothing unless one of the other plugins you're using references it.

The error says the action subject (a in the formula) is undefined. That's unrelated to the luck effect calculation. In fact, the formula is evaluated before the core scripts even check the luck effect for any relevant effects.

I suggest you share a screenshot of your Plugin Manager, showing all plugins you are using.
I suggest you share a screenshot of your Plugin Manager, showing all plugins you are using.
1694273814564.png

1694273828905.png


1694273839211.png


1694273853021.png


1694273865172.png



^_^'

The script I have might be a bad copy and paste. So I'll disregard if thats the case
Yea, otherwise you might try turning off all VisuStella plugins (and any others that depend on them) to see if that helps. VisuStella Battle Core has that Damage Styles "auto-formula" stuff, for example, which seems easy to overlook.

Based on the error, I would be suspicious of anything that changes the subject in some way, e.g. removing a battler from combat, forcing an action via an action sequence, etc. It's a bit strange to have the action subject missing when the damage formula is being evaluated. Are you doing something unusual in the action sequence? 😅

Might be a typo in a script call, e.g. BattleManager._subject = x (set equal to) instead of == (check if equal).

A screenshot of the console (F8 to open dev tools, then select the Console tab) after the error has occured may also help to pinpoint the problem. E.g. perhaps it's not the damage formula. 👋
So I'm using a variable set by the skill to choose which ACtion Sequeuce stuff is used (works fine for other skills just fine )

This is the one for this skill "Flux"

1694277609445.png


1694277582993.png



The full error from console:

1694277668582.png


The skill works fine when it isn't doing an Custom Action Sequence using an HP Damage formula of

10 + a.luk * .05


Which only further stumps me and confirms its an issue in battle core lol


I'm just going to cheat and use $subject.luk for now. For some reason nesting this common event is making `a` not work the way its supposed to
Gonna point out that you've got the VS Core Engine placed wrong. Not saying it doesn't work or anything, but Tier 0 is supposed to go above everything of a lower tier for maximum compatibility.
Gonna point out that you've got the VS Core Engine placed wrong. Not saying it doesn't work or anything, but Tier 0 is supposed to go above everything of a lower tier for maximum compatibility.
Its above everything but cores other plugins need that might otherwise override or conflict with vs things. Noit sure what you see is placed wrong here
Oh, I see. Try using user and target in the action sequence commands, instead of a and b?

I misunderstood previously: I thought you were using the usual damage formula box, and simply applying it in your action sequence using "MECH: Action Effect". 😴
Oh, I see. Try using user and target in the action sequence commands, instead of a and b?

I misunderstood previously: I thought you were using the usual damage formula box, and simply applying it in your action sequence using "MECH: Action Effect". 😴
Yea I hadn't realized I would have to call $target or $subject directly in the Action Sequences commands to get it to work. LEsson learned for future skills
This thread is being closed due to being solved. If you need it reopened, report it to let us know why. Thank you!

Original thread: https://forums.rpgmakerweb.com/threads/repurposing-luk-stat.161046/