MV Referencing enemy in Yanfly's Extra Parameter Formula Plugin

Hello, heres the plugin in question for those who need it


So im having a relatively simple issue but really getting nowhere with it. The plugin allows you to edit formulas deciding the ExParams of actors and enemies. Im editing the counter parameter and trying to achieve something like

(base + plus) * rate + flat + (user.luk/enemy.luk) * 0.05

Essentially trying to have the counter chance change based on the relative difference between attacker and defenders luck. Problem is that i cant reference the attackers luck.

I've checked the formula works by just adding 1000 to the basic formula and thats all good. user.luk works just fine a.luk works as well. But target.luk, b.luk, attacker.luk and enemy.luk all dont work.

TLDR How do i reference an enemies luck in the context of this formula. Thank you very much for the help 🙂.

Help.PNG
I believe that yanfly uses user and target

so try "target.luk"
I believe that yanfly uses user and target

so try "target.luk"
I used this
1612783011471.png

and no luck. Should be producing a guaranteed counter since every character has a luck attribute higher than 1.
oh wait. I kinda overlooked something important.

These plugin parameters calculate the stat of any given character.
So you cannot use "target" in this case since the engine does not know who or what "target" is.
It only knows that "user" is the actor or enemy whose parameters are being calculated.

These formulas are not like damage formulas for skills. you cannot reference enemies or targets in them afaik.
That formula doesn't work because the target doesn't always exist when the engine goes to check your xparams.

You can get an xparam at any time, from the equip menu, the status menu, or simply by typing $gameParty.members()[0].cnt into the console. Because you can get those values at any time, anything the formula uses must also be available at any time. There is no enemy present unless you are in battle, so the target is not defined in this context, and any attempt to use it willy firstly, not work because it isn't defined, and secondly cause a crash any time the formula is referenced when there is no target defined.

You simply won't be able to use an enemy in the formula for defining an xparam like this. These formulas should only take into account stats on the battler they are defining stats on, as they are used not just in battle.
That formula doesn't work because the target doesn't always exist when the engine goes to check your xparams.

You can get an xparam at any time, from the equip menu, the status menu, or simply by typing $gameParty.members()[0].cnt into the console. Because you can get those values at any time, anything the formula uses must also be available at any time. There is no enemy present unless you are in battle, so the target is not defined in this context, and any attempt to use it willy firstly, not work because it isn't defined, and secondly cause a crash any time the formula is referenced when there is no target defined.

You simply won't be able to use an enemy in the formula for defining an xparam like this. These formulas should only take into account stats on the battler they are defining stats on, as they are used not just in battle.
Okie dokie, Thats dissapointing but thank you very much for the help 🙂.
the extra parameters dont work this way. they only take into account the "user".

hit is the chance to successfully land a hit.
eva is the chance of successfully avoid an attack.

when calculating the chances, the game uses attacker hit vs. defender eva.

the extra parameters plugin dont mess with this hit vs. eva formula. just how hit and eva are calculated individually.

and yanfly have another plugin for that specific case, the YEP_HitAccuracy plugin

Original thread: https://forums.rpgmakerweb.com/threads/referencing-enemy-in-yanflys-extra-parameter-formula-plugin.133176/