LOGIN
SEARCH
PROFILE
keys: ↑ ↓
LOGOUT
INDEX
MEMBERS
keys: ↑ ↓
HOME
PORTAL
PLAY ALONG
PLAY with WORDS
PLAY with GRAPHICS
PLAY with SOUNDS
PLAY with CODES
PLAY with PROJECTS
keys: ← →
Guest Access
Register:
Members:



Go to page : 1, 2  Next

View previous topic View next topic Go down Message [Page 1 of 2]

EVENTALIST
EVENTALIST
#1 XAS - Blood Effects
Loading

mr_wiggles

EVENTALIST
 EVENTALIST
EVENTALIST
profile
XAS - Blood Effects
Version: 2.3
Author: Mr Wiggles
Date: April 28, 2011

Version History



  • Version 2.3 4/28/11 - Added new feature, more random effects.
  • Version 2.0 2/8/11 - Changed how effects where created.
  • Version 1.6 6/27/10 - Fixed hue colors that where wrong. Cleaned the code up. Fixed bleeding when healing.
  • Version 1.5 6/26/10 - Added more features
  • Version 1.0 6/25/10 - Original Release


Planned Future Versions

  • More features and such, idk what...


Description


This will make Enemies and the player bleed when hurt, cause every one likes a little gore in their games.
New in 1.5 Blood screen effects. this will show blood splats on the game screen when the player is hurt.

Features

  • ID filter, only enemies that are not trap nor item will bleed.
  • Random blood selection makes the splatters looks some what unique.
  • V1.5 - Blood hues so that different enemy's can have different colored blood.
  • V1.5 - Blood screen splatters, puts a randomly selected blood picture on the game screen that will fade away after a set time.
  • V2.3 - Different blood sets for each enemy.
  • V2.3 - Selective blood effects based on attack id.


Screen shots
if you bug me about it i will post a screen snap for you.

Instructions
Paste this script bellow XAS scripts and above main then make sure you have "Blood" character set in your Graphics/Characters folder in your project directory and put the "Blood_Sheet" in your Graphics/Pictures folder.

script


"Blood" character set: (feel free to make edits)

"Blood_Sheet":



Code:

#===============================================================================
# XAS - Blood Effects
#===============================================================================
# by Mr_Wiggles
# Version 2.3
# 4/28/11
#===============================================================================
module Blood
#-------------------------------------------------------------------------------
# Blood splatter effects
#-------------------------------------------------------------------------------
# Number of seconds blood is shown for
BLOOD_EARASE_TIME = 10
# Make the blood slightly see through? (0 - 255)
BLOOD_OPACITY = 180
#-------------------------------------------------------------------------------
# Monster blood colors. when A; return B ("A" monster ID, "B" hue [0 - 350] )
# Hue colors: 0 = red; 40 = yellow; 120 = green; 190 = sky blue;
# 220 = navy blue; 260 = purple; 310 = pink; 350 = red
# (same for actors but id's are negative, so actor 4 is id -4)
  def blood_hues(id)
    case id
    # when (enemy id) then return (Hue value)
    when 2 then return 180
    when 5 then return 40
    else # this will return the default blood color
      return 0
    end
  end
#-------------------------------------------------------------------------------
# Monster blood character set.
  def blood_name(id)
    case id
    # when (enemy id) then return (IMG name)
    when 1 then return "Ciructs"
    else # Default IMG name
      return "Blood"
    end
  end
end
#-------------------------------------------------------------------------------
# Tool id's that dont cause bleeding.
NO_BLOOD_TOOL  = [1,2,3]
# Enemies that dont cause bleeding. (actor id's are negative)
NO_BLOOD_ENEMY = [1,2,2]
#-------------------------------------------------------------------------------
# Blood screen effects
#-------------------------------------------------------------------------------
# Use screen blood effects
USE_BLOODY_SCREEN = true
# Number of seconds before blood fades off of screen
BLOOD_DURATION = 10
# Opacity of blood splatters on screen
BLOOD_SCREEN_OPACITY = 200
# Name of picture used for blood splaters
BLOOD_SHEET = "Blood_Sheet"

#===============================================================================
# XRXS Battler Attachment
#===============================================================================
module XRXS_BattlerAttachment
  alias :be_action_effect :action_effect
  def action_effect(bullet, action_id)
    eff = be_action_effect(bullet, action_id)
    user    = bullet.action.user
    skill    = $data_skills[action_id]
    return if user.nil? or skill.nil?
    make_be  = true
    if self.battler.is_a?(Game_Enemy) and
        (XAS_BA_ENEMY::ENEMY_OBJECT.include?(self.id) or
        XAS_BA_ENEMY::ITEM_ENEMY.include?(self.id))
      make_be = false
    end
    if make_be and !NO_BLOOD_TOOL.include?(skill.id)
      be_make_effect(user, skill)
    end
    return eff
  end

  alias :be_attack_effect :attack_effect
  def attack_effect(attacker)
    eff = be_attack_effect(attacker)
    make_be = true
    if self.battler.is_a?(Game_Enemy) and
        (XAS_BA_ENEMY::ENEMY_OBJECT.include?(self.id) or
        XAS_BA_ENEMY::ITEM_ENEMY.include?(self.id))
      make_be = false
    end
    if make_be and !NO_BLOOD_ENEMY.include?(attacker.id)
      be_make_effect(attacker)
    end
    return eff
  end
end
 
#===============================================================================
# Game Character
#===============================================================================
class Game_Character
  def be_make_effect(user, skill = nil)
    @be_old_hp = self.battler.hp if @be_old_hp.nil?
    self_id = self.battler.id
    self_id *= -1 if self.battler.is_a?(Game_Actor)
    user_id = user.battler.id
    user_id *= -1 if user.battler.is_a?(Game_Actor)
    if @be_old_hp != self.battler.hp and (@be_old_hp - self.battler.hp > 0)
      $scene.make_blood_effect(@real_x, @real_y, self_id)
    end
    @be_old_hp = self.battler.hp
  end
end

#===============================================================================
# Blood Screen
#===============================================================================
class Bloody_Window < Window_Base
  def initialize
    super(-20, -20, 700, 600)
    self.contents = Bitmap.new(width - 32, height - 32)
    self.opacity = 0
    self.z = 900
    @blood_graphics = []
    @blood_sheet = RPG::Cache.picture(BLOOD_SHEET)
    @wt = @blood_sheet.width / 4
    @ht = @blood_sheet.height / 4
    update
  end

  def refresh
    self.contents.clear
    for blood in @blood_graphics
      rect = Rect.new(@wt * blood[2][0], blood[2][1] * @ht, @wt, @ht)
      self.contents.blt(blood[0], blood[1], @blood_sheet, rect, blood[4])
    end
  end
 
  def make_random_blood
    loop do
      stop_loop = true
      x = (rand(50) * 10) + 20
      y = (rand(40) * 10) + 20
      n = [rand(2)+rand(2), rand(2)+rand(2)]
      @blood_graphics.each {|b| stop_loop = false if b[2] == n}
      if stop_loop
        @blood_graphics.push([x, y, n, BLOOD_DURATION * 8, BLOOD_SCREEN_OPACITY])
        break
      end
    end
  end

  def update
    @actor = $game_party.actors[0]
    @old_player_hp = @actor.hp if @old_player_hp.nil?
    if @old_player_hp != @actor.hp
      make_random_blood if (@old_player_hp - @actor.hp > 0)
      @old_player_hp = @actor.hp
    end
    return if @blood_graphics.empty?
    @blood_graphics.each {|blood| update_blood(blood)}
    refresh
  end

  def update_blood(blood)
    if blood[4] == 0
      @blood_graphics.delete(blood)
      return
    end
    blood[3] -= 5 if blood[3] > 0
    blood[4] -= 5 if blood[4] > 0 and blood[3] <= BLOOD_SCREEN_OPACITY
  end
end

#==============================================================================
# Scene Map
#==============================================================================
class Scene_Map
  alias blood_window_main main
  def main
    if USE_BLOODY_SCREEN
      @blood_window = Bloody_Window.new
      @blood_update_pause = 5
    end
    blood_window_main
    @blood_window.dispose if USE_BLOODY_SCREEN
  end

  alias blood_window_update update
  def update
    blood_window_update
    return if @blood_update_pause.nil?
    @blood_update_pause -= 1 if @blood_update_pause > 0
    return if @blood_update_pause > 0
    @blood_window.update; @blood_update_pause = 5
  end
 
  def make_blood_effect(*args)
    @spriteset.make_blood_effect(*args)
  end
end

#==============================================================================
# Spriteset Map
#==============================================================================
class Spriteset_Map 
  alias :blood_effects_init :initialize
  def initialize
    @blood = []
    blood_effects_init
  end
 
  def make_blood_effect(x, y, id)
    @blood.push(Sprite_Blood.new(@viewport1, x, y, id))
  end
 
  alias :blood_effects_up :update
  def update
    blood_effects_up
    @blood.each{|blood| blood.update if !blood.disposed?}
  end
 
  alias :blood_effects_dis :dispose
  def dispose
    blood_effects_dis
    @blood.each{|blood| blood.dispose if !blood.disposed?}
  end
end

#==============================================================================
# Sprite Blood
#==============================================================================
class Sprite_Blood < RPG::Sprite
  include Blood

  def initialize(viewport, x, y, id)
    super(viewport)
    @x, @y, @id = x, y, id
    @duration = (BLOOD_EARASE_TIME * 40) + BLOOD_OPACITY
    set = blood_name(@id)
    bit = RPG::Cache.character(set, blood_hues(@id)) rescue nil
    if bit.nil?
      $blood_fails = [] if $blood_fails.nil?
      unless $blood_fails.include?(set)
        $blood_fails.push(set)
        print("Blood effect character set \"#{set}\" was not found!")
      end
      self.dispose
      return
    end
    self.bitmap = bit
    @cw, @ch = bitmap.width  / 4, bitmap.height / 4
    sx, sy = rand(4) * @cw, rand(4) * @ch
    self.src_rect.set(sx, sy, @cw, @ch)
    self.opacity = BLOOD_OPACITY
    self.x = screen_x
    self.y = screen_y
    self.z = 1
    update
  end
 
  def screen_x
    return (@x - $game_map.display_x) / 4
  end

  def screen_y
    return (@y - $game_map.display_y) / 4
  end

  def update
    self.x = screen_x
    self.y = screen_y
    @duration -= 1
    self.opacity -= 1 if BLOOD_OPACITY <= @duration
    self.dispose if @duration == 0
  end
end

Support


Post any suggestions for future updates or any errors you may encounter here.

Known Compatibility Issues
none that i know of.

Restrictions
DO NOT post this on any other forum with out my permission, you are free to edit this in any way you see fit but you must still credit me some where.
EVENTALIST
Show Signature
EVENTALIST
Active Member
Active Member
#2 Re: XAS - Blood Effects
Loading

Legault123

Active Member
Active Member
Active Member
profile
Another great script, thanks Mr. Wiggles!
Active Member
Show Signature
Active Member
Administrator
Administrator
#3 Re: XAS - Blood Effects
Loading

G@MeF@Ce

Administrator
Administrator
Administrator
profile
time to BLEED!

@wiggles - ever since your code has bursted into flames you have been burning down the house!

maybe I can edit this blood splatter animation sheet into a character one...

Spoiler:

thanks for sharing! "killer idea"
Administrator
Show Signature
Administrator
https://www.dropbox.com/sh/i47rig99qhrvn8s/4m5HvsM2fD http://g4m3f4c3.deviantart.com https://www.facebook.com//pages/Gameface101/332331300127008 https://twitter.com//mr_gameface101 https://soundcloud.com/schurr http://www.youtube.com/user/MrGameface101?feature=watch
EVENTALIST
EVENTALIST
#4 Re: XAS - Blood Effects
Loading

mr_wiggles

EVENTALIST
 EVENTALIST
EVENTALIST
profile
you shouldn't have a problem with doing that (i like that animation).
i have been trying to think up some ideas for an update. (right now i fixed it so that the blood fades away instead of shrinking. but im waiting to update until i have a few more additions to the script.
EVENTALIST
Show Signature
EVENTALIST
Administrator
Administrator
#5 Re: XAS - Blood Effects
Loading

G@MeF@Ce

Administrator
Administrator
Administrator
profile
ooh how about including a picture that takes up the whole screen and fades away
to give that bloody screen affect ^,^ "?"
Administrator
https://www.dropbox.com/sh/i47rig99qhrvn8s/4m5HvsM2fD http://g4m3f4c3.deviantart.com https://www.facebook.com//pages/Gameface101/332331300127008 https://twitter.com//mr_gameface101 https://soundcloud.com/schurr http://www.youtube.com/user/MrGameface101?feature=watch
Active Member
Active Member
#6 Re: XAS - Blood Effects
Loading

Legault123

Active Member
Active Member
Active Member
profile
Maybe after a Killer Overdrive realease the screen just covers with blood just like gameface said, or what about, the stronger the attack, more blood on the floor! Can't wait to see your next script
Active Member
Show Signature
Active Member
EVENTALIST
EVENTALIST
#7 Re: XAS - Blood Effects
Loading

mr_wiggles

EVENTALIST
 EVENTALIST
EVENTALIST
profile
cool sounds like some great updates, i think i might start work on the new version.
EVENTALIST
Show Signature
EVENTALIST
Active Member
Active Member
#8 Re: XAS - Blood Effects
Loading

unrivaledneo

Active Member
Active Member
Active Member
profile
Like i suggested on the other Thread. Maybe have it so u can define what monsters done give off blood, and maybe have it defineable so different monsters give off different types of blood. (Trying to think simple) ALso Blood projection instead of dropping at the feet ...

All I got...

OFFTOPIC: WOuld ya mind if I posted this on the new XAS Wiki im making for the XAS Tutorial site?
Active Member
Show Signature
Active Member
EVENTALIST
EVENTALIST
#9 Re: XAS - Blood Effects
Loading

mr_wiggles

EVENTALIST
 EVENTALIST
EVENTALIST
profile
thanks for the update suggestions i put a lot of them in the new update.
*script was updated*

@neo - im gonna see what i can do about the blood spraying instead of falling in the next update cause i want the blood to be thrown realistically away from the point of impact, so i need to see how i can do that.
EVENTALIST
Show Signature
EVENTALIST
Administrator
Administrator
#10 Re: XAS - Blood Effects
Loading

G@MeF@Ce

Administrator
Administrator
Administrator
profile
ha! this is "bloody smashin!" the update rocks! ^,^
Administrator
https://www.dropbox.com/sh/i47rig99qhrvn8s/4m5HvsM2fD http://g4m3f4c3.deviantart.com https://www.facebook.com//pages/Gameface101/332331300127008 https://twitter.com//mr_gameface101 https://soundcloud.com/schurr http://www.youtube.com/user/MrGameface101?feature=watch
Active Member
Active Member
#11 Re: XAS - Blood Effects
Loading

unrivaledneo

Active Member
Active Member
Active Member
profile
like always. great work! Blood n gore galor!
Active Member
Show Signature
Active Member
ACTIVATED
ACTIVATED
#12 Re: XAS - Blood Effects
Loading

DontSay

ACTIVATED
ACTIVATED
ACTIVATED
profile
mr_wiggles I like your idea with the blood-effects.. ^^ Nice work...
But ther themes to be an error when you heal yourself, the character is bleeding too...
But that's the only thing I found.. the rest works great and I maybe will use it, when the framerate stays good the whole game.. ^^
Hope to see more of your great scripts...

Greetz,
DontSay ^^
ACTIVATED
Show Signature


ACTIVATED
http://www.lorae.de.vu
EVENTALIST
EVENTALIST
#13 Re: XAS - Blood Effects
Loading

mr_wiggles

EVENTALIST
 EVENTALIST
EVENTALIST
profile
yea i put a "healing" filter on the screen effects but no on the original script where the sprites bleed on the ground I'll make sure that i fix that in the next up date. also i found out that the hue colors i have said where wrong that's what i get for going off of ms paint. (they are fixed now)
*minor update*
EVENTALIST
Show Signature
EVENTALIST
Active Member
Active Member
#14 Re: XAS - Blood Effects
Loading

unrivaledneo

Active Member
Active Member
Active Member
profile
OOO I had a idea! Bleeding! Like either A: As a state like DOT(damage over time) the player/enemys bleeds when he walks leaving a blood trail, or B: WHen the player/enemy is at X% HP or some shot idk im just handing out ideas :p
Active Member
Show Signature
Active Member
EVENTALIST
EVENTALIST
#15 Re: XAS - Blood Effects
Loading

mr_wiggles

EVENTALIST
 EVENTALIST
EVENTALIST
profile
Those ideas sound cool, when i get the time i will add them in.
EVENTALIST
Show Signature
EVENTALIST
ACTIVATED
ACTIVATED
#16 Re: XAS - Blood Effects
Loading

elisamuelps

ACTIVATED
ACTIVATED
ACTIVATED
profile
Great system Smile i have a great idea Smile why dont make this system with this effects, a red flash over 200 frames if the character have lower healt, and put a sound like a beat, maybe too the screen picture system can be edited a litle to activate when u have low hp, why many blood tire....
ACTIVATED
Show Signature
ACTIVATED
EVENTALIST
EVENTALIST
#17 Re: XAS - Blood Effects
Loading

mr_wiggles

EVENTALIST
 EVENTALIST
EVENTALIST
profile
All these ideas, are just great, I'm very busy with RL stuff as well as other scripts and a project of my own, so when i find the time i can start adding in some of these suggestions and then update the script.
EVENTALIST
Show Signature
EVENTALIST
Administrator
Administrator
#18 Re: XAS - Blood Effects
Loading

G@MeF@Ce

Administrator
Administrator
Administrator
profile
i have a great idea, why dont make this system with this effects, a red flash over 200 frames if the character have lower healt, and put a sound like a beat, maybe too the screen picture system can be edited a litle to activate when u have low hp, why many blood tire....

@elisamuelps - check out the demo

http://www.atelier-rgss.com/RGSS/System/XP_SYS09.html


@wiggles - have I told you that this Blood script ROCKS!?
Administrator
Show Signature
Administrator
https://www.dropbox.com/sh/i47rig99qhrvn8s/4m5HvsM2fD http://g4m3f4c3.deviantart.com https://www.facebook.com//pages/Gameface101/332331300127008 https://twitter.com//mr_gameface101 https://soundcloud.com/schurr http://www.youtube.com/user/MrGameface101?feature=watch
ACTIVATED
ACTIVATED
#19 Re: XAS - Blood Effects
Loading

Ragnai

ACTIVATED
ACTIVATED
ACTIVATED
profile
I really love this addition but there are a few things that are bugging me:
The blood is 'always on top' even with:
page.move_frequency = 1; page.always_on_top = false
I'm using XAS3.8

A second 'problem' resides in the manner in which the script chooses the blood graphic:
Couldn't there be some random choosing factor or going through the charset one by one?
I've often got 10 times the same blood-effect in a row due to the attack direction.

Thanks in advance.
ACTIVATED
Show Signature
ACTIVATED
EVENTALIST
EVENTALIST
#20 Re: XAS - Blood Effects
Loading

mr_wiggles

EVENTALIST
 EVENTALIST
EVENTALIST
profile
well the script will randomly chose a blood effect out of the character set that is being used for the blood. also the problem that you said you are getting must be because of the new version of XAS 3.8 i haven't seen nor heard of this new version yet so when i find the time i will look into fixing this problem and working on a more "random" selection. (i say random cause in ruby a random number is found with a math equation that tends to favor the lower numbers, so technically a true random number is unreachable in scripting. least what i know of it so far)
EVENTALIST
Show Signature
EVENTALIST
ACTIVATED
ACTIVATED
#21 Re: XAS - Blood Effects
Loading

Ragnai

ACTIVATED
ACTIVATED
ACTIVATED
profile
Thanks a lot, couldn't you just go through all the graphics?
If we have for example 16blood graphics (like I have now) a random pick isn't necessary anymore.

A true random choice is nearly impossible, they are currently working on particle scale to find a random event for quantic computers since random always depends on the surroundings aso.

Thanks a lot, I am looking forward to your new version and take your time.

Ragnai
ACTIVATED
Show Signature
ACTIVATED
EVENTALIST
EVENTALIST
#22 Re: XAS - Blood Effects
Loading

mr_wiggles

EVENTALIST
 EVENTALIST
EVENTALIST
profile
well i can edit the tile set so that all the sections of the character set insted of the top row thats an easy fix i can talk you through that if you'd like.
EVENTALIST
Show Signature
EVENTALIST
ACTIVATED
ACTIVATED
#23 Re: XAS - Blood Effects
Loading

Ragnai

ACTIVATED
ACTIVATED
ACTIVATED
profile
That'd be a nice fix, thanks in advance.
ACTIVATED
Show Signature
ACTIVATED
ACTIVATED
ACTIVATED
#24 Re: XAS - Blood Effects
Loading

Pozinhofan

ACTIVATED
ACTIVATED
ACTIVATED
profile
Hi man, this good script, can you make for the xas 3.91?
ACTIVATED
Show Signature
ACTIVATED
EVENTALIST
EVENTALIST
#25 Re: XAS - Blood Effects
Loading

mr_wiggles

EVENTALIST
 EVENTALIST
EVENTALIST
profile
Well i recently made edits to this script but have not found the time to upload the changes. i will soon.
EVENTALIST
Show Signature
EVENTALIST
Active Member
Active Member
#26 Re: XAS - Blood Effects
Loading

kimono

Active Member
Active Member
Active Member
profile
Hi Mr Wiggles,

I'm making a Claymore Starter Kit and I wonder if it's possible to update your XAS Blood effect and Mog VS HUd to XAS 3.91.

Here are some screens with the 3.82 version:




Great work anyway on the Blood effect, I really like it, perfect for this type of project.
Active Member
Show Signature
Active Member
Active Member
Active Member
#27 Re: XAS - Blood Effects
Loading

LiTTleDRAgo

Active Member
Active Member
Active Member
profile
Test edit

----removed----
Active Member
Show Signature
Active Member
http://littledrago.blogspot.com
Active Member
Active Member
#28 Re: XAS - Blood Effects
Loading

kimono

Active Member
Active Member
Active Member
profile
Thanks Littledrago, the script works but I've got no blood when the hero is hit.
Thanks for taking some of your time to adapt this script.
Active Member
Show Signature
Active Member
Active Member
Active Member
#29 Re: XAS - Blood Effects
Loading

LiTTleDRAgo

Active Member
Active Member
Active Member
profile
probably because of this

Code:
USE_BLOODY_SCREEN = false

I turned that off for my own use
Active Member
Show Signature
Active Member
http://littledrago.blogspot.com
Active Member
Active Member
#30 Re: XAS - Blood Effects
Loading

kimono

Active Member
Active Member
Active Member
profile
Great, everything is perfect with this script.
Could you please take a look at the Mog vs Hud? Thanks for your help.
Active Member
Show Signature
Active Member
Tutorial Wizardmaster
Tutorial Wizardmaster
#31 Re: XAS - Blood Effects
Loading

calvin624

Tutorial Wizardmaster
Tutorial Wizardmaster
Tutorial Wizardmaster
profile
Great script Wiggles. It'd be cool to have an option to use different styled sheets for different types of enemies, a metal debris sheet for machines/robots for example.

I like the blood hue feature, very cool.

One thing I noticed is the enemy's blood appears on top of the enemy, any way you can change that?

It'd be great if you could have a prevention list of tools that don't cause the blood effect, like electric shocks or lasers.

Just ideas if you're looking to update in the future.
Tutorial Wizardmaster
Show Signature
Tutorial Wizardmaster
http://xasabs.com
EVENTALIST
EVENTALIST
#32 Re: XAS - Blood Effects
Loading

mr_wiggles

EVENTALIST
 EVENTALIST
EVENTALIST
profile
i see what your talking about, i will see about revisiting this script in the near future and add you sugested updates and see about that bug your encountering.,

(posted from my phone)
EVENTALIST
Show Signature
EVENTALIST
Administrator
Administrator
#33 Re: XAS - Blood Effects
Loading

G@MeF@Ce

Administrator
Administrator
Administrator
profile
YO! here's my edit for XAS 3.91 ~ hey I noticed the new character sprite for the bloody hit = nice!

blood appears below the enemy

Spoiler:
Code:
#===============================================================================
# XAS - Blood Effects edit for XAS 3.91 on 4/28/11
#===============================================================================
# by Mr_Wiggles
# Version 1.6
# 6/27/10
#===============================================================================
module Blood
#-------------------------------------------------------------------------------
# Blood splatter effects
#-------------------------------------------------------------------------------
# Number of seconds blood is shown for
BLOOD_EARASE_TIME = 10
# Name of the character set for the blood effects
BLOOD_CHARACTER_SET = "Blood_10"
# Make the blood slightly see through? (0 - 255)
BLOOD_OPACITY = 180
# Monster blood colors. when A; return B ("A" monster ID, "B" hue [0 - 350] )
# Hue colors: 0 = red; 40 = yellow; 120 = green; 190 = sky blue;
# 220 = navy blue; 260 = purple; 310 = pink; 350 = red
  def blood_hues(id)
    case id
    when 2 # this is for the enemy id
      return 180 # this is the enemy id's hue
    when 5
      return 40
    else # this will return the default blood color
      return 0
    end
  end
end
#-------------------------------------------------------------------------------
# Blood screen effects
#-------------------------------------------------------------------------------
# Use screen blood effects
USE_BLOODY_SCREEN = true
# Number of seconds before blood fades off of screen
BLOOD_DURATION = 10
# Opacity of blood splatters on screen
BLOOD_SCREEN_OPACITY = 200
# Name of picture used for blood splaters
BLOOD_SHEET = "Blood_10"

#===============================================================================
# Game Character
#===============================================================================
class Game_Character
  include Blood
 
  alias blood_effect_character_update update
  def update
    blood_effect_character_update
    return if self.battler == nil
    if self.battler.is_a?(Game_Enemy)
      return if ENEMY_ELEMENT::ENEMY_OBJECT.include?(self.battler.id) or
        ENEMY_ELEMENT::ENEMY_ITEM.include?(self.battler.id)
    end
    @old_hp = self.battler.hp if @old_hp == nil
    if @old_hp != self.battler.hp
      make_blood_effect if (@old_hp - self.battler.hp > 0)
      @old_hp = self.battler.hp
    end
  end

  def make_blood_effect
    page = RPG::Event::Page.new
    page.move_type = 0; page.move_route = RPG::MoveRoute.new
    page.move_frequency = 1; page.always_on_top = false
    page.trigger = 0; page.through = true
    page.condition.variable_id = 1100
    page.condition.variable_value = (40 * BLOOD_EARASE_TIME) + BLOOD_OPACITY
    page.graphic.character_name = BLOOD_CHARACTER_SET
    page.graphic.character_hue = blood_hues(self.battler.id)
    page.direction_fix = true; page.graphic.pattern = rand(3)
    page.graphic.opacity = BLOOD_OPACITY
    event = RPG::Event.new(self.x, self.y); event.pages = [page]
    token = Token_Event.new($game_map.id, event); $game_map.add_token(token)
  end
end

#===============================================================================
# Game Event
#===============================================================================
class Game_Event < Game_Character
  alias blood_effects_event_update update
  def update
    blood_effects_event_update
    return if self.id < 999 or self.battler != nil
    for pg in @event.pages
      if pg.condition.variable_id == 1100
        pg.condition.variable_value -= 1 if pg.condition.variable_value > 0
        self.opacity -= 2 if self.opacity > 0 if pg.condition.variable_value < 255
        $game_map.remove_token(self) if pg.condition.variable_value == 0
      end
    end
  end
end

#===============================================================================
# Blood Screen
#===============================================================================
class Bloody_Window < Window_Base
  def initialize
    super(-20, -20, 700, 600)
    self.contents = Bitmap.new(width - 32, height - 32)
    self.opacity = 0
    self.z = 900
    @blood_graphics = []
    @blood_sheet = RPG::Cache.picture(BLOOD_SHEET)
    @wt = @blood_sheet.width / 4
    @ht = @blood_sheet.height / 4
    update
  end

  def refresh
    self.contents.clear
    for blood in @blood_graphics
      rect = Rect.new(@wt * blood[2][0], blood[2][1] * @ht, @wt, @ht)
      self.contents.blt(blood[0], blood[1], @blood_sheet, rect, blood[4])
    end
  end
 
  def make_random_blood
    loop do
      stop_loop = true
      x = (rand(50) * 10) + 20
      y = (rand(40) * 10) + 20
      n = [rand(2)+rand(2), rand(2)+rand(2)]
      for blood in @blood_graphics
        stop_loop = false if blood[2] == n
      end
      if stop_loop
        @blood_graphics.push([x, y, n, BLOOD_DURATION * 40, BLOOD_SCREEN_OPACITY])
        break
      end
    end
  end

  def update
    @actor = $game_party.actors[0]
    @old_player_hp = @actor.hp if @old_player_hp == nil
    if @old_player_hp != @actor.hp
      make_random_blood if (@old_player_hp - @actor.hp > 0)
      @old_player_hp = @actor.hp
    end
    return if @blood_graphics.size == 0
    for blood in @blood_graphics
      update_blood(blood)
    end
    refresh
  end

  def update_blood(blood)
    if blood[4] == 0
      @blood_graphics.delete(blood)
      return
    end
    blood[3] -= 5 if blood[3] > 0
    blood[4] -= 5 if blood[4] > 0 and blood[3] <= BLOOD_SCREEN_OPACITY
  end
end

#==============================================================================
# Scene Map
#==============================================================================
class Scene_Map
  alias blood_window_main main
  def main
    if USE_BLOODY_SCREEN
      @blood_window = Bloody_Window.new
      @blood_update_pause = 5
    end
    blood_window_main
    @blood_window.dispose if USE_BLOODY_SCREEN
  end

  alias blood_window_update update
  def update
    blood_window_update
    return if @blood_update_pause == nil
    @blood_update_pause -= 1 if @blood_update_pause > 0
    if @blood_update_pause == 0
      @blood_window.update
      @blood_update_pause = 5
    end
  end
end
Administrator
https://www.dropbox.com/sh/i47rig99qhrvn8s/4m5HvsM2fD http://g4m3f4c3.deviantart.com https://www.facebook.com//pages/Gameface101/332331300127008 https://twitter.com//mr_gameface101 https://soundcloud.com/schurr http://www.youtube.com/user/MrGameface101?feature=watch
EVENTALIST
EVENTALIST
#34 Re: XAS - Blood Effects
Loading

mr_wiggles

EVENTALIST
 EVENTALIST
EVENTALIST
profile
Updated script with new features, and should fix the problem with the XAS version.
EVENTALIST
Show Signature
EVENTALIST
Tutorial Wizardmaster
Tutorial Wizardmaster
#35 Re: XAS - Blood Effects
Loading

calvin624

Tutorial Wizardmaster
Tutorial Wizardmaster
Tutorial Wizardmaster
profile
Fantastic to see that you're maintaining your scripts - I'm going to update XAS Tuts soon so that the download pages for v3.82 and v3.91 have a catalogue of all the scripts that are compatible for that particular version.

People love your scripts man, not a week goes by without me recommending people visit this site in order to see them!
Tutorial Wizardmaster
Show Signature
Tutorial Wizardmaster
http://xasabs.com
Active Member
Active Member
#36 Re: XAS - Blood Effects
Loading

kimono

Active Member
Active Member
Active Member
profile
This script will be in the end a masterpiece for those who don't affraid of blood all on the way.
Maybye we can try to change the sprite color tone according to his hue and health.
Here's a screen that illustrates the idea:

And a demonstration if you want to see the troops in action:
megaupload.com 1EXFNLQ6
Active Member
Show Signature
Active Member
ACTIVATED
ACTIVATED
#37 Re: XAS - Blood Effects
Loading

godobladla

ACTIVATED
ACTIVATED
ACTIVATED
profile
Hi! I have an error:
line101 NoMethodError occured.

undefined error for 'hp' for nil:NilClass.


Please help! Sad

I have XAS Hero Edition 3.82
And I use it with Particle effects addon
ACTIVATED
Show Signature
ACTIVATED
EVENTALIST
EVENTALIST
#38 Re: XAS - Blood Effects
Loading

mr_wiggles

EVENTALIST
 EVENTALIST
EVENTALIST
profile
Paste this line of code directly above the line that looks like this.

Code:

def be_make_effect(user, skill = nil)
  return if self.battler.nil? #<<< Add this line here.
  @be_old_hp = self.battler.hp if @be_old_hp.nil?

should fix your problem.
EVENTALIST
Show Signature
EVENTALIST
ACTIVATED
ACTIVATED
#39 Re: XAS - Blood Effects
Loading

godobladla

ACTIVATED
ACTIVATED
ACTIVATED
profile
Thanks. But now it says as error:
Script is hanging.

Now what?
ACTIVATED
Show Signature
ACTIVATED
Administrator
Administrator
#40 Re: XAS - Blood Effects
Loading

G@MeF@Ce

Administrator
Administrator
Administrator
profile
@godobladla - The script is probably hanging because the 'be_make_effect' method is being defined twice if you pasted that chunk of code above the same line.

you should only see one of

Code:
def be_make_effect(user, skill = nil)

and directly under it the fix for that NoMethodError.
(undefined error for 'hp' for nil:NilClass)


Code:

  return if self.battler.nil? #<<< Add this line here.
  @be_old_hp = self.battler.hp if @be_old_hp.nil?
Administrator
https://www.dropbox.com/sh/i47rig99qhrvn8s/4m5HvsM2fD http://g4m3f4c3.deviantart.com https://www.facebook.com//pages/Gameface101/332331300127008 https://twitter.com//mr_gameface101 https://soundcloud.com/schurr http://www.youtube.com/user/MrGameface101?feature=watch
ACTIVATED
ACTIVATED
#41 Re: XAS - Blood Effects
Loading

godobladla

ACTIVATED
ACTIVATED
ACTIVATED
profile
I pasted only the script in the line: #<<< Add this line here.

Now i think i know it, my comp is slow... the Danger Rat does this only...
ACTIVATED
Show Signature
ACTIVATED
Active Member
Active Member
#42 Re: XAS - Blood Effects
Loading

unrivaledneo

Active Member
Active Member
Active Member
profile
Usuing this with the newest version of XAS getting a

uninitialized constant XAS_BA_ENEMY::ENEMY_OBJECT
on line 70
Active Member
Show Signature
Active Member
EVENTALIST
EVENTALIST
#43 Re: XAS - Blood Effects
Loading

mr_wiggles

EVENTALIST
 EVENTALIST
EVENTALIST
profile
Sorry kinda been busy with stuff. Also been thinking about dropping my support on XAS. Nothing personal its just that im working on my own ABS.

How important is this to you? in Time wise? urgent?
EVENTALIST
Show Signature
EVENTALIST
Active Member
Active Member
#44 Re: XAS - Blood Effects
Loading

unrivaledneo

Active Member
Active Member
Active Member
profile
if your making your own abs get to it. Im sure i can find someone to update this, who knows maybe ill throw away xas for yours. :p
Active Member
Show Signature
Active Member
EVENTALIST
EVENTALIST
#45 Re: XAS - Blood Effects
Loading

mr_wiggles

EVENTALIST
 EVENTALIST
EVENTALIST
profile
lol thanks. :p keep an eye out for the forum project, Grave Walker.
EVENTALIST
Show Signature
EVENTALIST
Active Member
Active Member
#46 Re: XAS - Blood Effects
Loading

unrivaledneo

Active Member
Active Member
Active Member
profile
will do thanks
Active Member
Show Signature
Active Member
Administrator
Administrator
#47 Re: XAS - Blood Effects
Loading

G@MeF@Ce

Administrator
Administrator
Administrator
profile
! - link has been moved to the public forum Cool

@Blue - you may need to update mr_wiggles' script catalog...

@wiggles - had to share this killer script with the world,
I also added a link on the home page.

~ hope you don't mind ^,^


Administrator
https://www.dropbox.com/sh/i47rig99qhrvn8s/4m5HvsM2fD http://g4m3f4c3.deviantart.com https://www.facebook.com//pages/Gameface101/332331300127008 https://twitter.com//mr_gameface101 https://soundcloud.com/schurr http://www.youtube.com/user/MrGameface101?feature=watch
EVENTALIST
EVENTALIST
#48 Re: XAS - Blood Effects
Loading

mr_wiggles

EVENTALIST
 EVENTALIST
EVENTALIST
profile
nah, i was actually trying to make it more compatible, so you can use it with other ABS systems. just have to find time. :/
EVENTALIST
Show Signature
EVENTALIST
Active Member
Active Member
#49 Re: XAS - Blood Effects
Loading

unrivaledneo

Active Member
Active Member
Active Member
profile
Havnt been able to really find anyone to update this to the newest xas, if anyone here is interested in doing so would be great Very Happy
Active Member
Show Signature
Active Member
ACTIVATED
ACTIVATED
#50 Re: XAS - Blood Effects
Loading

Mireneye

ACTIVATED
ACTIVATED
ACTIVATED
profile
Damn I'm sorry I was tired and did not read the last part of your post. For personal reasons I worked tonight on converting this script to VXACE. Got to a point where it loaded and I could see the screen effects, very cool!

But I ended up going to another forum asking for help with the conversion and hence did post it. Sorry! I'll delete it if I have to, but I hope you can have some oversight? excitement got the better of me.

In any case, great script! I can already tell i'm going to love it if and once I get it all working.

May I ask... what does this section do??
" if self.battler.is_a?(Game_Enemy) and
(XAS_BA_ENEMY::ENEMY_OBJECT.include?(self.id) or
XAS_BA_ENEMY::ITEM_ENEMY.include?(self.id))
make_be = false
end"

To my knowledge I only have that and something about 'hp' as a method it can't reach.

Have a great day.
Cheers!
ACTIVATED
Show Signature
ACTIVATED
#51 Re: XAS - Blood Effects
Loading

Sponsored content

profile

View previous topic View next topic Back to top Message [Page 1 of 2]

Go to page : 1, 2  Next

 

Chatbox system disabled
Personal messaging disabled