Main Menu
  • Welcome to The RPG Maker Resource Kit.

Teleport Fade Options

Started by modern algebra, August 16, 2008, 07:26:34 PM

0 Members and 1 Guest are viewing this topic.

modern algebra

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

Screenshots



Instructions

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




  • modern algebra

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.




Grafikal

#1
Hah, so I was looking for your no fade script and discovered ya got rid of it and threw up a newer one. :)

I have a problem though. It's still fading. I plugged the script in just as it is. The variable is set as 1 as well but it still fades. I'm not sure what else I'm supposed to change, and also, when I get this to work is there a call script of some sort I could use to make certain transfers have a fade instead of not?

Sigh... Never mind, I fixed it. It's just been too long since I've done anything with a script. Lol.