Save-Point
[XP] Damage displayed incorrectly - Printable Version

+- Save-Point (https://www.save-point.org)
+-- Forum: Games Development (https://www.save-point.org/forum-4.html)
+--- Forum: Code Support (https://www.save-point.org/forum-20.html)
+--- Thread: [XP] Damage displayed incorrectly (/thread-3152.html)



[XP] Damage displayed incorrectly - prioran - 12-23-2010

Hi everyone,

I've run into a strange problem while testing my game: damage inflicted by enemies does not correspond to the graphic that is displayed (for example, the numbers 938 will appear but 1700 HP will be lost) and sometimes "Miss" is displayed but HP is lost. After removing scripts in a trial-and-error process, it seems that Der VVulfman's Angie's Equipment Sets script, which I love, is causing the problem. Is it a compatibility issue? Other battle scripts I'm using are Claimh's Tactical Skills and DW's Karen's Combos scripts.

Thanks in advance for your time. :)


RE: [XP] Damage displayed incorrectly - computerwizoo7 - 12-23-2010

why not try to plug out the script and try it in a new project and see if the problem persists.
if it doesn't add the other scripts to the new project and test again.


RE: [XP] Damage displayed incorrectly - DerVVulfman - 12-28-2010

I have the fix. It's easy:

1) Edit the header of the script to resemble this:
Code:
#==============================================================================
# ** ANGIE'S EQUIPMENT SETS
#------------------------------------------------------------------------------
#    by DerVVulfman
#    version 2.3
#    12-27-2010
#    SDK 2.2+ Compatible (so far)
#------------------------------------------------------------------------------

2) Change the thanks section of the script to this:
Code:
#------------------------------------------------------------------------------
#
#  CREDITS AND THANKS:
#
#   Thanks to SephirothSpawn who is a fairly decent teacher (damn... he's half
#   my age!) who did some initial work on skills that get equipped. And thanks
#   to entrando  for a li'l help with the Pop-Up waiting system.  And finally,
#   thanks to Prioran of Save-Point.Org for noticing an extra-damage glitch.
#
#==============================================================================

Then, go down and change the attack_effect method from this...
Code:
alias sets_ae attack_effect
  def attack_effect(attacker)
    sets_ae(attacker)
    # Attach base damage to battler (for self.base_damage)
    @sets_damage = nil
    # Execute the original process
    set_result = sets_ae(attacker)

to this...
Code:
alias sets_ae attack_effect
  def attack_effect(attacker)
    # Attach base damage to battler (for self.base_damage)
    @sets_damage = nil
    # Execute the original process
    set_result = sets_ae(attacker)

Simply put, I called the 'sets_ae' routine twice... effectively asking for battle calculations twice. Eliminate the first one.

Oh, and while typing this, I'm updating / bumping Angie about it too. Winking


RE: [XP] Damage displayed incorrectly - prioran - 12-29-2010

Many thanks for your patience with me. I've always been a fan of this script and look forward to using it in my game.