MV Referencing Enemy Params with YEP Skill Core

Hi hi hello, find below the relevant plugins and a brief overview of what im trying to achieve.


So essentially im trying to set the counter chance of an enemy (CNT) before a skill goes off based on a formula of the target and attackers luck (LUK) which i'll refer to as skill. Essentially so the more "skilled" the target is than their opponent the more likely they'll be to counter the attack. But i cant just use ex param formulas or CNT will just get too damn high

Im trying to use yanfly skill core to set the targets CNT before the skill goes off then reset it back to 0 after the skill is evaluated.
Easy enough with this part of the plugin.
1667016112934.png

however im having trouble with creating a code that can set specifically the targets counter rate and reference both the user and targets LUK in a formula. So essentially im asking for a coding lesson from you wizards 🙂. And to know if its even possible to set an enemies ex params with js mid battle.

Oh and find the formula im gonna use below for those who are interested 😛
1667016376980.png


Thank you very much any help is appreciated. I genuinely think this could be used in so many ways for the more obscure parameters
This is kind of a difficult way to go about this - if you have the Yanfly plugins, why not just use Counter Control?

You can put in the enemy's notes:
Code:
<Custom Target Counter Rate>
rate=(Math.pow(user.luk-90, 22)/(500*target.luk))+.05;
</Custom Target Counter Rate>

And to know if its even possible to set an enemies ex params with js mid battle.
The problem with this is that Ex-Parameters aren't values stored on the enemy/actor, they're traits. Every time you ask the game to reference them it's actually a function that scans through all of the equipment and states and such on the battler and returns the total calculation of that trait value.

So no, you can't easily just set that...but you can do the above.
Thanks for the reply!

Absolutely thats a great solution i didnt realise i could use

1667049222791.png


I completely missed the portion where it says "attackers traits alter targets CNT rate" as usual yanfly has it all sorted with their big brain deep in the lunatic mode text 🙂

That should work perfectly since i can use it to set everybody's CNT not just enemies.

I had a read through the code you sent through ty so much for writing that btw, i think it was slightly wrong correct me if i interpreted wrong but it should look like this right?

1667049416992.png

And ill just stick this in the notes for every actor and enemy easy youre a lifesaver 🙂
P.S. After some testing the formula is a tad confusing but essentially target and user are backwards in that previous formula. Final Formula is


<Custom Target Counter Rate>
rate=(Math.pow(target.luk - user.luk, 2.2)/(500*user.luk))+.05;
</Custom Target Counter Rate>

Its odd i dont think user refers to the character the code is placed but rather the character attacking them hence target refers to themself

Anyways wouldnt have worked it out without you treat yourself homie 🙂

Original thread: https://forums.rpgmakerweb.com/threads/referencing-enemy-params-with-yep-skill-core.152312/