Status
Not open for further replies.

Nérylis

Veteran
Veteran
Joined
Feb 14, 2015
Messages
202
Reaction score
3
First Language
French
Primarily Uses
Hi all,

I search the last version of the script called Custom Collapse Effects from ShadowMaster. I don't success to find it.
 

Nérylis

Veteran
Veteran
Joined
Feb 14, 2015
Messages
202
Reaction score
3
First Language
French
Primarily Uses
The link doesn't work.
 

Nirwanda

Procrastimancer
Veteran
Joined
Nov 2, 2012
Messages
1,291
Reaction score
610
First Language
Spanish
Primarily Uses
RMMV
I just checked it and it works fine for me. Did you try to copy it to your adress bar or something? You just have to click on it. Otherwise I don't know what to tell you, except to use the search function of rpgmakervxace.net's forums.
 
Last edited by a moderator:

Shaz

Global Moderators
Global Mod
Joined
Mar 2, 2012
Messages
42,187
Reaction score
14,661
First Language
English
Primarily Uses
RMMV
I've moved this thread to RGSS3 Script Requests. Please be sure to post your threads in the correct forum next time. Thank you.
 

Nérylis

Veteran
Veteran
Joined
Feb 14, 2015
Messages
202
Reaction score
3
First Language
French
Primarily Uses
Ok.

I confirm, the link for the site crimson-castle doesn't display and I can't see the script. Can you send me please ?
 

Nirwanda

Procrastimancer
Veteran
Joined
Nov 2, 2012
Messages
1,291
Reaction score
610
First Language
Spanish
Primarily Uses
RMMV
It works fine for me, anyway, here's the code:

Code:
=begin===============================================================================Custom Collapse Effects V1.6 (01/8/2015)-------------------------------------------------------------------------------Created By: Shadowmaster/Shadowmaster9000/Shadowpasta(www.crimson-castle.co.uk)===============================================================================Information-------------------------------------------------------------------------------This script allows you to customise collapse effects for both enemies and evenactors (collapse effects for actors will only work if using an actor battlersprite script like Yami's Battle Engine Symphony). Collapse effect customisationis done through notetagging and you can find the notetags below.===============================================================================How to Use-------------------------------------------------------------------------------Place this script under Materials. It's also best to put this script underany other scripts that overwrite the perform_collapse_effect methods in eitherthe Game_Actor or Game_Enemy classes.===============================================================================Note Tags-------------------------------------------------------------------------------Place any of these note tags within an actor or enemy in the database.--------------------Actor/Enemy Notetags--------------------<custom collapse: n>Sets up the duration of the custom collapse, where n is the number of framesyou want the custom collapse to last (60 frames per second).<collapse shake x: n>Shakes the battler horizontally, where n is at what frame the shake will start.The effect will last until the end of the duration of the collapse effect.<collapse shake y: n>Shakes the battler vertically, where n is at what frame the shake will start.The effect will last until the end of the duration of the collapse effect.<collapse fade: n>The battler starts fading to nothing, where n is at what frame the fading willstart. The effect will last until the end of the duration of the collapse effect.<collapse fade color: n1 n2 n3>Sets the fade color for the battler when using the collapse fade effect. Thisuses the RGB system, with the numbers ranging between 0-255. Red is n1, Greenis n2 and Blue is n3.<collapse sink: n1 n2>The battler begins moving downwards, where n1 is at what frame the battlerwill start sinking, and n2 is the speed that the battler will sink (you caneven use decimal values for n2). You do not have to use n2. At default, theeffect will last until the end of the duration of the collapse effect whilenot using n2.<collapse wave: n>The battler's image begins to distort in a wavey like pattern, where n is atwhat frame the wave effect will begin. The effect will last until the end ofthe duration of the collapse effect.<collapse sound: "string" n1 n2 n3>A sound effect will start constantly playing, where "string" is the name of thefile in the Audio/SE folder, and n1 is at what frame the sound effects will startplaying. Variables n2 and n3 change the volume and pitch respectively. Variablesn2 and n3 do not need to be used. When they are not used, the value 100 is usedat default. The effect will last until the end of the duration of the collapseeffect.<fade sound>Makes the sound set from the collapse sound effect fade out relative to theduration of the collapse effect. This will not effect sound effects playedfrom animations used with the collapse animation notetag.<collapse animation: n>A battle animation will play at the beginning of the battler's collapse, wheren is the id of the battle animation you want to use. The battle animationwill run along the rest of the custom collapse effects you have set up forthe battler.<no wait for collapse animation>By default the battle system will wait for a battle animation to finish beforeproceeding with the battle, even if the custom collapse itself ended longbefore. Using this notetag will allow the battle to continue when a battleanimation from a battler's custom collapse effect is still going on.===============================================================================Example-------------------------------------------------------------------------------To help give you a better understanding of how to manipulate these effectsto achieve various results, below is an example of a custom collapse effect.<custom collapse: 230>The collapse will last for 230 frames.<collapse shake x: 80>The battler will begin to shake once 80 frames have gone past.<collapse sound: "Collapse4" 80>The Collapse4 sound effect will start playing continuously once 80 frameshave gone past.<collapse fade: 110><collapse fade color: 255 0 0>The battler will begin to fade in a red color once 110 frames have gone past.<collapse sink: 110><collapse wave: 110>The battler will begin to sink with a wavey distortion once 110 frames havegone past.<collapse animation: 111>Animation no.111 (which I like to call the Thunder Death animation) willstart playing.This is what I have set up for the Thunder Death animation:#007 Thunder10 Screen (255,255,255,200), @5#020 Thunder10 Screen (255,255,255,200), @5The Thunder10 sound effect will be played at frames 7 and 20 (word of warning,battle animation frames are 15 frames per second and not 60 so the timing willbe different), along with the screen flashing white, with the flash lasting for5 frames.I highly recommend using battle animations for your custom collapse animationsas it allows for a far larger variety of effects that would otherwise not beachievable without them.===============================================================================Required-------------------------------------------------------------------------------Nothing.===============================================================================Compatibility Issues-------------------------------------------------------------------------------Below are a list of scripts that this script is currently incompatible with.A future update may fix these issues but I can't guarantee anything.Yanfly Visual Battlers----------------------They've been set up differently to how enemy sprites are loaded up and theyhaven't been set up to load collapse effects when an actor dies. This scriptwill still work with enemies while using Visual Battlers, but it won't workwith actors.===============================================================================Change log-------------------------------------------------------------------------------v1.6: Added the option to fade out sounds using a new notetag. (01/8/2015)v1.5: Fixed a bug that didn't rest various graphical effects when an actoror enemy with a custom collapse animation is revived. (25/5/2015)v1.4: Updated the sound notetag to allow control of the sound's volume andpitch. (12/10/2013)v1.3: Fixed the sinking function so the effect will now last for the durationof the collapse effect. You can now also set a speed for the battler to sink.(27/8/2013)v1.2: Fixed a bug where the battle would continue before finishing a collapseanimation containing a battle animation that extended to longer than thecollapse animation's duration. Also allowing users to skip this bug fix witha notetag. (25/10/2013)v1.1: Fixed a bug where using a battle animation as a custom collapse effectwould delay the battle log until the battle animation finished. Unfortunatelythe battle animations can no longer be used in conjunction with the defaultcollapse animations. (23/10/2013)v1.0: First release. (23/10/2013)===============================================================================Terms of Use-------------------------------------------------------------------------------* Free to use for both commercial and non-commerical projects.* Credit me if used.* Do not claim this as your own.* You're free to post this on other websites, but please credit me and keepthe header intact.* If you want to release any modifications/add-ons for this script, theadd-on script must use the same Terms of Use as this script uses. (But youcan also require any users of your add-on script to credit you in their gameif they use your add-on script.)* If you're making any compatibility patches or scripts to help this scriptwork with other scripts, the Terms of Use for the compatibility patch doesnot matter so long as the compatibility patch still requires this script torun.* If you want to use your own seperate Terms of Use for your version oradd-ons of this script, you must contact me at [URL="http://www.rpgmakervxace.netor"]http://www.rpgmakervxace.netor[/URL] www.crimson-castle.co.uk================================================================================end$imported = {} if $imported.nil?$imported["Shadowmaster_Custom_Collapses"] = true#==============================================================================# ** DataManager#------------------------------------------------------------------------------# This module manages the database and game objects. Almost all of the# global variables used by the game are initialized by this module.#==============================================================================module DataManager#--------------------------------------------------------------------------# * Load Database#--------------------------------------------------------------------------class <<self; alias load_database_custom_collapse load_database; enddef self.load_databaseload_database_custom_collapseload_notetags_custom_collapseend#--------------------------------------------------------------------------# * Load Notetags for Custom Collapse#--------------------------------------------------------------------------def self.load_notetags_custom_collapsegroups = [$data_actors, $data_enemies]for group in groupsfor obj in groupnext if obj.nil?obj.load_notetags_custom_collapseendendendendclass RPG::BaseItem#--------------------------------------------------------------------------# Public Instance Variables#--------------------------------------------------------------------------attr_accessor :custom_collapseattr_accessor :collapse_durationattr_accessor :collapse_shakeattr_accessor :shake_x_startattr_accessor :shake_y_startattr_accessor :collapse_fadeattr_accessor :fade_startattr_accessor :fade_colorsattr_accessor :fade_redattr_accessor :fade_greenattr_accessor :fade_blueattr_accessor :wave_startattr_accessor :sink_startattr_accessor :sink_speedattr_accessor :collapse_soundattr_accessor :sound_startattr_accessor :sound_volumeattr_accessor :sound_pitchattr_accessor :sound_fadeattr_accessor :collapse_animationattr_accessor :no_wait_for_animation#--------------------------------------------------------------------------# Defining Attributes#--------------------------------------------------------------------------def load_notetags_custom_collapse@custom_collapse = false@collapse_duration = 0@shake_x_start = nil@shake_y_start = nil@fade_start = nil@fade_colors = false@wave_start = nil@sink_start = nil@sink_speed = nil@collapse_sound = nil@sound_start = nil@sound_volume = 100@sound_pitch = 100@sound_fade = false@collapse_animation = nil@no_wait_for_animation = nilif @note =~ /<custom collapse: (.*)>/i@custom_collapse = true@collapse_duration = $1.to_iendif @note =~ /<collapse shake x: (.*)>/i@shake_x_start = $1.to_iendif @note =~ /<collapse shake y: (.*)>/i@shake_y_start = $1.to_iendif @note =~ /<collapse fade: (.*)>/i@fade_start = $1.to_iendif @note =~ /<collapse fade color: (.*) (.*) (.*)>/i@fade_colors = true@fade_red = $1.to_i@fade_green = $2.to_i@fade_blue = $3.to_iendif @note =~ /<collapse wave: (.*)>/i@wave_start = $1.to_iendif @note =~ /<collapse sink: (.*) (.*)>/i@sink_start = $1.to_i@sink_speed = $2.to_fendif @note =~ /<collapse sound: "(.+?)\" (.*)>/i@collapse_sound = $1.to_s@sound_start = $2.to_iendif @note =~ /<collapse sound: "(.+?)\" (.*) (.*)>/i@collapse_sound = $1.to_s@sound_start = $2.to_i@sound_volume = $3.to_iendif @note =~ /<collapse sound: "(.+?)\" (.*) (.*) (.*)>/i@collapse_sound = $1.to_s@sound_start = $2.to_i@sound_volume = $3.to_i@sound_pitch = $4.to_iendif @note =~ /<fade sound>/i@sound_fade = trueendif @note =~ /<collapse animation: (.*)>/i@collapse_animation = $1.to_iendif @note =~ /<no wait for collapse animation>/i@no_wait_for_animation = trueendendend#==============================================================================# ** Game_Actor#------------------------------------------------------------------------------# This class handles actors. It is used within the Game_Actors class# ($game_actors) and is also referenced from the Game_Party class ($game_party).#==============================================================================class Game_Actor < Game_Battler#--------------------------------------------------------------------------# * Public Instance Variables#--------------------------------------------------------------------------attr_reader :collapse_durationattr_reader :shake_x_startattr_reader :shake_y_startattr_reader :fade_startattr_reader :fade_colorsattr_reader :fade_redattr_reader :fade_greenattr_reader :fade_blueattr_reader :wave_startattr_reader :sink_startattr_reader :sink_speedattr_reader :collapse_soundattr_reader :sound_startattr_reader :kovolumeattr_reader :kopitchattr_reader :sound_fadeattr_reader :collapse_animationattr_reader :no_wait_for_animation#--------------------------------------------------------------------------# * Object Initialization#--------------------------------------------------------------------------alias shadowmaster_setup_collapse setupdef setup(actor_id)shadowmaster_setup_collapse(actor_id)@collapse_duration = actor.collapse_duration@shake_x_start = actor.shake_x_start@shake_y_start = actor.shake_y_start@fade_start = actor.fade_start@fade_colors = actor.fade_colors@fade_red = actor.fade_red@fade_green = actor.fade_green@fade_blue = actor.fade_blue@wave_start = actor.wave_start@sink_start = actor.sink_start@sink_speed = actor.sink_speed@collapse_sound = actor.collapse_sound@sound_start = actor.sound_start@kovolume = actor.sound_volume@kopitch = actor.sound_pitch@sound_fade = actor.sound_fade@collapse_animation = actor.collapse_animation@no_wait_for_animation = actor.no_wait_for_animationend#--------------------------------------------------------------------------# * Execute Collapse Effect#--------------------------------------------------------------------------alias shadowmaster_perform_collapse_effect perform_collapse_effectdef perform_collapse_effectif actor.custom_collapse == true@sprite_effect_type = :shadowmaster_custom_collapseelseshadowmaster_perform_collapse_effectendendend#==============================================================================# ** Game_Enemy#------------------------------------------------------------------------------# This class handles enemies. It used within the Game_Troop class# ($game_troop).#==============================================================================class Game_Enemy < Game_Battler#--------------------------------------------------------------------------# * Public Instance Variables#--------------------------------------------------------------------------attr_reader :collapse_durationattr_reader :shake_x_startattr_reader :shake_y_startattr_reader :fade_startattr_reader :fade_colorsattr_reader :fade_redattr_reader :fade_greenattr_reader :fade_blueattr_reader :wave_startattr_reader :sink_startattr_reader :sink_speedattr_reader :collapse_soundattr_reader :sound_startattr_reader :kovolumeattr_reader :kopitchattr_reader :sound_fadeattr_reader :collapse_animationattr_reader :no_wait_for_animation#--------------------------------------------------------------------------# * Object Initialization#--------------------------------------------------------------------------alias shadowmaster_initialize_collapse initializedef initialize(index, enemy_id)shadowmaster_initialize_collapse(index, enemy_id)@collapse_duration = enemy.collapse_duration@shake_x_start = enemy.shake_x_start@shake_y_start = enemy.shake_y_start@fade_start = enemy.fade_start@fade_colors = enemy.fade_colors@fade_red = enemy.fade_red@fade_green = enemy.fade_green@fade_blue = enemy.fade_blue@wave_start = enemy.wave_start@sink_start = enemy.sink_start@sink_speed = enemy.sink_speed@collapse_sound = enemy.collapse_sound@sound_start = enemy.sound_start@kovolume = enemy.sound_volume@kopitch = enemy.sound_pitch@sound_fade = enemy.sound_fade@collapse_animation = enemy.collapse_animation@no_wait_for_animation = enemy.no_wait_for_animationend#--------------------------------------------------------------------------# * Execute Collapse Effect#--------------------------------------------------------------------------alias shadowmaster_perform_collapse_effect perform_collapse_effectdef perform_collapse_effectif enemy.custom_collapse == true@sprite_effect_type = :shadowmaster_custom_collapseelseshadowmaster_perform_collapse_effectendendend#==============================================================================# ** Sprite_Battler#------------------------------------------------------------------------------# This sprite is used to display battlers. It observes an instance of the# Game_Battler class and automatically changes sprite states.#==============================================================================class Sprite_Battler < Sprite_Base#--------------------------------------------------------------------------# * Start Effect#--------------------------------------------------------------------------alias shadowmaster_start_effect start_effectdef start_effect(effect_type)shadowmaster_start_effect(effect_type)case @effect_typewhen :shadowmaster_custom_collapse@effect_duration = @battler.collapse_duration@orig_eff_duration = @effect_duration@shake_x_start = @effect_duration - @battler.shake_x_start if @battler.shake_x_start != nil@shake_y_start = @effect_duration - @battler.shake_y_start if @battler.shake_y_start != nil@fade_start = @effect_duration - @battler.fade_start if @battler.fade_start != nil@wave_start = @effect_duration - @battler.wave_start if @battler.wave_start != nil@sink_start = @effect_duration - @battler.sink_start if @battler.sink_start != nil@sink_speed = @battler.sink_speed if @battler.sink_speed != nil@sound = @battler.collapse_sound if @battler.collapse_sound != nil@sound_start = @effect_duration - @battler.sound_start if @battler.sound_start != nil@volume = @battler.kovolume@pitch = @battler.kopitchself.wave_amp = 0@full_sink = 0@round_sink = 1@battler_visible = falseif @battler.collapse_animation != nilanimation = $data_animations[@battler.collapse_animation]start_animation(animation)SceneManager.scene.wait_for_animation if @battler.no_wait_for_animation == nilendendend#--------------------------------------------------------------------------# * Revert to Normal Settings#--------------------------------------------------------------------------alias shadowmaster_revert_to_normal revert_to_normaldef revert_to_normalshadowmaster_revert_to_normalself.oy = bitmap.height if bitmapself.wave_amp = 0end#--------------------------------------------------------------------------# * Update Effect#--------------------------------------------------------------------------alias shadowmaster_update_effect update_effectdef update_effectif @effect_type == :shadowmaster_custom_collapse && @effect_duration > 0shadowmaster_update_custom_collapseendshadowmaster_update_effectend#--------------------------------------------------------------------------# * Update Custom Collapse Effect#--------------------------------------------------------------------------def shadowmaster_update_custom_collapseif @fade_start != nil && @fade_start >= @effect_durationalpha = @effect_duration.to_f / @fade_start.to_fif @battler.fade_colors == true@fade_red = @battler.fade_red@fade_green = @battler.fade_green@fade_blue = @battler.fade_blueself.color.set(@fade_red, @fade_green, @fade_blue, 255 * alpha)elseself.color.set(255, 255, 255, 255 * alpha)endself.opacity = 128 * alphaself.blend_type = 1endif @shake_x_start != nil && @shake_x_start >= @effect_durationself.ox += ((rand(2) + 1) * 5) - ((rand(2) + 1) * 5)endif @shake_y_start != nil && @shake_y_start >= @effect_durationself.oy += ((rand(2) + 1) * 5) - ((rand(2) + 1) * 5)endif @sink_start != nil && @sink_start >= @effect_duration@full_sink += @sink_speed if @sink_speed != nil@full_sink += (bitmap.height.to_f / @sink_start.to_f) if @sink_speed == nilwhile @full_sink >= @round_sinkself.src_rect.y -= 1@round_sink += 1endendif @wave_start != nil && @wave_start >= @effect_duration && self.wave_amp == 0self.wave_amp = 8elsif @wave_start != nil && @wave_start >= @effect_duration && self.wave_amp > 0self.wave_amp += 2 if @effect_duration % 20 == 0elseself.wave_amp = 0endif @sound != nil && @sound_start != nil && @sound_start >= @effect_durationif @battler.sound_fade@volume_mult = @effect_duration.to_f / @sound_start.to_felse@volume_mult = 1endsound = RPG::SE.new(@sound, @volume * @volume_mult, @pitch)sound.play if @effect_duration % 20 == 19endendend
 
Last edited by a moderator:

Roninator2

Gamer
Veteran
Joined
May 22, 2016
Messages
3,051
Reaction score
682
First Language
English
Primarily Uses
RMVXA
I don't understand how the code can be put in like this

=begin===============================================================================Custom Collapse Effects V1.6 (01/8/2015)----------------------------



I'm trying to unravel it, but getting nothing but errors. I added some 'end' statements that I thought needed to be there. Just type in which line needs to be removed. and tell me what needs to be changed.


Thanks

=begin
===============================================================================
Custom Collapse Effects V1.6 (01/8/2015)
-------------------------------------------------------------------------------
Created By: Shadowmaster/Shadowmaster9000/Shadowpasta(www.crimson-castle.co.uk)
===============================================================================
Information
-------------------------------------------------------------------------------
This script allows you to customise collapse effects for both enemies and evenactors 
(collapse effects for actors will only work if using an actor battlersprite script like 
Yami's Battle Engine Symphony). 
Collapse effect customisationis done through notetagging and you can find the notetags below.
===============================================================================
How to Use
-------------------------------------------------------------------------------
Place this script under Materials. It's also best to put this script under
any other scripts that overwrite the perform_collapse_effect methods in either
the Game_Actor or Game_Enemy classes.
===============================================================================
Note Tags
-------------------------------------------------------------------------------
Place any of these note tags within an actor or enemy in the database.
--------------------Actor/Enemy Notetags--------------------
<custom collapse: n>
Sets up the duration of the custom collapse, where n is the number of frames
you want the custom collapse to last (60 frames per second).
<collapse shake x: n>
Shakes the battler horizontally, where n is at what frame the shake will start.
The effect will last until the end of the duration of the collapse effect.
<collapse shake y: n>
Shakes the battler vertically, where n is at what frame the shake will start.
The effect will last until the end of the duration of the collapse effect.
<collapse fade: n>
The battler starts fading to nothing, where n is at what frame the fading will
start. The effect will last until the end of the duration of the collapse effect.
<collapse fade color: n1 n2 n3>
Sets the fade color for the battler when using the collapse fade effect. This
uses the RGB system, with the numbers ranging between 0-255. Red is n1, Green
is n2 and Blue is n3.
<collapse sink: n1 n2>
The battler begins moving downwards, where n1 is at what frame the battler
will start sinking, and n2 is the speed that the battler will sink 
(you can even use decimal values for n2). 
You do not have to use n2. At default, theeffect will last until the end of 
the duration of the collapse effect whilenot using n2.
<collapse wave: n>
The battler's image begins to distort in a wavey like pattern, where n is at
what frame the wave effect will begin. The effect will last until the end of
the duration of the collapse effect.
<collapse sound: "string" n1 n2 n3>
A sound effect will start constantly playing, where "string" is the name of the
file in the Audio/SE folder, and n1 is at what frame the sound effects will start
playing. Variables n2 and n3 change the volume and pitch respectively. Variables
n2 and n3 do not need to be used. When they are not used, the value 100 is use
dat default. The effect will last until the end of the duration of the collapseeffect.
<fade sound>
Makes the sound set from the collapse sound effect fade out relative to the
duration of the collapse effect. This will not effect sound effects played
from animations used with the collapse animation notetag.
<collapse animation: n>
A battle animation will play at the beginning of the battler's collapse, where
n is the id of the battle animation you want to use. The battle animation
will run along the rest of the custom collapse effects you have set up for
the battler.
<no wait for collapse animation>
By default the battle system will wait for a battle animation to finish before
proceeding with the battle, even if the custom collapse itself ended long
before. Using this notetag will allow the battle to continue when a battle
animation from a battler's custom collapse effect is still going on.
===============================================================================
Example
-------------------------------------------------------------------------------
To help give you a better understanding of how to manipulate these effects
to achieve various results, below is an example of a custom collapse effect.
<custom collapse: 230>
The collapse will last for 230 frames.
<collapse shake x: 80>
The battler will begin to shake once 80 frames have gone past.
<collapse sound: "Collapse4" 80>
The Collapse4 sound effect will start playing continuously once 80 frameshave gone past.
<collapse fade: 110>
<collapse fade color: 255 0 0>
The battler will begin to fade in a red color once 110 frames have gone past.
<collapse sink: 110>
<collapse wave: 110>
The battler will begin to sink with a wavey distortion once 110 frames havegone past.
<collapse animation: 111>
Animation no.111 (which I like to call the Thunder Death animation) will
start playing.
This is what I have set up for the Thunder Death animation:
#007 Thunder10 Screen (255,255,255,200), @5
#020 Thunder10 Screen (255,255,255,200), @5
The Thunder10 sound effect will be played at frames 7 and 20 (word of warning,
battle animation frames are 15 frames per second and not 60 so the timing will
be different), along with the screen flashing white, with the flash lasting for
5 frames.
I highly recommend using battle animations for your custom collapse animations
as it allows for a far larger variety of effects that would otherwise not be
achievable without them.
===============================================================================
Required
-------------------------------------------------------------------------------
Nothing.
===============================================================================
Compatibility Issues
-------------------------------------------------------------------------------
Below are a list of scripts that this script is currently incompatible with.
A future update may fix these issues but I can't guarantee anything.
Yanfly Visual Battlers
----------------------
They've been set up differently to how enemy sprites are loaded up and they
haven't been set up to load collapse effects when an actor dies. This script
will still work with enemies while using Visual Battlers, but it won't work
with actors.
===============================================================================
Change log
-------------------------------------------------------------------------------
v1.6: Added the option to fade out sounds using a new notetag. 
(01/8/2015)v1.5: Fixed a bug that didn't rest various graphical effects when an actor
or enemy with a custom collapse animation is revived. 
(25/5/2015)v1.4: Updated the sound notetag to allow control of the sound's volume and
pitch. (12/10/2013)v1.3: Fixed the sinking function so the effect will now last for the duration
of the collapse effect. You can now also set a speed for the battler to sink.
(27/8/2013)v1.2: Fixed a bug where the battle would continue before finishing a collapse
animation containing a battle animation that extended to longer than the
collapse animation's duration. Also allowing users to skip this bug fix with
a notetag. 
(25/10/2013)v1.1: Fixed a bug where using a battle animation as a custom collapse effect
would delay the battle log until the battle animation finished. Unfortunately
the battle animations can no longer be used in conjunction with the default
collapse animations. (23/10/2013)v1.0: First release. (23/10/2013)
===============================================================================
Terms of Use
-------------------------------------------------------------------------------
* Free to use for both commercial and non-commerical projects.
* Credit me if used.
* Do not claim this as your own.
* You're free to post this on other websites, but please credit me and keepthe header intact.
* If you want to release any modifications/add-ons for this script, the
add-on script must use 
the same Terms of Use as this script uses. 
(But youcan also require any users of your add-on 
script to credit you in their gameif they use your add-on script.)
* If you're making any compatibility patches or scripts to help this script
work with other 
scripts, the Terms of Use for the compatibility patch does
not matter so long as the compatibility patch still requires this script to run.
* If you want to use your own seperate Terms of Use for your version or
add-ons of this script, you must contact me at http://www.rpgmakervxace.netor
www.crimson-castle.co.uk
================================================================================
=end
$imported = {} if $imported.nil?
$imported["Shadowmaster_Custom_Collapses"] = true


#==============================================================================
# ** DataManager
#------------------------------------------------------------------------------
# This module manages the database and game objects. Almost all of the
# global variables used by the game are initialized by this module.
#==============================================================================
module DataManager
#--------------------------------------------------------------------------
# * Load Database
#--------------------------------------------------------------------------
class <<self; 
alias load_database_custom_collapse load_database; 
end
def self.load_database  
  load_database_custom_collapse
  load_notetags_custom_collapse
end
end
#--------------------------------------------------------------------------
# * Load Notetags for Custom Collapse
#--------------------------------------------------------------------------
def self.load_notetags_custom_collapse
  groups = [$data_actors, $data_enemies]
for group in groups
for obj in groupnext 
if obj.nil?
obj.load_notetags_custom_collapse
end
end
end
end


class RPG::BaseItem
#--------------------------------------------------------------------------
# Public Instance Variables
#--------------------------------------------------------------------------
attr_accessor :custom_collapse
attr_accessor :collapse_duration
attr_accessor :collapse_shake
attr_accessor :shake_x_start
attr_accessor :shake_y_start
attr_accessor :collapse_fade
attr_accessor :fade_start
attr_accessor :fade_colors
attr_accessor :fade_red
attr_accessor :fade_green
attr_accessor :fade_blue
attr_accessor :wave_start
attr_accessor :sink_start
attr_accessor :sink_speed
attr_accessor :collapse_sound
attr_accessor :sound_start
attr_accessor :sound_volume
attr_accessor :sound_pitch
attr_accessor :sound_fade
attr_accessor :collapse_animation
attr_accessor :no_wait_for_animation
#--------------------------------------------------------------------------
# Defining Attributes
#--------------------------------------------------------------------------
def load_notetags_custom_collapse
@custom_collapse = false
@collapse_duration = 0
@shake_x_start = nil
@shake_y_start = nil
@fade_start = nil
@fade_colors = false
@wave_start = nil
@sink_start = nil
@sink_speed = nil
@collapse_sound = nil
@sound_start = nil
@sound_volume = 100
@sound_pitch = 100
@sound_fade = false
@collapse_animation = nil
@no_wait_for_animation = nil
if @note =~ /<custom collapse: (.*)>/i
@custom_collapse = true
@collapse_duration = $1.to_i
end
if @note =~ /<collapse shake x: (.*)>/i
@shake_x_start = $1.to_i
end
if @note =~ /<collapse shake y: (.*)>/i
@shake_y_start = $1.to_i
end
if @note =~ /<collapse fade: (.*)>/i
@fade_start = $1.to_i
end
if @note =~ /<collapse fade color: (.*) (.*) (.*)>/i
@fade_colors = true
@fade_red = $1.to_i
@fade_green = $2.to_i
@fade_blue = $3.to_i
end
if @note =~ /<collapse wave: (.*)>/i
@wave_start = $1.to_i
end
if @note =~ /<collapse sink: (.*) (.*)>/i
@sink_start = $1.to_i
@sink_speed = $2.to_f
end
if @note =~ /<collapse sound: "(.+?)\" (.*)>/i
@collapse_sound = $1.to_s
@sound_start = $2.to_i
end
if @note =~ /<collapse sound: "(.+?)\" (.*) (.*)>/i
@collapse_sound = $1.to_s
@sound_start = $2.to_i
@sound_volume = $3.to_i
end
if @note =~ /<collapse sound: "(.+?)\" (.*) (.*) (.*)>/i
@collapse_sound = $1.to_s
@sound_start = $2.to_i
@sound_volume = $3.to_i
@sound_pitch = $4.to_i
end
if @note =~ /<fade sound>/i
@sound_fade = true
end
if @note =~ /<collapse animation: (.*)>/i
@collapse_animation = $1.to_i
end
if @note =~ /<no wait for collapse animation>/i
@no_wait_for_animation = true
end
end
end


#==============================================================================
# ** Game_Actor
#------------------------------------------------------------------------------
# This class handles actors. It is used within the Game_Actors class
# ($game_actors) and is also referenced from the Game_Party class ($game_party).
#==============================================================================
class Game_Actor < Game_Battler
#--------------------------------------------------------------------------
# * Public Instance Variables
#--------------------------------------------------------------------------
attr_reader :collapse_duration
attr_reader :shake_x_start
attr_reader :shake_y_start
attr_reader :fade_start
attr_reader :fade_colors
attr_reader :fade_red
attr_reader :fade_green
attr_reader :fade_blue
attr_reader :wave_start
attr_reader :sink_start
attr_reader :sink_speed
attr_reader :collapse_sound
attr_reader :sound_start
attr_reader :kovolume
attr_reader :kopitch
attr_reader :sound_fade
attr_reader :collapse_animation
attr_reader :no_wait_for_animation
#--------------------------------------------------------------------------
# * Object Initialization
#--------------------------------------------------------------------------
alias shadowmaster_setup_collapse setup
def setup(actor_id)shadowmaster_setup_collapse(actor_id)
@collapse_duration = actor.collapse_duration
@shake_x_start = actor.shake_x_start
@shake_y_start = actor.shake_y_start
@fade_start = actor.fade_start
@fade_colors = actor.fade_colors
@fade_red = actor.fade_red
@fade_green = actor.fade_green
@fade_blue = actor.fade_blue
@wave_start = actor.wave_start
@sink_start = actor.sink_start
@sink_speed = actor.sink_speed
@collapse_sound = actor.collapse_sound
@sound_start = actor.sound_start
@kovolume = actor.sound_volume
@kopitch = actor.sound_pitch
@sound_fade = actor.sound_fade
@collapse_animation = actor.collapse_animation
@no_wait_for_animation = actor.no_wait_for_animationend
#--------------------------------------------------------------------------
# * Execute Collapse Effect
#--------------------------------------------------------------------------
alias shadowmaster_perform_collapse_effect perform_collapse_effect
def perform_collapse_effect
if actor.custom_collapse == true
@sprite_effect_type = :shadowmaster_custom_collapse
else
shadowmaster_perform_collapse_effect
end
end
end
end


#==============================================================================
# ** Game_Enemy
#------------------------------------------------------------------------------
# This class handles enemies. It used within the Game_Troop class
# ($game_troop).
#==============================================================================
class Game_Enemy < Game_Battler
#--------------------------------------------------------------------------
# * Public Instance Variables
#--------------------------------------------------------------------------
attr_reader :collapse_duration
attr_reader :shake_x_start
attr_reader :shake_y_start
attr_reader :fade_start
attr_reader :fade_colors
attr_reader :fade_red
attr_reader :fade_green
attr_reader :fade_blue
attr_reader :wave_start
attr_reader :sink_start
attr_reader :sink_speed
attr_reader :collapse_sound
attr_reader :sound_start
attr_reader :kovolume
attr_reader :kopitch
attr_reader :sound_fade
attr_reader :collapse_animation
attr_reader :no_wait_for_animation
#--------------------------------------------------------------------------
# * Object Initialization
#--------------------------------------------------------------------------
alias shadowmaster_initialize_collapse initialize
def initialize(index, enemy_id)
shadowmaster_initialize_collapse(index, enemy_id)
@collapse_duration = enemy.collapse_duration
@shake_x_start = enemy.shake_x_start
@shake_y_start = enemy.shake_y_start
@fade_start = enemy.fade_start
@fade_colors = enemy.fade_colors
@fade_red = enemy.fade_red
@fade_green = enemy.fade_green
@fade_blue = enemy.fade_blue
@wave_start = enemy.wave_start
@sink_start = enemy.sink_start
@sink_speed = enemy.sink_speed
@collapse_sound = enemy.collapse_sound
@sound_start = enemy.sound_start
@kovolume = enemy.sound_volume
@kopitch = enemy.sound_pitch
@sound_fade = enemy.sound_fade
@collapse_animation = enemy.collapse_animation
@no_wait_for_animation = enemy.no_wait_for_animation
end
#--------------------------------------------------------------------------
# * Execute Collapse Effect
#--------------------------------------------------------------------------
alias shadowmaster_perform_collapse_effect 
perform_collapse_effect
def perform_collapse_effect
if enemy.custom_collapse == true
@sprite_effect_type = :shadowmaster_custom_collapse
else
shadowmaster_perform_collapse_effect
end
end
end


#==============================================================================
# ** Sprite_Battler
#------------------------------------------------------------------------------
# This sprite is used to display battlers. It observes an instance of the
# Game_Battler class and automatically changes sprite states.
#==============================================================================
class Sprite_Battler < Sprite_Base#--------------------------------------------------------------------------
# * Start Effect
#--------------------------------------------------------------------------
alias shadowmaster_start_effect start_effect
def start_effect(effect_type)
shadowmaster_start_effect(effect_type)
case 
@effect_type
when :shadowmaster_custom_collapse
@effect_duration = @battler.collapse_duration
@orig_eff_duration = @effect_duration
@shake_x_start = @effect_duration - @battler.shake_x_start 
if @battler.shake_x_start != nil
@shake_y_start = @effect_duration - @battler.shake_y_start 
if @battler.shake_y_start != nil
@fade_start = @effect_duration - @battler.fade_start 
if @battler.fade_start != nil
@wave_start = @effect_duration - @battler.wave_start 
if @battler.wave_start != nil
@sink_start = @effect_duration - @battler.sink_start 
if @battler.sink_start != nil
@sink_speed = @battler.sink_speed 
if @battler.sink_speed != nil
@sound = @battler.collapse_sound 
if @battler.collapse_sound != nil
@sound_start = @effect_duration - @battler.sound_start 
if @battler.sound_start != nil
@volume = @battler.kovolume
@pitch = @battler.kopitchself.wave_amp = 0
@full_sink = 0
@round_sink = 1
@battler_visible = false
if @battler.collapse_animation != nil
animation = $data_animations[@battler.collapse_animation]
start_animation(animation)
SceneManager.scene.wait_for_animation 
if @battler.no_wait_for_animation == nil
end
end
end
#--------------------------------------------------------------------------
# * Revert to Normal Settings
#--------------------------------------------------------------------------
alias shadowmaster_revert_to_normal revert_to_normal
def revert_to_normal
shadowmaster_revert_to_normal
self.oy = bitmap.height 
if bitmapself.wave_amp = 0
end
#--------------------------------------------------------------------------
# * Update Effect
#--------------------------------------------------------------------------
alias shadowmaster_update_effect update_effect
def update_effect
if @effect_type == :shadowmaster_custom_collapse && @effect_duration > 0
shadowmaster_update_custom_collapse
end
shadowmaster_update_effect
end
#--------------------------------------------------------------------------
# * Update Custom Collapse Effect
#--------------------------------------------------------------------------
def shadowmaster_update_custom_collapse
if @fade_start != nil && @fade_start >= @effect_duration
alpha = @effect_duration.to_f / @fade_start.to_f
if @battler.fade_colors == true
@fade_red = @battler.fade_red
@fade_green = @battler.fade_green
@fade_blue = @battler.fade_blue
self.color.set(@fade_red, @fade_green, @fade_blue, 255 * alpha)
else
self.color.set(255, 255, 255, 255 * alpha)
end
self.opacity = 128 * alpha
self.blend_type = 1
end
if @shake_x_start != nil && @shake_x_start >= @effect_duration
self.ox += ((rand(2) + 1) * 5) - ((rand(2) + 1) * 5)
end
if @shake_y_start != nil && @shake_y_start >= @effect_duration
self.oy += ((rand(2) + 1) * 5) - ((rand(2) + 1) * 5)
end
if @sink_start != nil && @sink_start >= @effect_duration
@full_sink += @sink_speed 
if @sink_speed != nil
@full_sink += (bitmap.height.to_f / @sink_start.to_f) 
if @sink_speed == nil
while @full_sink >= @round_sink
self.src_rect.y -= 1
@round_sink += 1
end
end
if @wave_start != nil && @wave_start >= @effect_duration && self.wave_amp == 0
self.wave_amp = 8
elsif @wave_start != nil && @wave_start >= @effect_duration && self.wave_amp > 0
self.wave_amp += 2 
if @effect_duration % 20 == 0
else
self.wave_amp = 0
end
if @sound != nil && @sound_start != nil && @sound_start >= @effect_duration
if @battler.sound_fade@volume_mult = @effect_duration.to_f / @sound_start.to_f
else
  @volume_mult = 1
end
sound = RPG::SE.new(@sound, @volume * @volume_mult, @pitch)
sound.play 
if @effect_duration % 20 == 19
end
end
end
end
end
end
end
end
end
end
end
end
end
end
end
end
end
 

Nirwanda

Procrastimancer
Veteran
Joined
Nov 2, 2012
Messages
1,291
Reaction score
610
First Language
Spanish
Primarily Uses
RMMV
Sorry man, I'm no scripter, it's someone else's work I have no idea.


Have you checked you copied it well? Because the forum renewal screwed up the formatting of what I wrote. What about incompatibilities with other scripts you have?


Sadly, I don't have the script on my hard drive and now the link truly doesn't work so I can't provide you with a correctly formatted version.
 

Celianna

Tileset artist
Veteran
Joined
Mar 1, 2012
Messages
10,558
Reaction score
5,602
First Language
Dutch
Primarily Uses
RMMV
Roninator2 don't necro-post a year old thread, create your own if you have an issue, thank you.
 
Status
Not open for further replies.

Latest Threads

Latest Posts

Latest Profile Posts

Arcade-Style RPGM Games? RM2k3 Game Jam & Synth-Retro Music by Azakaela | RPG Maker News #39

Just evented my first minigame, no plugins~ :kaojoy:
I feel still screenshots don't do my game justice. the characters don't move, but the filter over them does...
Wonder if this year, there be more MZ plugin than MV or that MZ is still small compare to whole MV collection

Forum statistics

Threads
111,349
Messages
1,060,385
Members
144,674
Latest member
WaterIce455
Top