Yanfly's Hit Accuracy Plugin Issue.

So, I was making the following formula:
skillHitRate * [ userHitRate / ( userHitRate + targetEvadeRate )]
where "userHitRate" is influenced by a base parameter accuracy stat that increases with level and "targetEvadeRate" which scales off another.

I tested it out by having both the accuracy and evasion stats equal. The result was as expected from the equation: 0.5 (50% hit chance)

HOWEVER, when I changed the formula to
skillHitRate * [ 0.25 + ( userHitRate / [ userHitRate + targetEvadeRate ])]
the hit rate is ALWAYS 100% no matter what, which is something that equation SHOULD NOT return.

What's the problem here?
Don't use [square brackets] as parentheses. In code, and many areas of mathematics, different bracket types mean different things. (In JavaScript, square brackets are used to define and reference arrays.) 😅

Try this instead:
Code:
skillHitRate * ( userHitRate / ( userHitRate + targetEvadeRate ) )
Oh... You're right. The first equation DID work with the square brackets which gave me the illusion that it wasn't the problem. After replacing the square brackets as you recommended in the second equation, it worked as intended with an average hit rate of 75%! Now, I'm going to change the square brackets in every formula I have in the game just to be safe later on.

Thank you so much for your immense help! You saved me hours or potentially days of frustration!

I've moved this thread to Plug-In Support. Thank you.

Original thread: https://forums.rpgmakerweb.com/threads/yanflys-hit-accuracy-plugin-issue.116331/