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.

[VX] How can I increase critical ratio by ATK?

efeerk

Member

I want do critical can increase by spi or agi.

Example:

If character has 100 agi = +1 critical

If character has 200 agi = +2 critical

Please help me for it :(
 
Okay, simples. First do you have a battle system?
If you don't, go into the script 'Game_Battler 3'. Scroll down till you find a line that says something like so:
Code:
  #--------------------------------------------------------------------------

  # * Applying Normal Attack Effects

  #     attacker : battler

  #--------------------------------------------------------------------------

  def attack_effect(attacker)
Now, if you want to figure the rest out yourself, you can, its incredibly easy, otherwise reads this:
Okay scroll down in that little section till you hit something that looks like this:
Code:
        # Critical correction

        if rand(100) < 4 * attacker.dex / self.agi

          self.damage *= 2

          self.critical = true

        end
Now I don't know how you want this exactly, but from your example change it to this:
Code:
        # Critical correction

        if rand(100) < 4 + attacker.agi / 100

          self.damage *= 2

          self.critical = true

        end
Having it like this would make it so when YOU attack an enemy, you have a (4% + 1% per 100 agi) chance to score a critical.
If you have any math skills, you can change the '4 + attacker.agi / 100' to anything else.
(attacker.agi represents the attacking unit's agility. You can change attacker.agi to attacker.dex or attacker.str, etc.
If you want the attacked unit to be represented, use self instead of attacker. Example: self.agi, self.maxhp etc.)

If you have a battle system, there should be something similar, but if you need help, show me the system.

Hope that helps.
 

efeerk

Member

Sorry, I forgot to write rpg maker version... Im using VX and I could not find "Critical correction". I think it is in RMXP.

Thanks for it, its useful but I'm using Vampyr ABS(VX), can you help me for it?
 

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