Damage Images
Authors: game_guy
Version: 1.4
Type: Damage Display
Key Term: Battle Add-on
IntroductionWant to spice up the way your damage looks? Tired of plain old text? Well now you can use images as a replacement for the text! Have different images for healing, dealing damage, miss and critical!
Features
- Image for Normal Damage
- Image for Healing Damage
- Image for Miss
- Image for Critical
- Image for Defend (Blizz-ABS Only)
- Image for Level Up (Blizz-ABS Only)
- Basically Plug & Play
Screenshots(http://decisive-media.net/gameguy/scripts/damage_images.png)
DemoSelf Extracting Archive (1.4) (http://decisive-media.net/gameguy/scripts/damage_images.exe)
Zip Archive (1.4) (http://decisive-media.net/gameguy/scripts/damage_images.zip)
ScriptThere are images you can use from the demo.
#===============================================================================
# Damage Images
# Author game_guy
# Version 1.4
#-------------------------------------------------------------------------------
# Intro:
# Want to spice up the way your damage looks? Tired of plain old text? Well
# now you can use images as a replacement for the text! Have different images
# for healing, dealing damage, miss and critical!
#
# Features:
# Image for Normal Damage
# Image for Healing Damage
# Image for Miss
# Image for Critical
# Basically Plug & Play
#
# Instructions:
# Go down to the config below and set all file names to the appropriate type
# of damage.
# -Setting up Images:
# Creating the images for this to work is quite easy. The easiest ones to
# create are the ones for Miss and Critical. For those two you just need an
# image that says "Miss" and "Critical". The numbers take a little bit more
# effort to setup but its still pretty simple.
#
# You need 10x1 cells. Each cell goes horizontally across with the same width
# and same height. You place numbers 0-9 in each of the cells in numeric order.
# Then import it into pictures folder and you should be done.
# e.g.
# +---------------------------------------+
# ¦ 0 ¦ 1 ¦ 2 ¦ 3 ¦ 4 ¦ 5 ¦ 6 ¦ 7 ¦ 8 ¦ 9 ¦
# +---------------------------------------+
#
# Compatibility:
# Not tested with SDK.
# Won't work for any other damage appearance mods.
#
# Version History:
# v1.0
# -Initial release
# v1.1
# -Added support for Blizz-ABS
# v1.2beta
# -Fixed Damage numbers when Healing for Blizz-ABS
# Possibly unstable. Overwrites method in BlizzABS::Utility class.
# Not sure if it can or will cause any bugs.
# v1.2
# -Removed overwrite of Utility method
# v1.3
# -Added level up image for Blizz-ABS Only
# -Added defend image for Blizz-ABS Only
# v1.4
# -Fixed healing bug...again. ._.
#
# Credits:
# game_guy ~ For creating the script.
# Blizzard ~ LoL's damage appearance gave me the idea.
#===============================================================================
module GG_DamageImages
NORMAL_FILE = "dmg_normal"
HEAL_FILE = "dmg_heal"
MISS_FILE = "dmg_miss"
CRITICAL_FILE = "dmg_critical"
LEVEL_UP_FILE = "dmg_level" # FOR BLIZZ-ABS ONLY!
DEFEND_FILE = "dmg_defend" # FOR BLIZZ-ABS ONLY!
end
module RPG
#==============================================================================
# ** RPG::Sprite
#------------------------------------------------------------------------------
# Processes effects applied to sprites.
#==============================================================================
class Sprite < ::Sprite
# Include Config Module
include GG_DamageImages
#--------------------------------------------------------------------------
# * Damage
#--------------------------------------------------------------------------
def damage(value, critical)
# dispose old damage
dispose_damage
# set heal and miss variables
heal = false
miss = false
# if value is a number
if value.is_a?(Numeric)
# set damage_string to value
damage_string = value.abs.to_s
# set heal to true if value less then zero
heal = value < 0 ? true : false
else
# set damage_string to value
damage_string = value.to_s
# set miss to true
miss = true
end
# if miss
if miss
# load miss
damage = MISS_FILE
elsif heal
# load heal
damage = HEAL_FILE
else
# load normal
damage = NORMAL_FILE
end
if critical
# load critical
crit = RPG::Cache.picture(CRITICAL_FILE)
end
# load image
image = RPG::Cache.picture(damage)
# set cell width
cwidth = image.width / 10
# set cell height
cheight = image.height
# set image height taking variables into accordance
height = critical == true ? image.height + crit.height : image.height
# set width according to amount of damage
width = damage_string.size * cwidth
# set x and y offset
yy = 0
xx = 0
# if critical
if critical
# if damage width is less then critical's image width
if width < crit.width
# set x offset
xx = crit.width / 2 - width / 2
# set new width
width = crit.width
# set y offset
yy = crit.height
end
end
# create bitmap from width and height
bitmap = Bitmap.new(width, height)
# if value is a number
if value.is_a?(Numeric)
# iterate through damage_string
for i in 0...damage_string.size
# grab actual number from damage_string
int = damage_string[i, 1].to_i
# create rectangle according to int
rect = Rect.new(int * cwidth, 0, cwidth, cheight)
# draw number
bitmap.blt(xx + i * cwidth, yy, image, rect)
end
else
# set rectangle
rect = Rect.new(0, 0, image.width, image.height)
# set new bitmap
bitmap = Bitmap.new(image.width, image.height)
# draw miss image
bitmap.blt(0, 0, image, rect)
end
# if critical
if critical
# create rectangle
rect = Rect.new(0, 0, crit.width, crit.height)
# draw critical image
bitmap.blt(0, 0, crit, rect)
end
@_damage_sprite = ::Sprite.new(self.viewport)
@_damage_sprite.bitmap = bitmap
@_damage_sprite.ox = bitmap.width / 2
@_damage_sprite.oy = 20
@_damage_sprite.x = self.x
@_damage_sprite.y = self.y - self.oy / 2
@_damage_sprite.z = 3000
@_damage_duration = 40
end
end
end
if $BlizzABS
class Sprite_Damage < Sprite
include GG_DamageImages
include BlizzABS
def draw_damage(request)
heal = false
miss = false
level = false
defend = false
real_damage = false
case request.color
when Cache::DMGColors['HP+A'], Cache::DMGColors['HP+E']
heal = true
real_damage = true
when Cache::DMGColors['SP+A'], Cache::DMGColors['SP+E']
heal = true
real_damage = true
when Cache::DMGColors[Cache::TXTDefend]
defend = true
when Cache::DMGColors[Cache::TXTMiss]
miss = true
when Cache::DMGColors[Cache::TXTLvlUp]
level = true
else
real_damage = true
end
if real_damage
value = request.damage.to_i.abs
damage_string = value.to_s
else
value = request.damage
damge_string = value.to_s
end
damage_string = value.to_s if damage_string == nil
critical = request.critical
if miss
damage = MISS_FILE
elsif level
damage = LEVEL_UP_FILE
elsif defend
damage = DEFEND_FILE
elsif heal
damage = HEAL_FILE
else
damage = NORMAL_FILE
end
if critical
crit = RPG::Cache.picture(CRITICAL_FILE)
end
image = RPG::Cache.picture(damage)
cwidth = image.width / 10
cheight = image.height
height = critical == true ? image.height + crit.height : image.height
width = damage_string.size * cwidth
yy = 0
xx = 0
if critical
if width < crit.width
xx = crit.width / 2 - width / 2
width = crit.width
yy = crit.height
end
end
bitmap = Bitmap.new(width, height)
if value.is_a?(Numeric)
for i in 0...damage_string.size
int = damage_string[i, 1].to_i
rect = Rect.new(int * cwidth, 0, cwidth, cheight)
bitmap.blt(xx + i * cwidth, yy, image, rect)
end
else
rect = Rect.new(0, 0, image.width, image.height)
bitmap = Bitmap.new(image.width, image.height)
bitmap.blt(0, 0, image, rect)
end
if critical
rect = Rect.new(0, 0, crit.width, crit.height)
bitmap.blt(0, 0, crit, rect)
end
self.bitmap = bitmap
@critical = request.critical
end
end
end
InstructionsIn the script.
CompatibilityNot tested with SDK.
Most likely will not work with any other battle damage display mods.
Works with Blizz-ABS. Place below Blizz-ABS
Credits and Thanks
- game_guy ~ For creating it.
- Blizzard ~ For having a fancy visual damage display in LoL. (which inspired me)
- winkio ~ Help with more efficient method for Blizz-ABS add-on
Author's NotesEnjoy!
is this can be used with blizz abs?
Possibly. Not tested. Could you test it out for me? I'm not sure if Blizz-ABS uses the same method name for drawing sprite damage. If you do test it out, place the script below Blizz-ABS.
I tested it with blizz abs 2.8.0 and didn't have any effect
Alright. I'll try and make a plug-in for it then.
This should be easy enough. You have the SpriteDamage class (or a similar name) that you just need to adjust so it works fine.
Updated to work with Blizz-ABS. Tested myself.
Whoa, worked with RPG and ABS (Blizz's one). Awesome game_guy. :D
when I heal my character it shows damage sprite (dmg_normal.png) instead of healing sprite (dmg_heal.png)
(http://img403.imageshack.us/img403/2163/80236704.jpg)
Updated to 1.2beta
Its possible that it could be unstable. I rewrote a method in the Utility class in order for heal damage to work correctly. Now I won't know if I need to redo something or go about it a different way until someone runs into a bug or if winkio or blizzard takes a look at it.
All I did was remove all the times .abs were called from it. But it still may cause errors or bugs later on down the road.
Quote from: game_guy on January 17, 2011, 09:32:20 pm
Updated to 1.2beta
Its possible that it could be unstable. I rewrote a method in the Utility class in order for heal damage to work correctly. Now I won't know if I need to redo something or go about it a different way until someone runs into a bug or if winkio or blizzard takes a look at it.
All I did was remove all the times .abs were called from it. But it still may cause errors or bugs later on down the road.
How did you manage to read all the code in Blizz-ABS?? :wacko:
You are awesome!!! :haha:
I will use this if I make ABS games....
Quote from: Storm on January 17, 2011, 09:49:46 pm
Quote from: game_guy on January 17, 2011, 09:32:20 pm
Updated to 1.2beta
Its possible that it could be unstable. I rewrote a method in the Utility class in order for heal damage to work correctly. Now I won't know if I need to redo something or go about it a different way until someone runs into a bug or if winkio or blizzard takes a look at it.
All I did was remove all the times .abs were called from it. But it still may cause errors or bugs later on down the road.
How did you manage to read all the code in Blizz-ABS?? :wacko:
You are awesome!!! :haha:
I will use this if I make ABS games....
simple answer, you don't. the few times I've extended Babs I only looked at the methods I needed to and I only retained the information long enough to write the script. I only know enough about the way Babs works to know where to look if I need to modify or extend something.
Quote from: Ryex on January 17, 2011, 10:42:18 pm
Quote from: Storm on January 17, 2011, 09:49:46 pm
Quote from: game_guy on January 17, 2011, 09:32:20 pm
Updated to 1.2beta
Its possible that it could be unstable. I rewrote a method in the Utility class in order for heal damage to work correctly. Now I won't know if I need to redo something or go about it a different way until someone runs into a bug or if winkio or blizzard takes a look at it.
All I did was remove all the times .abs were called from it. But it still may cause errors or bugs later on down the road.
How did you manage to read all the code in Blizz-ABS?? :wacko:
You are awesome!!! :haha:
I will use this if I make ABS games....
simple answer, you don't. the few times I've extended Babs I only looked at the methods I needed to and I only retained the information long enough to write the script. I only know enough about the way Babs works to know where to look if I need to modify or extend something.
Are you saying I'm walking on the difficult road while you are walking on the easy road? :???:
I will learn this script and Blizz-ABS then. Thanks for suggestions.
Quote from: game_guy on January 17, 2011, 09:32:20 pm
Updated to 1.2beta
Its possible that it could be unstable. I rewrote a method in the Utility class in order for heal damage to work correctly. Now I won't know if I need to redo something or go about it a different way until someone runs into a bug or if winkio or blizzard takes a look at it.
All I did was remove all the times .abs were called from it. But it still may cause errors or bugs later on down the road.
Wait, why would removing abs fix it? Anyways, for a solution, I'd just alias it, and only do your processing if certain conditions are met (like healing, or whatever).
Because the .abs made the negative damage (the healing damage) into a positive damage. My script checks to see if the value is less then 0 that way it knows if its healing or not. I wasn't sure if removing those would cause anything but when I did remove it I was pretty positive it wouldn't conflict with anything. But I wouldn't know. Blizz-ABS is very very complex to me. :S
Anyways I'm going to alias the method and do a few things to try and make it non conflicting.
oh, that's easy, you don't even need to do anything with the Blizz-ABS methods. Just in your Damage_Sprite modifications, branch based on request.color
Updated to 1.3.
Added images for Defend and Level Up for the Blizz-ABS add-on. Removed method overwrite. Works like a charm now ;)
I get an error with this script, what should i do?
---edit : sorry I realized I placed the script wrong
Post the error message so someone can help.
Quote from: Wizered67 on January 18, 2011, 09:48:59 pm
Post the error message so someone can help.
nevermind, I placed the script above BABS that's why i got an error :shy:
thanks game_guy it works now :haha:
G_G would like to inform you all that he has an update for this script, but he isn't able to post it at this time.
He would also like you all to send him some n00dz. OH FUCK, WRONG TEXT :V
Updated. Fixed healing bug.
hey hey game_guy, is this script support your 7777 damage too?
http://forum.chaos-project.com/index.php?topic=4388.0
I have a problem, when player cast a buff type skill (like sharp) it show damage sprite 0,
It's not fatal, just a bit weird
(http://img17.imageshack.us/img17/7052/33729256.jpg)
Found a bug!
(I'm using the default battle system)
When you get a buff messege(such as... Blink, sharp, barrier, resist etc etc... you get an error:
----
Script'Damage Images' line 139: RGSSEError ocurred.
Failed to create bitmap
----
Sorry to come with bad news :P
I'll look at it later. As in later of course I mean in a month or so. Then forget about it. I'll take a look. :3
Quote from: game_guy on April 02, 2011, 02:32:51 am
I'll look at it later. As in later of course I mean in a month or so. Then forget about it. I'll take a look. :3
Would be awesome if it was fixed some day, the damage numbers i created was stylish! x3
Please tell me when/if you fix it :)
Uppdate: I altso get an error with it when placing a debuff on an enemy while using the stormtronics_CMS script by blizzard.
It seems they are not compadible.