Envision, Create, Share

Welcome to HBGames, a leading amateur game development forum and Discord server. All are welcome, and amongst our ranks you will find experts in their field from all aspects of video game design and development.

Problems with States affecting hit rate

I don't know why, but putting the hit rate for a state any lower than 100% makes all physical skills miss 100% of the time. Even if the state makes you have 99% hit rate, it still misses every single time. Magic always hits, regardless of state hit rate. Is there a script to fix this problem?
 
That seems strange, assuming you didn't touch any scripts (or have a conflict with one you may have added) hit rate should be...
hit_result = (rand(100) < attacker.hit)    <== for normal attacks

and for skills
    hit = skill.hit
    if skill.atk_f > 0
    hit *= user.hit / 100
    end

so with 99% hit you should have a 99% chance to hit

also like Brewmeister mentioned if ATK or STR is set to 0% then that could be the problem
 
Clockwise":1emlbvmv said:
That seems strange, assuming you didn't touch any scripts (or have a conflict with one you may have added) hit rate should be...
hit_result = (rand(100) < attacker.hit)    <== for normal attacks

and for skills
    hit = skill.hit
    if skill.atk_f > 0
    hit *= user.hit / 100
    end

so with 99% hit you should have a 99% chance to hit

also like Brewmeister mentioned if ATK or STR is set to 0% then that could be the problem

Where in the script do these pieces of codes go into?
 
Clockwise":3aunvz94 said:
should be part of the normal script in GameBattler3
(if they aren't there for some reason you should be able to open a new project an find them)

I checked and the lines are the same as the ones you gave me. But the problem still remains.
 
Gamemazta":189bmhwh said:
I don't know why, but putting the hit rate for a state any lower than 100% makes all physical skills miss 100% of the time.

What about when you execute the normal Attack command? Does it still miss? Same thing with skills based off of Intelligence instead of Strength, do those still miss too? Better yet, do they always "Miss" and/or do they always do no damage (as well)?

Perhaps its probably not even a problem with any "States" you have, maybe its a problem with the way you've set the Skill up? Double check and be sure none of your skills have a Hit Rate % of 0, because that could be a common problem especially with custom skills you might've set up.
 

Thank you for viewing

HBGames is a leading amateur video game development forum and Discord server open to all ability levels. Feel free to have a nosey around!

Discord

Join our growing and active Discord server to discuss all aspects of game making in a relaxed environment. Join Us

Content

  • Our Games
  • Games in Development
  • Emoji by Twemoji.
    Top