SP Damage help
#1
Same here. I just chalk it up to XP being a thing of the past and everyone else moving to both VX and VXACE.

I'm just looking for a basic script that allow me to set skills that damages/absorbs MP from a character/foe. A way to differentiate between MP damage and normal, round-of-the-mill HP damage (i.e different colored damage numbers) would be a nice thing to have as well but not necessary.

Have for example this HP Absorption Script created by RPG Advocate:

Code:
# HP Absorbption Skills
# by RPG Advocate


# Sample code used for an 'absorb' common event:
#
#   absorb = $game_temp.damage_hook * -1
#   $scene.active_battler.damage = absorb
#   $scene.active_battler.damage_pop=true
#   $scene.active_battler.hp -= absorb


#==============================================================================
# ** Game_Temp
#------------------------------------------------------------------------------
#  This class handles temporary data that is not included with save data.
#  Refer to "$game_temp" for the instance of this class.
#==============================================================================

class Game_Temp
  #--------------------------------------------------------------------------
  # * Public Instance Variables
  #--------------------------------------------------------------------------
  attr_accessor :damage_hook              # damage hook
  #--------------------------------------------------------------------------
  # * Object Initialization
  #--------------------------------------------------------------------------
  alias has_initialize initialize
  def initialize
    # Original call
    has_initialize
    # Initialize damage hook
    @damage_hook = 0
  end
end



#==============================================================================
# ** Game_Battler
#------------------------------------------------------------------------------
#  This class deals with battlers. It's used as a superclass for the Game_Actor
#  and Game_Enemy classes.
#==============================================================================

class Game_Battler
  #--------------------------------------------------------------------------
  # * Apply Skill Effects
  #     user  : the one using skills (battler)
  #     skill : skill
  #--------------------------------------------------------------------------
  alias has_skill_effect skill_effect
  def skill_effect(user, skill, dilute = 1)
    # Original call
    effective = has_skill_effect(user, skill)
    # Set hook to damage
    if self.damage.is_a?(Numeric)
      $game_temp.damage_hook += self.damage
    end
    # End Method
    return effective    
  end
end  
  

  
#==============================================================================
# ** Scene_Battle
#------------------------------------------------------------------------------
#  This class performs battle screen processing.
#==============================================================================

class Scene_Battle
  #--------------------------------------------------------------------------
  # * Public Instance Variables
  #--------------------------------------------------------------------------
  attr_reader :active_battler
  #--------------------------------------------------------------------------
  # * Frame Update (main phase step 1 : action preparation)
  #--------------------------------------------------------------------------
  alias has_up4s1 update_phase4_step1
  def update_phase4_step1
    # Reset damage hook
    $game_temp.damage_hook = 0
    # Original call
    has_up4s1
  end
end

Something like this would be ideal.
}
#2
Um, I wrote one almost two years ago. Laughing It's called Simple SP Bonus Damage, and comes with a damage pop add-on. You'll want the damage pop add-on or else you won't see the SP damage in the popups.
Up is down, left is right and sideways is straight ahead. - Cord "Circle of Iron", 1978 (written by Bruce Lee and James Coburn... really...)

[Image: QrnbKlx.jpg]
[Image: sGz1ErF.png]    [Image: liM4ikn.png]    [Image: fdzKgZA.png]    [Image: sj0H81z.png]
[Image: QL7oRau.png]    [Image: uSqjY09.png]    [Image: GAA3qE9.png]    [Image: 2Hmnx1G.png]    [Image: BwtNdKw.png%5B]
  Above are clickable links
}
#3
Oh, thanks DerWulfman. I've got a question though: you say it comes with a damage pop add-on yet in the script says the user may wish to add a compatible SP Damage Pop script because there is no damage pop for this effect.

Also, I can't help but notice this script isn't included in the Master List.
}
#4
(02-07-2014, 04:31 AM)DerVVulfman Wrote: @Steel Beast 6Beets: While the script said it would need a compatible SP damage pop script, you can look further down and grab one. And the SP damage system is listed in the Skills Development spoiler.
I see, I see. Seems I misinterpreted your post yesterday, I blame lack of sleep. I tested the script today and everything works perfectly now. Grinning

One last thing though: could the SP damage pop script be made compatible with the SP drain common call I posted?
}
#5
The damage pop uses a few values to see if a battler has a damage pop and sends it into my damage pop system. IF your Drain/Osmosis script performs changes to the Game_Battler class, you need very few changes if you're using this one too.

The SP damage system adds @dvv_sp_damage_pop (a boolean or true/false/nil) value to see if the actor needs a SP damage pop to show, and @dvv_sp_damage, which holds the value of SP damage (nil by default). And, it sends the value to the Damage Pop sprite system by using self.dvv_sp_damage much the same way as self.damage is used to send damage values to the default pop system.

Just look at the Initialize and the end of the skill_effect methods in the Simple SP Damage script.
Up is down, left is right and sideways is straight ahead. - Cord "Circle of Iron", 1978 (written by Bruce Lee and James Coburn... really...)

[Image: QrnbKlx.jpg]
[Image: sGz1ErF.png]    [Image: liM4ikn.png]    [Image: fdzKgZA.png]    [Image: sj0H81z.png]
[Image: QL7oRau.png]    [Image: uSqjY09.png]    [Image: GAA3qE9.png]    [Image: 2Hmnx1G.png]    [Image: BwtNdKw.png%5B]
  Above are clickable links
}
#6
(02-08-2014, 04:24 AM)DerVVulfman Wrote: The damage pop uses a few values to see if a battler has a damage pop and sends it into my damage pop system. IF your Drain/Osmosis script performs changes to the Game_Battler class, you need very few changes if you're using this one too.

The SP damage system adds @dvv_sp_damage_pop (a boolean or true/false/nil) value to see if the actor needs a SP damage pop to show, and @dvv_sp_damage, which holds the value of SP damage (nil by default). And, it sends the value to the Damage Pop sprite system by using self.dvv_sp_damage much the same way as self.damage is used to send damage values to the default pop system.

Just look at the Initialize and the end of the skill_effect methods in the Simple SP Damage script.
The Draining script does modify the Game_Battler class:

Code:
#==============================================================================
# ** Game_Battler
#------------------------------------------------------------------------------
#  This class deals with battlers. It's used as a superclass for the Game_Actor
#  and Game_Enemy classes.
#==============================================================================

class Game_Battler
  #--------------------------------------------------------------------------
  # * Apply Skill Effects
  #     user  : the one using skills (battler)
  #     skill : skill
  #--------------------------------------------------------------------------
  alias has_skill_effect skill_effect
  def skill_effect(user, skill, dilute = 1)
    # Original call
    effective = has_skill_effect(user, skill)
    # Set hook to damage
    if self.damage.is_a?(Numeric)
      $game_temp.damage_hook += self.damage
    end
    # End Method
    return effective    
  end
end

I really ought to learn about coding stuff.
}
#7
I split these posts from the What's Up RMers topic as it became a support topic all its own. Winking

I see that you are using HP Absorb from Good Ol' RPG Advocate. It's an old script, but reliable. However, it does not perform SP damage on its own. I am assuming that you want to have a skill you can use to hurt a target's SP reservoir and absorb it. For this, you would need either a new script, or my Simple SP Damage script and an 'edit/alter' of the HP Absorb script.

If you wish to alter the HP Absorb script, I would suggest changing every variable that relates to normal damage. Mainly you would change the self.damage value in RPG Advocate's Game_Battler class should be replaced with self.dvv_sp_damage, and any instance of damage_hook to sp_damage_hook.

You would have this script below my Simple SP Damage so my SP damage gets checked first before the SP Absorbtion script takes place... and lastly the SP damage pop below all three.

Oh, and if you plan to have HP absorbtion.... change the names of your aliased methods like changing has_initialize to has_sp_initialize. You don't want two similarly designed scripts screwing each other up.
Up is down, left is right and sideways is straight ahead. - Cord "Circle of Iron", 1978 (written by Bruce Lee and James Coburn... really...)

[Image: QrnbKlx.jpg]
[Image: sGz1ErF.png]    [Image: liM4ikn.png]    [Image: fdzKgZA.png]    [Image: sj0H81z.png]
[Image: QL7oRau.png]    [Image: uSqjY09.png]    [Image: GAA3qE9.png]    [Image: 2Hmnx1G.png]    [Image: BwtNdKw.png%5B]
  Above are clickable links
}
#8
Alright, I edited the HP absorption script to a SP absorption script:

Code:
# SP Absorbption Skills
# by RPG Advocate


# Sample code used for an 'absorb' common event:
#
# absorb = $game_temp.sp_damage_hook * -1
# $scene.active_battler.damage = absorb
# $scene.active_battler.damage_pop=true
# $scene.active_battler.sp -= absorb


#==============================================================================
# ** Game_Temp
#------------------------------------------------------------------------------
# This class handles temporary data that is not included with save data.
# Refer to "$game_temp" for the instance of this class.
#==============================================================================

class Game_Temp
#--------------------------------------------------------------------------
# * Public Instance Variables
#--------------------------------------------------------------------------
attr_accessor :sp_damage_hook # sp damage hook
#--------------------------------------------------------------------------
# * Object Initialization
#--------------------------------------------------------------------------
alias has_sp_initialize initialize
def initialize
# Original call
has_sp_initialize
# Initialize damage hook
@sp_damage_hook = 0
end
end



#==============================================================================
# ** Game_Battler
#------------------------------------------------------------------------------
# This class deals with battlers. It's used as a superclass for the Game_Actor
# and Game_Enemy classes.
#==============================================================================

class Game_Battler
#--------------------------------------------------------------------------
# * Apply Skill Effects
# user : the one using skills (battler)
# skill : skill
#--------------------------------------------------------------------------
alias has_skill_effect skill_effect
def skill_effect(user, skill, dilute = 1)
# Original call
effective = has_skill_effect(user, skill)
# Set hook to damage
if self.dvv_sp_damage.is_a?(Numeric)
$game_temp.sp_damage_hook += self.dvv_sp_damage
end
# End Method
return effective
end
end



#==============================================================================
# ** Scene_Battle
#------------------------------------------------------------------------------
# This class performs battle screen processing.
#==============================================================================

class Scene_Battle
#--------------------------------------------------------------------------
# * Public Instance Variables
#--------------------------------------------------------------------------
attr_reader :active_battler
#--------------------------------------------------------------------------
# * Frame Update (main phase step 1 : action preparation)
#--------------------------------------------------------------------------
alias has_up4s1 update_phase4_step1
def update_phase4_step1
# Reset damage hook
$game_temp.sp_damage_hook = 0
# Original call
has_up4s1
end
end

And ran into a "stack level too deep" error at line 84:

Code:
$game_temp.sp_damage_hook = 0
}
#9
Odd... unless you are also using HP absorption. If this is the case, you would need to change the aliases like so:

Code:
# SP Absorbption Skills
# by RPG Advocate


# Sample code used for an 'absorb' common event:
#
#   absorb = $game_temp.sp_damage_hook * -1
#   $scene.active_battler.dvv_sp_damage_pop = absorb
#   $scene.active_battler.dvv_sp_damage_pop=true
#   $scene.active_battler.sp -= absorb


#==============================================================================
# ** Game_Temp
#------------------------------------------------------------------------------
#  This class handles temporary data that is not included with save data.
#  Refer to "$game_temp" for the instance of this class.
#==============================================================================

class Game_Temp
  #--------------------------------------------------------------------------
  # * Public Instance Variables
  #--------------------------------------------------------------------------
  attr_accessor :sp_damage_hook              # damage hook
  #--------------------------------------------------------------------------
  # * Object Initialization
  #--------------------------------------------------------------------------
  alias has_sp_initialize initialize
  def initialize
    # Original call
    has_sp_initialize
    # Initialize damage hook
    @sp_damage_hook = 0
  end
end



#==============================================================================
# ** Game_Battler
#------------------------------------------------------------------------------
#  This class deals with battlers. It's used as a superclass for the Game_Actor
#  and Game_Enemy classes.
#==============================================================================

class Game_Battler
  #--------------------------------------------------------------------------
  # * Apply Skill Effects
  #     user  : the one using skills (battler)
  #     skill : skill
  #--------------------------------------------------------------------------
  alias has_sp_skill_effect skill_effect
  def skill_effect(user, skill)
    # Original call
    effective = has_sp_skill_effect(user, skill)
    # Set hook to damage
    if self.dvv_sp_damage.is_a?(Numeric)
      $game_temp.sp_damage_hook += self.dvv_sp_damage
    end
    # End Method
    return effective    
  end
end  
  

  
#==============================================================================
# ** Scene_Battle
#------------------------------------------------------------------------------
#  This class performs battle screen processing.
#==============================================================================

class Scene_Battle
  #--------------------------------------------------------------------------
  # * Public Instance Variables
  #--------------------------------------------------------------------------
  attr_reader :active_battler
  #--------------------------------------------------------------------------
  # * Frame Update (main phase step 1 : action preparation)
  #--------------------------------------------------------------------------
  alias has_sp_up4s1 update_phase4_step1
  def update_phase4_step1
    # Reset damage hook
    $game_temp.sp_damage_hook = 0
    # Original call
    has_sp_up4s1
  end
end

This would be shown in your editor as:
> SP DAMAGE SCRIPT
> SP ABSORBTION SCRIPT
> SP DAMAGE POP SCRIPT

Oh, I removed the ,dilute=1 as I think it was a leftover piece. It's not referenced anywhere in any other part of the HP absorption system.
Up is down, left is right and sideways is straight ahead. - Cord "Circle of Iron", 1978 (written by Bruce Lee and James Coburn... really...)

[Image: QrnbKlx.jpg]
[Image: sGz1ErF.png]    [Image: liM4ikn.png]    [Image: fdzKgZA.png]    [Image: sj0H81z.png]
[Image: QL7oRau.png]    [Image: uSqjY09.png]    [Image: GAA3qE9.png]    [Image: 2Hmnx1G.png]    [Image: BwtNdKw.png%5B]
  Above are clickable links
}
#10
I tested the script again and ran into a NoMethodError:

Code:
undefined method 'dvv_sp_damage_p' for #<Game_actor:0x8d93d10>
}


Possibly Related Threads…
Thread Author Replies Views Last Post
   Damage appears behind bars in battle prioran 3 7,565 08-06-2011, 01:46 AM
Last Post: prioran
   [XP] Damage displayed incorrectly prioran 3 9,123 12-29-2010, 08:13 PM
Last Post: prioran
   Damage Pop VX Help: Syncing Damage Pop With Instant Text Yojimbo 2 5,439 01-22-2010, 09:35 AM
Last Post: Yojimbo
   do damage while un-equiped help!!!!! PLEASE Jparker1984 5 7,591 11-24-2009, 03:00 AM
Last Post: PK8
   Timing problem with damage shown on the screen - Scene Battle mageone 2 6,308 10-20-2009, 06:22 PM
Last Post: mageone



Users browsing this thread: 1 Guest(s)