SP Damage help
#11
So... where the heck is that coming from. It isn't in the script I just sent you, nor is it in either the SP DAMAGE or DAMAGE POP scripts?

My only explanation is that you somehow hit 'space' at some point and turned
dvv_sp_damage_pop
into
dvv_sp_damage_p op

Do a search throughout all three for dvv_sp_damage_p and see if there is such a space.
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
}
#12
I searched on all the scripts and I couldn't find any misspelling or typo. I tried putting the HP Drain script below these previously mentioned scripts yet the error persisted. I also noticed you could drain SP from enemies that don't have any SP (The error shows up when trying to add that amount of SP to the character's SP). Perhaps that has something to do with the error?

I found another thing: when copying and pasting the common event call, it gets twisted into this:

Code:
absorb = $game_temp.sp_damage_hook * -1
$scene.active_battler.dvv_sp_damage_p
op = absorb
$scene.active_battler.dvv_sp_damage_p
op=true
$scene.active_battler.sp -= absorb

The codes are just too long for the script window.

For the record, there are the three scripts:

Code:
#==============================================================================
# ** Simple SP Bonus Damage
#------------------------------------------------------------------------------
# by DerVVulfman
# version 1.3
# 04-28-2012
# RGSS / RMXP
#------------------------------------------------------------------------------
#
# INTRODUCTION:
#
# This lets you apply bonus SP (or MP) damage to an attack. As an option,
# you can make skills deliver only SP damage to a target. In any event, the
# amount of SP damage is a portion based on the what you set in the system.
#
# There is no damage pop for this effect. However, two values of dvv_sp_damage
# and dvv_sp_damage_pop have been included within the Game_Battler class if
# the user wishes to add a compatible SP Damage Pop script.
#
# NOTE: Yes, the two values could merely have been named 'sp_damage' and
# 'sp_damage_pop', but these have been used in Charlie Fleed's CTB.
#
#------------------------------------------------------------------------------
#
# COMPATABILITY:
#
# Designed for the RPGMaker XP system and to work with the default battlesys-
# tem and Charlie Fleed's CTB. However, Charlie Fleed's CTB has its own ver-
# sion of an SP-Only damage system so the 'NO_HP_DAMAGE_TAG' isn't required.
#
#------------------------------------------------------------------------------
#
# TERMS AND CONDITIONS:
#
# Free to use, even in commercial projects. Just note that I need some form
# of due credit, and due credit to AGAFURO who requested this feature.
#
#==============================================================================



module SP_Damage

# SP DAMAGE TAG
# Tag your skill(s) with an element that applies SP damage.
# If you set it to '1', then Fire Element skills (as an example) would
# give SP Damage.
DAMAGE_TAG = 11


# NO HP DAMAGE TAG
# Tag your skill(s) with an element that doesn't apply HP damage. This way
# you can have skills that affect a target's SP points exclusively. It needs
# you to tag a skill with the SP DAMAGE TAG (see above).
# If you set it to '3', then Thunder Element skills (as an example) would
# not deliver HP Damage, and gives only SP damage
NO_HP_DAMAGE_TAG = 12


# SP DAMAGE CHANGE
# Calculates how much of the damage is applied towards SP damage.
# As an example, it would give 1/5th damage if set to '5'.
DAMAGE_CHANGE = 7

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
#--------------------------------------------------------------------------
# * Public Instance Variables
#--------------------------------------------------------------------------
attr_accessor :dvv_sp_damage_pop # SP damage display flag
attr_accessor :dvv_sp_damage # SP damage value
#--------------------------------------------------------------------------
# * Object Initialization
#--------------------------------------------------------------------------
alias sp_damagepop_init initialize
def initialize
# Original Call
sp_damagepop_init
# Create the Values
@dvv_sp_damage_pop = true
@dvv_sp_damage = nil
end
#--------------------------------------------------------------------------
# * Apply Skill Effects
# user : the one using skills (battler)
# skill : skill
#--------------------------------------------------------------------------
alias sp_damagepop_skill_effect skill_effect
def skill_effect(user, skill)
# The original call
effective = sp_damagepop_skill_effect(user, skill)
# Get the damage value
damage_val = self.damage
# Return under conditions (not the element, is a string, not damaging)
return effective unless skill.element_set.include?(SP_Damage::DAMAGE_TAG)
return effective unless damage_val.is_a?(Numeric)
return effective if damage_val < 1
# Return HP (voiding physical damage) for SP only damage skills
if skill.element_set.include?(SP_Damage::NO_HP_DAMAGE_TAG)
self.hp += damage_val
self.damage = nil
end
# Calculate SP damage (damage divided by configured value)
dvv_sp_damage = (damage_val/SP_Damage::DAMAGE_CHANGE).to_i
# Substract damage from SP
last_sp = self.sp
self.sp -= dvv_sp_damage
self.dvv_sp_damage = dvv_sp_damage
# Return Effective
return effective
end
end

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

Code:
#==============================================================================
# ** Simple SP Bonus Damage Pop
#------------------------------------------------------------------------------
# by DerVVulfman
# version 1.1
# 04-28-2012
# RGSS / RMXP
#------------------------------------------------------------------------------
#
# INTRODUCTION:
#
# This is a damage pop script that works with DerVVulfman's "Simple SP Bonus
# Damage" script, letting the user create a damage pop for SP damage. It can
# work with battlesystems that are based on the default battlesystem, but has
# been adapated to work with Charlie Fleed's CTB and has some configurables
# for his battlesystem alone.
#
# NOTE: Charlie Fleed's Damage Pops have no fontname set. If you wish to
# make it match, set the SP_DAMAGE_FONTNAME to nil. ^_^
#
# IMPORTANT: Place below most scripts as it not only aliases, but places a
# stack error code into the affected methods that typically stops
# new code from being added... a sideeffect of the F12 stack fix.
#
#
#------------------------------------------------------------------------------
#
# TERMS AND CONDITIONS:
#
# Free to use, even in commercial projects. Just note that I need some form
# of due credit... even a mere mention in some end titles.
#
#==============================================================================



module SP_Damage

SP_DAMAGE_FONTNAME = 'Arial Black' # Font used for the damage pop

SP_DAMAGE_FONTSIZE = 28 # Size of the damage pop

SP_DAMAGE_FONTCOLOR = Color.new(0,0,255) # Color of the damage pop

SP_DAMAGE_SUFFIX = " SP" # Suffix of SP Damage in pop

SP_DAMAGE_ANIM = 5 # Bounce type for damage:
# 1 = Random Direction Bounce Pop
# 2 = Wavy Up Direction Pop
# 3 = Straight Up Pop
# 4 = Wide Wave Up Pop
# -- others have no bounce --

end


#==============================================================================
# ** Sprite_Battler
#------------------------------------------------------------------------------
# This sprite is used to display the battler.It observes the Game_Character
# class and automatically changes sprite conditions.
#==============================================================================

class Sprite_Battler < RPG::Sprite
#--------------------------------------------------------------------------
# * Frame Update
#--------------------------------------------------------------------------
alias sp_damagepop_update update
def update
sp_damagepop_update
# If visible
if @battler_visible
# SP Damage
if @battler.dvv_sp_damage_pop
# Create the Sprite Pop for SP Damage
sp_damage(@battler.dvv_sp_damage)
# Reset the pop values
@battler.dvv_sp_damage = nil
@battler.dvv_sp_damage_pop = false
end
end
end
end



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

class Scene_Battle
#--------------------------------------------------------------------------
# * Frame Update (main phase step 5 : damage display)
#--------------------------------------------------------------------------
alias sp_damagepop_update_phase4_step5 update_phase4_step5
def update_phase4_step5
# Display damage
for target in @target_battlers
target.dvv_sp_damage_pop = true if target.dvv_sp_damage != nil
end
sp_damagepop_update_phase4_step5
end
end



#==============================================================================
# ** RPG
#------------------------------------------------------------------------------
# A module containing RPGXP's data structures and more.
#==============================================================================
module RPG
#============================================================================
# ** RPG::Sprite
#----------------------------------------------------------------------------
# Class for sprites added to various effect handling used within RPGXP.
#============================================================================
class Sprite < ::Sprite
#------------------------------------------------------------------------
# * Object Initialization
#------------------------------------------------------------------------
if @derv_init_dmg_stack.nil?
@derv_init_dmg_stack = true
alias sp_damagepop_initialize initialize
def initialize(viewport = nil)
super(viewport)
sp_damagepop_initialize(viewport)
@_spdamage_duration = 0
end
end
#------------------------------------------------------------------------
# * Dispose
#------------------------------------------------------------------------
if @derv_disp_dmg_stack.nil?
@derv_disp_dmg_stack = true
alias sp_damagepop_dispose dispose
def dispose
# The Dispose
dispose_spdamage
# Original Call
sp_damagepop_dispose
end
end
#------------------------------------------------------------------------
# * SP Damage Pop
# valuex : sp damage value
#------------------------------------------------------------------------
def sp_damage(value)
dispose_spdamage
if value.is_a?(Numeric)
if SP_Damage::SP_DAMAGE_SUFFIX == nil
damage_string = value.abs.to_s
else
damage_string = value.abs.to_s + SP_Damage::SP_DAMAGE_SUFFIX
end
else
return
end
bitmap = Bitmap.new(160, 48)
unless SP_Damage::SP_DAMAGE_FONTNAME.nil?
bitmap.font.name = SP_Damage::SP_DAMAGE_FONTNAME
end
bitmap.font.size = SP_Damage::SP_DAMAGE_FONTSIZE
bitmap.font.color.set(0, 0, 0)
bitmap.draw_text(-1, 12-1, 160, 36, damage_string, 1)
bitmap.draw_text(+1, 12-1, 160, 36, damage_string, 1)
bitmap.draw_text(-1, 12+1, 160, 36, damage_string, 1)
bitmap.draw_text(+1, 12+1, 160, 36, damage_string, 1)
bitmap.font.color = SP_Damage::SP_DAMAGE_FONTCOLOR
bitmap.draw_text(0, 12, 160, 36, damage_string, 1)
@_spdamage_sprite = ::Sprite.new(self.viewport)
@_spdamage_sprite.bitmap = bitmap
@_spdamage_sprite.ox = 80
@_spdamage_sprite.oy = -5
@_spdamage_sprite.x = self.x
@_spdamage_sprite.y = self.y - self.oy / 2
@_spdamage_sprite.z = 3000
if $charlie_lee_ctb == true
@_spdamage_duration = DAMAGE_DURATION
else
@_spdamage_duration = 40
end
end
#------------------------------------------------------------------------
# * Dispose SP Damage Pop
#------------------------------------------------------------------------
def dispose_spdamage
if @_spdamage_sprite != nil
@_spdamage_sprite.bitmap.dispose
@_spdamage_sprite.dispose
@_spdamage_sprite = nil
@_spdamage_duration = 0
end
end
#------------------------------------------------------------------------
# * Effect Check
#------------------------------------------------------------------------
if @derv_effect_dmg_stack.nil?
@derv_effect_dmg_stack = true
alias sp_damagepop_effect? effect?
def effect?
effective = sp_damagepop_effect?
effective or @_spdamage_duration > 0
end
end
#------------------------------------------------------------------------
# * Frame Update
#------------------------------------------------------------------------
alias sp_damagepop_sprite_update update
def update
# Original Call
sp_damagepop_sprite_update
# If using Charlie Fleed's CTB
if $charlie_lee_ctb == true
# If sp damage should be visible
if @_spdamage_duration > 0
# initialize "zero" height and speed
if @_spdamage_duration == DAMAGE_DURATION
@_spdamage_starting_y = @_spdamage_sprite.y
@_spdamage_xv = rand(2) - 1
@_spdamage_yv = -3 - rand(2)
end
@_spdamage_duration -= 1
if SP_Damage::SP_DAMAGE_ANIM == 1
@_spdamage_sprite.x += @_spdamage_xv
@_spdamage_yv += 0.4
@_spdamage_sprite.y += @_spdamage_yv
# invert y speed if "zero" height is reached
# update the "zero" height
if @_spdamage_sprite.y >= @_spdamage_starting_y
@_spdamage_yv = -@_spdamage_yv * 0.6
# stop animation
if @_spdamage_yv >= -2.0
@_spdamage_yv = 0
@_spdamage_xv = 0
end
@_spdamage_starting_y = @_spdamage_sprite.y
end
elsif SP_Damage::SP_DAMAGE_ANIM == 2
@_spdamage_sprite.x += 0.75 * SIN_INCREMENTS[(DAMAGE_DURATION - @_spdamage_duration) / 4]
@_spdamage_sprite.y -= 1
elsif SP_Damage::SP_DAMAGE_ANIM == 3
@_spdamage_sprite.y -= 2
elsif SP_Damage::SP_DAMAGE_ANIM == 4
@_spdamage_sprite.x -= 0.75 * SIN_INCREMENTS[(DAMAGE_DURATION - @_spdamage_duration) / 4]
@_spdamage_sprite.y -= 1
else
# nothing
end
@_spdamage_sprite.opacity = 256 - (12 - @_spdamage_duration) * 32
end
# When done with Pop
if @_spdamage_duration == 0
dispose_spdamage
end
# Otherwise, a Default Pop
else
if @_spdamage_duration > 0
@_spdamage_duration -= 1
case @_spdamage_duration
when 38..39
@_spdamage_sprite.y -= 4
when 36..37
@_spdamage_sprite.y -= 2
when 34..35
@_spdamage_sprite.y += 2
when 28..33
@_spdamage_sprite.y += 4
end
@_spdamage_sprite.opacity = 256 - (12 - @_spdamage_duration) * 32
# Dispose damage when time expired
if @_spdamage_duration == 0
dispose_spdamage
end
end
end
end
end
end
}
#13
(02-11-2014, 01:50 PM)Steel Beast 6Beets Wrote: I searched on all the scripts and I couldn't find any misspelling or typo. I tried putting the HP Drain script below these previously mentioned scripts yet the error persisted.....

I found another thing: when copying and pasting the common event call, it gets twisted into this:

Code:
absorb = $game_temp.sp_damage_hook * -1
$scene.active_battler.dvv_sp_damage_p
op = absorb
$scene.active_battler.dvv_sp_damage_p
op=true
$scene.active_battler.sp -= absorb

The codes are just too long for the script window.

There ya go. Too long, they get cut off and VOLIA, your dvv_sp_damage_p

Try using this in your common event:
Code:
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
You can have a line break after the period (.)


(02-11-2014, 01:50 PM)Steel Beast 6Beets Wrote: I also noticed you could drain SP from enemies that don't have any SP (The error shows up when trying to add that amount of SP to the character's SP). Perhaps that has something to do with the error?
Er... no. But a sp checking feature could be put into the system:
Code:
# Set hook to damage
    if self.dvv_sp_damage.is_a?(Numeric)
      sp = self.sp - self.dvv_sp_damage
      # Only if SP remaining
      if sp > 0
        $game_temp.sp_damage_hook += self.dvv_sp_damage
      end
    end
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
}
#14
I tested it and everything works as intended. A thousand thanks! Grinning
}


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



Users browsing this thread: 1 Guest(s)