Unique Accuracy Formula for each Skill

darkmatter404

Villager
Member
Joined
Feb 2, 2014
Messages
28
Reaction score
4
First Language
English
Primarily Uses
Hey all. I have a game which resembles the fallout series in it's mechanics / statistics. For example, there is a melee weapons skill that is supposed to influence the damage and accuracy of just melee weapon skills in combat. I can make the "melee weapons" skill into a variable and have that variable influence the damage formulas for the appropriate combat moves, but accuracy is a more difficult problem.

I know you can set each skill to have it's own base accuracy, and then you can modify the players accuracy by some values across the board (like +5%) but I want each skill in combat to be influenced by it's skill stat (so all melee attacks are boosted in accuracy by each point to your melee weapons stat) along with your basic character statistics (perception).

Hopefully this makes sense. I want your specific weapon skills to determine the accuracy of those weapons, but not others (which is why I cant just have the weapon skill add +accuracy to your character, as said accuracy will affect all skills in combat). How can I make this happen?

I have YEP Hit Accuracy BTW, so right now the global accuracy formula is just the base skill's accuracy + your accuracy - enemy evasion. Thanks for any help.
 

caethyril

^_^
Veteran
Joined
Feb 21, 2018
Messages
2,087
Reaction score
1,508
First Language
EN
Primarily Uses
RMMZ
Not sure if there exists a plugin specifically for this (couldn't find one with a quick search)...

However, you should be able to rig something for the Hit Accuracy plugin parameter's formula:
Code:
var acc = eval(skill.meta.Accuracy || ''); skillHitRate * (isNaN(acc) ? (userHitRate - targetEvadeRate) : acc)
Then put an "Accuracy" notetag in each skill's notebox to specify the skill's hit formula, e.g.
Code:
<Accuracy: a.hit - b.eva + v[5]/20>
As you can see, all the usual abbreviations should apply! Here, v[5] is the value of game variable 5, so we're getting +0.05 hit rate (where 1 = 100%) per +1 to the value of var 5. :)

Very quickly tested with only the Hit Accuracy plugin and it seemed OK for me~ :kaothx:

The plugin parameter thing says "evaluate the skill's Accuracy notetag as code and store the result in a temporary variable named acc; if acc is a number, return that number multiplied by the skill success rate, otherwise return Yanfly's default hit-minus-eva formula".
 

darkmatter404

Villager
Member
Joined
Feb 2, 2014
Messages
28
Reaction score
4
First Language
English
Primarily Uses
Hey, thanks for the quick reply! This all is very promising, and seems to be exactly what I need. I have a few questions though.

So I'd just paste that top code into the Hit Accuracy plugin wherever? I assume thats the case.

For the accuracy notetag variables, I'm more confused. If you put v[5] is that the value of whatever variable 5 is? So if I make the formula v[5] / 100, then my variable 5 has a value of 100, it would be 1/1 = 100% accuracy? If I wanted to use a different variable, like something 368, it would just be v[368]?

Sorry for the confusion.
 

caethyril

^_^
Veteran
Joined
Feb 21, 2018
Messages
2,087
Reaction score
1,508
First Language
EN
Primarily Uses
RMMZ
I suggest putting the top code into the Hit Accuracy plugin's "Accuracy Formula" parameter, in the Plugin Manager. You can copy it verbatim, no changes needed unless you want to change the default value (i.e. the value used when using a skill without an Accuracy notetag) and/or the notetag label ("Accuracy"). :)

Yes, v[5] should get replaced by the value of variable ID 5 at the time of calculating whether the skill will hit or not. v[368] should be the value of variable 368, v[42] the value of variable 42, etc. And then, as you say, if variable 5 is set equal to 100, the following formula will equal 1, i.e. it'll always hit:
Code:
v[5] / 100
Hope that helps! :kaojoy:
 

Kes

Veteran
Veteran
Joined
Aug 3, 2012
Messages
22,299
Reaction score
11,712
First Language
English
Primarily Uses
RMVXA
[move]JS Plugin Requests[/move]
If your query is fully resolved, please Report your post and ask for the thread to be closed. Mods might not see a post, but they will see a Report.
 

Users Who Are Viewing This Thread (Users: 0, Guests: 1)

Latest Threads

Latest Posts

Latest Profile Posts

How many parameters is 'too many'??
Yay, now back in action Happy Christmas time, coming back!






Back in action to develop the indie game that has been long overdue... Final Fallacy. A game that keeps on giving! The development never ends as the developer thinks to be the smart cookie by coming back and beginning by saying... "Oh bother, this indie game has been long overdue..." How could one resist such? No-one c
So I was playing with filters and this looked interesting...

Versus the normal look...

Kind of gives a very different feel. :LZSexcite:
To whom ever person or persons who re-did the DS/DS+ asset packs for MV (as in, they are all 48x48, and not just x2 the pixel scale) .... THANK-YOU!!!!!!!!! XwwwwX

Forum statistics

Threads
105,849
Messages
1,016,977
Members
137,563
Latest member
cexojow
Top