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.

Minimum damage = 1 not 0 for RTAB

Status
Not open for further replies.
Ok sorry but I really couldn't figure out what forum to put this in. But I want the minimum damage to be 1 instead of 0. I didn't know where to ask cuz I knew it would prolly be as simple as changing one number in the code, but I guess it's kinda appropriate for here.
 
Go into the RTAB script itself, and at or around line #2749 is where you want to insert...
Code:
      self.damage[attacker] = 1 if self.damage[attacker] == 0
*Not <= 0 as this would prevent healing items or skills if used in the Skill_Effect and Item_Effect defs.

This statement should be placed between the Dispersion block of code, and the Second on-target hit decision block of code.

The dispersion block takes the damage obtained from the weapon and attack values stats and puts a little random value spin on it...

The second on-hit detection does just that, ensure that the target is hit.

So as long as the target is hit... we calculate the damage, check the dispersion, then use THIS line to ensure that the damage is at least 1 point of damage... then continue as normal.

Again, this same effect can be applied to skills and item damages as well.

*Reason SandGolem's system didn't work is the isolation of individual battlers through the [battler] addendum to the damage value (self.damage[battler]) that RTAB uses.
 
Wow thank you very much ^_^ (DerVVulfman and alexia). Since I have no idea what you just said in your explanation, Der, I'm just gonna say thank you and walk away lol.

I guess you can close this now or whatever.
 
Um sry, I know this is REALLY old lol, but I was playing and I think a spell did 0 damage...I might be making that up lol but I'm pretty sure it did happen. Is there a different thing for the spell damage?
 
Yep... the line of code (at 2749...) affected only physical damage attacks (def attack_effect).

You'll want to edit the magic effects AND item effects I figure

So you're gonna add same said lines to just below #2835 (look for the following text: 'Second on-target hit decision') and maybe around line #2944 (below: self.damage[user] = -self.recover_hp[user]).

But this may create an 'odd' effect if the skill or item doesn't apply damage by design, like applying a stat effect to a battler (like a bonus to a fellow's STRENGTH stat, but getting a 1pt damage??)
 
I know this was a while ago but I never saw a reply and kinda forgot I started this thread :P. So sorry to revive a dead thread just to say thank you but thank you ^_^.

If it does do that effect I just won't worry about it then...cuz on some games, now that I think about it, spells can sometimes do 0 damage if they are resistant to the spell. Thx again.
 
Status
Not open for further replies.

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