Chaos Project

RPG Maker => RPG Maker Scripts => RMXP Script Database => Topic started by: Blizzard on December 24, 2008, 06:41:01 pm

Title: [XP] Critical Sound for Blizz-ABS
Post by: Blizzard on December 24, 2008, 06:41:01 pm
Critical Sound for Blizz-ABS
Authors: Blizzard
Version: 1.0
Type: Blizz-ABS Plugin
Key Term: Blizz-ABS Plugin



Introduction

This script will play a sound effect each time a critical hit is dealt.

This script is to be distributed under the same terms and conditions like the script it was created for: Blizz-ABS.


Features




Screenshots

N/A


Demo

N/A


Script

Just make a new script above main and paste this code into it.
Spoiler: ShowHide
#:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=
# Critical for Blizz-ABS by Blizzard
# Version: 1.0
# Type: Blizz-ABS Add-on
# Date: 25.12.2008
#:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=
#
#  This script is to be distributed under the same terms and conditions like
#  the script it was created for: Blizz-ABS.
#
#:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=
#
# Information:
#
#   This script must be placed below Blizz-ABS and require Blizz-ABS v2.2 or
#   higher to work properly. It will play a sound effect each time a critical
#   hit is dealt.
#
#
# If you find any bugs, please report them here:
# http://forum.chaos-project.com
#:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=

if !$BlizzABS || BlizzABS::VERSION < 2.2
  raise 'ERROR: The "Critical Sound" plugin requires Blizz-ABS 2.2 or higher.'
end

#::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::
# START Configuration
#::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::

# ('FILENAME', VOLUME, PITCH)
CRITICAL_SOUND_FILE = RPG::AudioFile.new('060-Cheer01', 80, 100)

#::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::
# END Configuration
#::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::

#==============================================================================
# BlizzABS::DamageRequest
#------------------------------------------------------------------------------
#  This class was modified to play a sound effect when creating a damage
#  request.
#==============================================================================
 
class BlizzABS::DamageRequest
 
  #----------------------------------------------------------------------------
  # override Initialization
  #----------------------------------------------------------------------------
  alias init_criticalsound_blizzabs_later initialize
  def initialize(char, damage, color, critical = false)
    init_criticalsound_blizzabs_later(char, damage, color, critical)
    $game_system.se_play(CRITICAL_SOUND_FILE) if critical
  end
 
end



Instructions

None required.


Compatibility

Requires Blizz-ABS to work.


Credits and Thanks




Author's Notes

Keep in mind that this plugin comes UNDER Blizz-ABS. This script was done on request and is not fully supported by me as my other scripts are.

If you find any bugs, please report them here:
http://forum.chaos-project.com

That's it! N-Joy! =D
Title: Re: [XP] Critical Sound for Blizz-ABS
Post by: Jragyn on February 26, 2010, 09:00:50 pm
You know, I think people underestimate the quality of this script!

Its pretty great, Blizzard!
It IS the little things that count, like SFX for crits :D
Title: Re: [XP] Critical Sound for Blizz-ABS
Post by: Blizzard on February 28, 2010, 06:10:22 am
I agree. The small things and details show that the developer put effort into the game.
Title: Re: [XP] Critical Sound for Blizz-ABS
Post by: elmangakac on May 15, 2010, 09:44:00 am
well i put this idea/request in the suggestions for Blizzabs..... but it seems thats not good idea.... and im going to put it here...

here i go:

Maybe its possible do a little shake screen effect when the critical sound appear in game.... it maybe gives another good small detail....  :haha:

its only a idea ^_^
Title: Re: [XP] Critical Sound for Blizz-ABS
Post by: Jragyn on May 16, 2010, 01:07:23 am
Oi, its not too hard, so how about I do it for ya?

There are new CONSTANTS in the script that you are welcome to edit at your leisure to get the effect you seek.
#:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=
# Critical for Blizz-ABS by Blizzard
# Version: 1.0
# Type: Blizz-ABS Add-on
# Date: 25.12.2008
#:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=
#
#  This script is to be distributed under the same terms and conditions like
#  the script it was created for: Blizz-ABS.
#
#:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=
#
# Information:
#
#   This script must be placed below Blizz-ABS and require Blizz-ABS v2.2 or
#   higher to work properly. It will play a sound effect each time a critical
#   hit is dealt.
#
#
# If you find any bugs, please report them here:
# http://forum.chaos-project.com
#:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=

if !$BlizzABS || BlizzABS::VERSION < 2.2
  raise 'ERROR: The "Critical Sound" plugin requires Blizz-ABS 2.2 or higher.'
end

#::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::
# START Configuration
#::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::

# ('FILENAME', VOLUME, PITCH)
CRITICAL_SOUND_FILE = RPG::AudioFile.new('060-Cheer01', 80, 100)

# These are the new constants for Shaking.
# Just set the shake to false if you don't want to use it.

SHAKE = false
S_FORCE = 5   # Higher force = bigger shake (1~9)
S_SPEED = 5   # Higher speed = faster shake
S_DUR = 5     # count in frames the shake lasts
#::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::
# END Configuration
#::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::

#==============================================================================
# BlizzABS::DamageRequest
#------------------------------------------------------------------------------
#  This class was modified to play a sound effect when creating a damage
#  request.
#==============================================================================
 
class BlizzABS::DamageRequest
  #----------------------------------------------------------------------------
  # override Initialization
  #----------------------------------------------------------------------------
  alias init_criticalsound_blizzabs_later initialize
  def initialize(char, damage, color, critical = false)
    init_criticalsound_blizzabs_later(char, damage, color, critical)
    $game_system.se_play(CRITICAL_SOUND_FILE) if critical
    $game_screen.start_shake(S_FORCE,S_SPEED,S_DUR) if critical && SHAKE
  end
 
end


Is this whatchu were lookin' for?
Title: Re: [XP] Critical Sound for Blizz-ABS
Post by: elmangakac on May 16, 2010, 09:41:14 am
Quote from: jragyn00 on May 16, 2010, 01:07:23 am
Oi, its not too hard, so how about I do it for ya?

There are new CONSTANTS in the script that you are welcome to edit at your leisure to get the effect you seek.
#:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=
# Critical for Blizz-ABS by Blizzard
# Version: 1.0
# Type: Blizz-ABS Add-on
# Date: 25.12.2008
#:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=
#
#  This script is to be distributed under the same terms and conditions like
#  the script it was created for: Blizz-ABS.
#
#:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=
#
# Information:
#
#   This script must be placed below Blizz-ABS and require Blizz-ABS v2.2 or
#   higher to work properly. It will play a sound effect each time a critical
#   hit is dealt.
#
#
# If you find any bugs, please report them here:
# http://forum.chaos-project.com
#:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=

if !$BlizzABS || BlizzABS::VERSION < 2.2
  raise 'ERROR: The "Critical Sound" plugin requires Blizz-ABS 2.2 or higher.'
end

#::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::
# START Configuration
#::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::

# ('FILENAME', VOLUME, PITCH)
CRITICAL_SOUND_FILE = RPG::AudioFile.new('060-Cheer01', 80, 100)

# These are the new constants for Shaking.
# Just set the shake to false if you don't want to use it.

SHAKE = false
S_FORCE = 5   # Higher force = bigger shake (1~9)
S_SPEED = 5   # Higher speed = faster shake
S_DUR = 5     # count in frames the shake lasts
#::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::
# END Configuration
#::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::

#==============================================================================
# BlizzABS::DamageRequest
#------------------------------------------------------------------------------
#  This class was modified to play a sound effect when creating a damage
#  request.
#==============================================================================
 
class BlizzABS::DamageRequest
  #----------------------------------------------------------------------------
  # override Initialization
  #----------------------------------------------------------------------------
  alias init_criticalsound_blizzabs_later initialize
  def initialize(char, damage, color, critical = false)
    init_criticalsound_blizzabs_later(char, damage, color, critical)
    $game_system.se_play(CRITICAL_SOUND_FILE) if critical
    $game_screen.start_shake(S_FORCE,S_SPEED,S_DUR) if critical && SHAKE
  end
 
end


Is this whatchu were lookin' for?


:D oh my godness.....just that???....so simply???... this work its awesome!!!.... My project have many martial arts attacks, and this its going to give more realistic effects.... thank you very much.....

Maybe some boss have to put this like a new version of this add on in the topic!!!^_^

Title: Re: [XP] Critical Sound for Blizz-ABS
Post by: Blizzard on May 16, 2010, 09:46:38 am
It's called "Critical Sound" and not "Critical Animation" or "Critical Visual Effects".
Title: Re: [XP] Critical Sound for Blizz-ABS
Post by: elmangakac on May 16, 2010, 09:55:45 am
Quote from: Blizzard on May 16, 2010, 09:46:38 am
It's called "Critical Sound" and not "Critical Animation" or "Critical Visual Effects".

:^_^': damn!! Somebody is a little upset o_o.... Sorry!.... but i only want to cooperate a little ^_^
Title: Re: [XP] Critical Sound for Blizz-ABS
Post by: winkio on May 16, 2010, 09:58:07 am
His point is that this should have gone in script requests instead of the script thread.
Title: Re: [XP] Critical Sound for Blizz-ABS
Post by: Blizzard on May 16, 2010, 10:00:03 am
I don't mind if you wanna use it, I'm just saying that I won't change the purpose of the original script. There are infinite ways and features you can add to a critical hit. This was one of them, I made it on request after all.
Title: Re: [XP] Critical Sound for Blizz-ABS
Post by: elmangakac on May 16, 2010, 10:07:50 am
 :^_^': Understand!
Title: Re: [XP] Critical Sound for Blizz-ABS
Post by: megaman30796 on December 27, 2010, 08:47:43 pm
i use it and i says line 53 stack error too deep.....what does that mean?
Title: Re: [XP] Critical Sound for Blizz-ABS
Post by: ForeverZer0 on December 27, 2010, 08:58:11 pm
You either have a an alias name defined twice, or a method is calling itself, either in the method or in a loop of methods.

ex.


def method1
  # Some code here...
  method2 # Calls method2
end

def method2
  # Some code here...
  method1 # Calls method1
end


See how it is trapped in a loop?
Ruby is not a recursive language.