Teleport Fade Options
Version: 1.0
Author: modern algebra
Date: August 12, 2008
Version History
- <Version 1.0> Original - August 12, 2008
Description
This script allows you to use different fades from the default fade to black of teleports. You can now choose up to 32 different colours to fade to, as well as an option for no fade at all upon teleport, which allows you to custom fade and transition.
Features
- Allows for no fade when teleporting
- Allows for a fade to the 32 colours of the Windowskin palette
ScreenshotsInstructions See inside script.
Script
#==============================================================================
# Teleport Fade Options
# Version 1.0
# Author: modern algebra (rmrk.net)
# Date: August 12, 2008
#~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
# Instructions:
# This script is operated by a single variable, set below at line 26 as
# FADE_VARIABLE_ID. When you set that, you set the ID of the variable which
# controls your teleport options. They are simple:
#
# When that variable is equal to:
# 0 - Default Fade to Black
# 1 - No Fade
# 2-33 - Windowskin colour palette
#
# Keep in mind that the Windowskin colours do not necessarily go to a solid
# colour, and so you should experiment with them before using. Also, with
# different windowskins, you may experience different effects if the palette
# is changed. Just in case you don't know, the Windowskin colour palette is
# the same one you access when you use the message code \c[x].
#==============================================================================
# ** Global Constant
#==============================================================================
# The ID of the variable that controls fade/no fade/fade to colour
FADE_VARIABLE_ID = 1
#==============================================================================
# *** Graphics
#~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
# Summary of Changes:
# aliased method - wait
#==============================================================================
module Graphics
class << self
#~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
# * Wait
# duration : time in frames
#~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
alias modalg_override_wait_transfer_n_fad_n43 wait
def wait (duration)
return if $game_variables[FADE_VARIABLE_ID] == 1
modalg_override_wait_transfer_n_fad_n43 (duration)
end
end
end
#==============================================================================
# ** Spriteset Map
#~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
# Summary of Changes:
# aliased methods - dispose
#==============================================================================
class Spriteset_Map
#~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
# * Dispose
#~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
alias modalg_override_spriteset_disposal_no_fade_7ht2 dispose
def dispose
return if $game_variables[FADE_VARIABLE_ID] > 0 && $game_player.transfer?
modalg_override_spriteset_disposal_no_fade_7ht2
end
end
#==============================================================================
# ** Scene_Map
#~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
# Summary of Changes:
# aliased methods - fadein, fadeout
#==============================================================================
class Scene_Map
#~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
# * Fade In Screen
#~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
alias modalg_trans_no_fade_teleport_fdin_4nb6 fadein
def fadein(duration)
if @transfer && $game_variables[FADE_VARIABLE_ID].between? (1, 33)
# Dispose of Spriteset
@old_spriteset.dispose unless @old_spriteset == nil
@old_spriteset = nil
# Cancel Fade if turned off
if $game_variables[FADE_VARIABLE_ID] > 1
$game_map.screen.start_tone_change (@original_tone, duration)
# Update Basic functions until fade is complete
for i in 0..duration-1
update_basic
end
end
else
# Run Original Method
modalg_trans_no_fade_teleport_fdin_4nb6 (duration)
end
# Restore Transfer data
@transfer = $game_player.transfer?
end
#~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
# * Fade Out Screen
#~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
alias modalg_fde_n_telepot_fdout_5ny5 fadeout
def fadeout(duration)
@transfer = $game_player.transfer?
if @transfer && $game_variables[FADE_VARIABLE_ID].between? (1, 33)
# Save spriteset to be disposed manually
@old_spriteset = @spriteset
if $game_variables[FADE_VARIABLE_ID] > 1
# Save Original Tone
@original_tone = $game_map.screen.tone.clone
# Create Tone from Color
colour = @message_window.text_color ($game_variables[FADE_VARIABLE_ID] - 2)
tone = Tone.new (colour.red, colour.green, colour.blue)
$game_map.screen.start_tone_change (tone, duration)
# Update Basic functions until fade is complete
for i in 0..duration-1
update_basic
end
end
else
# Run Original Method
modalg_fde_n_telepot_fdout_5ny5 (duration)
end
end
end
Credit
Support
Post in this topic at rmrk.net for the swiftest response
Author's Notes
This script began as the No Fade Teleport script, posted here earlier. However, that has been deleted since.
This script by
modern algebra is licensed under a
Creative Commons Attribution-Non-Commercial-Share Alike 2.5 Canada License.