Cannot edit Player Actor ATK stat?

hello,

i was wondering if anybody could help me get a better grip on this. the player is consistently doing 0 damage to enemies when attacking without any sort of weapons, and in the status screen it does show that the player has exactly 0 attack points. and a weapon does fix it because if a sword is equipped which boosts attack power the player will then be able to deal the weapons set damage value. but how could one make it so that the player has attack power even without weapons, or is that simply not possible?

any sort of help would be appreciated!
You can modify this in the script editor, specifically under Game_Battler 3.

By default, RPG Maker XP uses the following basic damage calculation:
Ruby:
# Calculate basic damage
      atk = [attacker.atk - self.pdef / 2, 0].max
      self.damage = atk * (20 + attacker.str) / 20

This means that if the actor's atk is 0, the attack will deal 0 damage.

I wasn't satisfied with this damage formula, so I created my own version using the limited scripting knowledge I have. My formula includes a small adjustment to ensure that damage is always above zero:
Ruby:
# Calculate base damage
    if attacker.atk < 1
      self.damage = 0.1 * attacker.str
    else
      self.damage = (attacker.atk * attacker.str / 10)
    end

This calculation is performed before defense is applied. As you can see, the first if condition ensures that if the attacker's atk is less than 1 (e.g., if the actor has no weapon equipped), the damage dealt is calculated as 0.1 * attacker.str.

Feel free to modify the damage formula to suit your needs. However, if you want to adopt this approach, I recommend including the if attacker.atk < 1 condition to handle edge cases where the attacker's atk is extremely low.
I wouldn't alter it there at all because there's a problem with it that should not be introduced to that game. You see, if your actor is level 5 but your mob is like some sort of level 20 hellhound, it'd be normal not to be able to inflict any damage to that critter mainly due to the level difference. So getting 0 damage as end result would be quite expectable.

In Game_Actor#base_str the minimum value for an actor's strength variable is 1 based on its formula. Here it doesn't matter whether or not the hero has equipped a weapon at all. The OP's issue could be found in another method called base_atk that says:

Ruby:
class Game_Actor
  def base_atk
    weapon = $data_weapons[@weapon_id]
    return weapon != nil ? weapon.atk : 0
  end
end

There you can see that any actor will get some 0 attack value if no weapon was equipped. Replace that 0 with anything you might prefer as a default result for weaponless heroes and that's it.

Preferably, copy and paste your modification in a separate script section to easily keep track of your changes.
oh sweet! thank you, i'm gonna try that out later today when i get back to working on it

Original thread: https://forums.rpgmakerweb.com/threads/cannot-edit-player-actor-atk-stat.174986/