[XP] Critical Sound for Blizz-ABS

Started by Blizzard, December 24, 2008, 06:41:01 pm

Previous topic - Next topic

Blizzard

December 24, 2008, 06:41:01 pm Last Edit: March 23, 2019, 11:38:08 am by Blizzard
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


  • special sound effect during critical damage
  • easy to configure



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


  • Boris "Blizzard" Mikić
  • Thanks to MeVII for requesting this.



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
Check out Daygames and our games:

King of Booze 2      King of Booze: Never Ever
Drinking Game for Android      Never have I ever for Android
Drinking Game for iOS      Never have I ever for iOS


Quote from: winkioI do not speak to bricks, either as individuals or in wall form.

Quote from: Barney StinsonWhen I get sad, I stop being sad and be awesome instead. True story.

Jragyn

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
A bright light can either illuminate or blind, but how will you know which until you open your eyes?

Blizzard

I agree. The small things and details show that the developer put effort into the game.
Check out Daygames and our games:

King of Booze 2      King of Booze: Never Ever
Drinking Game for Android      Never have I ever for Android
Drinking Game for iOS      Never have I ever for iOS


Quote from: winkioI do not speak to bricks, either as individuals or in wall form.

Quote from: Barney StinsonWhen I get sad, I stop being sad and be awesome instead. True story.

elmangakac

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 ^_^

Jragyn

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?
A bright light can either illuminate or blind, but how will you know which until you open your eyes?

elmangakac

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!!!^_^


Blizzard

It's called "Critical Sound" and not "Critical Animation" or "Critical Visual Effects".
Check out Daygames and our games:

King of Booze 2      King of Booze: Never Ever
Drinking Game for Android      Never have I ever for Android
Drinking Game for iOS      Never have I ever for iOS


Quote from: winkioI do not speak to bricks, either as individuals or in wall form.

Quote from: Barney StinsonWhen I get sad, I stop being sad and be awesome instead. True story.

elmangakac

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 ^_^

winkio

His point is that this should have gone in script requests instead of the script thread.

Blizzard

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.
Check out Daygames and our games:

King of Booze 2      King of Booze: Never Ever
Drinking Game for Android      Never have I ever for Android
Drinking Game for iOS      Never have I ever for iOS


Quote from: winkioI do not speak to bricks, either as individuals or in wall form.

Quote from: Barney StinsonWhen I get sad, I stop being sad and be awesome instead. True story.

elmangakac


megaman30796

i use it and i says line 53 stack error too deep.....what does that mean?
"You know the world is going crazy," Chris Rock declared in 2003, "when the best rapper [Eminem] is a white guy, the best golfer [Tiger Woods] is a black guy, the tallest guy in the NBA [Yao Ming] is Chinese, the Swiss hold the America's Cup, France is accusing the U.S. of arrogance, Germany doesn't want to go to war, and the three most powerful men in America are named 'Bush,' 'Dick,' and 'Colon.' Need I say more?"

ForeverZer0

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.
I am done scripting for RMXP. I will likely not offer support for even my own scripts anymore, but feel free to ask on the forum, there are plenty of other talented scripters that can help you.