- Joined
- Jan 28, 2013
- Messages
- 835
- Reaction score
- 525
- First Language
- English
- Primarily Uses
- RMMV
Loud and clear. Thanks to your detailed report, I was able to easily find the issue and correct it. I have uploaded version 1.39 of the menu extension here.@ramza @YoraeRasante
For my test i put extraparamformula in your DW+SB demo, that is my plugin order:
View attachment 140127
Well i use the extraparamformula plugin for setup the crit chance to be actor.luk/2 %, next i give a hero 500luck so his crit is near 250%, next i give him 4%crit chance because of his classe like this:
View attachment 140129
So his new crit value is 254 for each hand. I give him a weapon in each hand, the basique sword and flail of the demo. Next i go in the "attributes" command of statue menu. I can see that it is written that he has 4% of crit with each hand instead of 254.
View attachment 140130
I start a battle, do a normal atak and that crit normaly (all time). That visual bug only occurs on dual wielding heroes when wearing one weapon in each hand or a weapon and nothing in the other hand. That works fine for dualwielding heroes who have a two handed weapon or bare-handed and for non dual wielding heroes too. Here the hero has no weapons and we can see the normal crit rate :
View attachment 140131
This visual bug occurs with hit too.
Hope that i was clear this time, sorry for my 08/20 English ^^ and thx for your attention
If anyone is interested in what the problem turned out to be I will explain:
In menus, when I was drawing the values for mainhand and offhand hit or crit rating, I did so by removing all traits from the opposite hand temporarily, then re-calculating hit or crit with the traits removed, then re-adding those traits again. In some specific scenarios, instead of going through that, the function simply returned actor.cri or actor.hit, mainly when the opposite hand was empty, meaning it displayed the correct value when there was nothing to take away from the other hand.
However, when there was an item in the opposite hand, I was getting the actors total crit (or hit) value via adding up traits on them, rather than calling actor.crit (or actor.hit), meaning it was ignoring any other method used of gaining crit or hit rate.
By simply changing those lines from a function that summed all traits for crit or hit, to the function that just returns their crit or hit rate entirely, I was able to keep the exact same functionality in the menu, while also taking into account any changes made to the ExParams formula via plugin.
As mentioned by Vinvin, this was a display issue only, as during battle, crit rate and hit rate are determined via the actor.cri and actor.hit functions (are these technically functions?), rather than by summing all crit and hit traits on them manually.