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.

Is there a way to make enemies/ weapons do a set amount of damage?

I was going to do common events, until I realized you can't use those on equipment or enemies. I'm using Mr. Mo's ABS version 1.5 and RMXP, if it matters.

An example of what I mean is- I want the Pistol to ALWAYS do 2 pts. of damage, and the rifle to always do 4 pts., and the weak zombie to always do 1 point, while the strong zombie does 6 pts.
 
Are you sure it's not version 4.5?  I couldn't find V1.5
Anyways, it doesn't look like atk or attack_effect is redefined, so this should work.

Paste above Main*

Code:
class Game_Battler
  #--------------------------------------------------------------------------
  # * Applying Normal Attack Effects
  #     attacker : battler
  #--------------------------------------------------------------------------
  def attack_effect(attacker)
    # Clear critical flag
    self.critical = false
    # First hit detection
    hit_result = (rand(100) < attacker.hit)
    # If hit occurs
    if hit_result == true
      # Calculate basic damage
      self.damage = attacker.atk
      # Second hit detection
      eva = 8 * self.agi / attacker.dex + self.eva
      hit = self.damage < 0 ? 100 : 100 - eva
      hit = self.cant_evade? ? 100 : hit
      hit_result = (rand(100) < hit)
    end
    # If hit occurs
    if hit_result == true
      # State Removed by Shock
      remove_states_shock
      # Substract damage from HP
      self.hp -= self.damage
      # State change
      @state_changed = false
      states_plus(attacker.plus_state_set)
      states_minus(attacker.minus_state_set)
    # When missing
    else
      # Set damage to "Miss"
      self.damage = "Miss"
      # Clear critical flag
      self.critical = false
    end
    # End Method
    return true
  end
end

Now just set the ATK value on enemies and Weapons in your database to the amount of damage you want.

* Q. How do I install "Script_Name" in my game?
 
It didn't seem to work =P. I put thie script above main, set the ATK value of the Pistol weapon to "2", set all of the enemies stats to 1 except for HP (10) ATK (8) and DEX (999, for no misses), but no damage shows above the monsters graphic, and he doesn't seem to be taking any damage. I fired 7 shots into him, which should've done 14 damage, or am I missing something?

And I couldn't test if his attacks do the right amount of damage, considering I'm having even more ABS troubles, and the monsters I make don't attack x_x.

Thanks, though. I only hope I can fix this, I'm sure I did something wrong XD.
 
Rathalos":5n8nrxuw said:
and the monsters I make don't attack x_x.
This, together with the fact that you're not doing damage, makes me suspect that you're not making monsters the right way...
Maybe you should double- and triple-check the events, and then perhaps post one of them up for review?
 
It works fine with the default battle system. It must be a problem with Mr. Mo's abs.

it looks like the players attack is always doing the right damage (when it hits).
It's just not showing the amount of damage the enemy is doing to the player.
Although it looks like shows the last attack, just not every attack.

I tested the ABS without my modification, and it does the same thing for the display.

You'll have to ask Mr. Mo (or someone more familiar with the script) for help on that one.

Be Well
 

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