Black Fading for warp by trebor777 Version: 2.0
May 19 2006
This is a locked, single-post thread from Creation Asylum. Archived here to prevent its loss.
No support is given. If you are the owner of the thread, please contact administration.
Introduction
Automatically Create a Black Screen's fade, only for player transfer to a different map from the current one.
Script
script
Code:
#==============================================================================
# ** Fade Warp (Fondu téléport)
#------------------------------------------------------------------------------
# Trebor777
# 2.0
# 18/05/2006
#------------------------------------------------------------------------------
# Génère automatiquement un fondu sur écran noir, pour les téléportations vers
# une map différente de l'actuelle.
# Automatically Create a Black Screen's fade, for player transfer to a different
# map from the current one.
#==============================================================================
#--------------------------------------------------------------------------
# * Begin SDK Enable Test
#--------------------------------------------------------------------------
if SDK.state("Fade_warp") == true #SDK
#==============================================================================
# ** Interpreter (part 2)
#------------------------------------------------------------------------------
# This interpreter runs event commands. This class is used within the
# Game_System class and the Game_Event class.
#==============================================================================
class Interpreter
#--------------------------------------------------------------------------
# * Event Command Execution
#--------------------------------------------------------------------------
$fade_wait = 10 #if =0, désactivate the effect.
#--------------------------------------------------------------------------
alias fade_warp_execute_command execute_command
def execute_command
# If last to arrive for list of event commands
if @index >= @list.size - 1
# End event
@a_fait = nil
command_end
# Continue
return true
end
parameters = @list[@index].parameters
id=$game_map.map_id #id of the current map
# if the command is "transfer player"
if @list[@index].code==201 and @a_fait==nil
# if destination's ID, is different from the current map's one, :
if (parameters[0]==0 and parameters[1]!=id) or (parameters[0]!=0 and $game_variables[parameters[1]]!=id)
# Change screen tone to black
black_tone=RPG::EventCommand.new(223,0,[Tone.new(-255,-255,-255,0),$fade_wait])
# Wait
wait=RPG::EventCommand.new(106,0,[$fade_wait])
# Change screen tone to Normal
no_tone=RPG::EventCommand.new(223,0,[Tone.new(0,0,0,0),$fade_wait])
# insert of the 2 first commands before the transfer player one
if $fade_wait>0
@list.insert(0,black_tone,wait)
# insert of the last after the transfer player one
@list.insert(@list.size - 1,no_tone)
# flag in order to mark the execution
end
@a_fait = true
end
end
fade_warp_execute_command
end
end
#--------------------------------------------------------------------------
# * End SDK Enable Test
#--------------------------------------------------------------------------
end #SDK
Instructions
Simply use as usual the transfer player command ^^ , a black screen transition will appear only when the destination map is different from the current one.
Set $fade_wait to 0 if you want desactivate the script.
Set $fade_wait to the value you want in order to get a more or less long black screen.
Compatibility
SDK compliant !
Can work without the SDK if you remove lines with "#SDK" at the end
Author's Note
Version 2.0 changes :
- A new code, lot more simple ^^ !
- Possibility to configure the black screen time
- Works with or without the SDK.