Where is the hit chance formula?

I've searched through all the default js scripts but I can't find where the hit chance is calculated.
Does anyone know where it is?
there is no calculation
the actors and enemies get the chance by trait, and that value is simply added up from all equipment, states, class and actor that have that trait.

If that answer is not enough, please state what exactly you want to know and what you want to change.
there is no calculation
the actors and enemies get the chance by trait, and that value is simply added up from all equipment, states, class and actor that have that trait.

If that answer is not enough, please state what exactly you want to know and what you want to change.
I'm writing a script that displays the chance to hit
right now its just "actor.hit - enemy.eva/mev" calculation
but I don't know if its correct
I saw analogical thread under rpg maker vx ace
and it says that the engine calculates the chance to hit (100 - actor.hit) and then chance to evade (100 - enemy.eva) is this the same for rpg maker mv?
and they also said the hit chance calculation can be changed in vx ace
can I change it in mv as well?
right now its just "actor.hit - enemy.eva/mev" calculation
but I don't know if its correct
that is wrong.
as I said above, there is no calculation.
the engine rolls one check on HIT% to determine if the actor hits.
then it rolls a different check on EVA% to determine if that hit was evaded.

and so on - most values are independent of each other.

calculates the chance to hit (100 - actor.hit)
yes and no - that is NOT the chance to hit, it is the chance to miss.
and that is why you didn't find anything in the code - the code never checks for if hit, it checks for if missed. And yes, it's absolutely the same for both Ace, MV and MZ
that is wrong.
as I said above, there is no calculation.
the engine rolls one check on HIT% to determine if the actor hits.
then it rolls a different check on EVA% to determine if that hit was evaded.

and so on - most values are independent of each other.


yes and no - that is NOT the chance to hit, it is the chance to miss.
and that is why you didn't find anything in the code - the code never checks for if hit, it checks for if missed. And yes, it's absolutely the same for both Ace, MV and MZ
is there any way to change it?
so the hit and eva became interrelated and the engine only checked one time like this (actor.hit - enemy.eva)?
I'm writing a script that displays the chance to hit
right now its just "actor.hit - enemy.eva/mev" calculation
but I don't know if its correct
I cant give you a proper solution, but the SRPG Core does that..
Also its a TBS system thats why some variables might not fit in other rpg projects.. like you have to figure out "target/user" for your usage..
So if you can read JS well enough (what i cant^^) that might be helpfull..
You can find the SRPG Core in order to look for yourself on my GitHub
(or in the SRPG Thread for other version but that makes no differense in that case)
Here some Images for better understanding
Spoiler: imgs
Screenshot_1.png

Screenshot_2.png
Spoiler: imgs
Screenshot_4.png

Sry that i cant give you better Infos, when i wanted to change the Hitrate myself i used States to do that..
I cant give you a proper solution, but the SRPG Core does that..
Also its a TBS system thats why some variables might not fit in other rpg projects.. like you have to figure out "target/user" for your usage..
So if you can read JS well enough (what i cant^^) that might be helpfull..
You can find the SRPG Core in order to look for yourself on my GitHub
(or in the SRPG Thread for other version but that makes no differense in that case)
Here some Images for better understanding
Spoiler: imgs

Sry that i cant give you better Infos, when i wanted to change the Hitrate myself i used States to do that..
tnx I'll take a look at it
btw I was able to find this in rpg_objects
1604927167939.png

1604927186823.png

it looks like a hit chance formula to me
still can't figure it out but I think I'm getting closer now
tnx I'll take a look at it
btw I was able to find this in rpg_objects
View attachment 167204
View attachment 167205
it looks like a hit chance formula to me
still can't figure it out but I think I'm getting closer now
Yes i allready checked the rpg objects & and found the Hit stuff aswell but thats to complicated for me at the moment..
But perhaps you might be interrested in one of Yeps Plugins..
Yep Plugin Info said:
You can use the following notetags to alter the various aspects that modify
the extra parameter values:
Extra Parameter Formula (YEP)


edit
also if its just about to get the current hitrate data , that can be done like with every Stat..
i explained it here #365.
But i think you probably knew this allready..

(thats why i didnt mentioned it earlier, also it can only give the data info , NOT change it ,because that happens in rpg objects as far as i understand it)
okay so i experimented with those code lines a bit and found out an interesting fact
hit parameter doesn't affect magic attacks
if you attack with magic even if your character has hit rate of 0% the actual chance to hit is 100%
okay so now i will try to make it that way so magic attacks would also be dependant on hit rate and I'll replace the default miss and evasion check with (hit - eva) formula
i will share the results once I'm done
hit parameter doesn't affect magic attacks
of course not, that is how magic attacks are defined.
physical attacks use HIT and EVA
magical attacks use MEV

And it is one reason why I linked you to the damageflow in my answer above - that already states what you found out from the code
okay so I made it
heres what i changed:
this change makes magical attacks dependable on hit rate
1604940383299.png

1604940458052.png

and this change replaces miss and evasion checks with hit-eva formula
1604940607363.png

1604940633557.png
okay so I made it
heres what i changed:
this change makes magical attacks dependable on hit rate
View attachment 167230
View attachment 167231
and this change replaces miss and evasion checks with hit-eva formula
View attachment 167233
View attachment 167234
If you can, try to build that in a Plugin ,instead of editing the default rpg Plugins, thats the better solution..
(just incase that you edited the rpg plugins here and didnt replicated them in another plugin already^^)
=> also if builded into a Plugin, $GameSwitches that can enable or disable the change are always usefull
=>On my Github is a Plugin "SRPG_Blank" . That is a nearly naked Plugin that can be edited to build new Plugins.. also the name can be changed of course. If you want you can use it .
If you can, try to build that in a Plugin ,instead of editing the default rpg Plugins, thats the better solution..
(just incase that you edited the rpg plugins here and didnt replicated them in another plugin already^^)
=> also if builded into a Plugin, $GameSwitches that can enable or disable the change are always usefull
=>On my Github is a Plugin "SRPG_Blank" . That is a nearly naked Plugin that can be edited to build new Plugins.. also the name can be changed of course. If you want you can use it .
nah i don't think such small changes deserve its own plugin
plus yanfly already got one that does that (tho its not free)
nah i don't think such small changes deserve its own plugin
it doesn't matter how small the changes are - the problem is another one:
ANY update to the corefiles will overwrite them with the original code.
So if you make the changes into a plugin they are protected from being overwritten by updates.
If not, you're forcing yourself to forego any and all future updates or core changes.
it doesn't matter how small the changes are - the problem is another one:
ANY update to the corefiles will overwrite them with the original code.
So if you make the changes into a plugin they are protected from being overwritten by updates.
If not, you're forcing yourself to forego any and all future updates or core changes.
unless you make a copy of just the custom changes within a text file to manually add in later post-update
Necro-post notice: @BlueHat

Original thread: https://forums.rpgmakerweb.com/threads/where-is-the-hit-chance-formula.129702/