RMRK is retiring.
Registration is disabled. The site will remain online, but eventually become a read-only archive. More information.

RMRK.net has nothing to do with Blockchains, Cryptocurrency or NFTs. We have been around since the early 2000s, but there is a new group using the RMRK name that deals with those things. We have nothing to do with them.
NFTs are a scam, and if somebody is trying to persuade you to buy or invest in crypto/blockchain/NFT content, please turn them down and save your money. See this video for more information.
Teleport Fade Options

0 Members and 1 Guest are viewing this topic.

*
Rep:
Level 97
2014 Most Unsung Member2014 Best RPG Maker User - Engine2013 Best RPG Maker User (Scripting)2012 Most Mature Member2012 Favorite Staff Member2012 Best RPG Maker User (Scripting)2012 Best MemberSecret Santa 2012 ParticipantProject of the Month winner for July 20092011 Best Use of Avatar and Signature Space2011 Best RPG Maker User (Scripting)2011 Most Mature Member2011 Favourite Staff Member2011 Best Veteran2010 Most Mature Member2010 Favourite Staff Member
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


Code: [Select]
#==============================================================================
#  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.


Creative Commons License
This script by modern algebra is licensed under a Creative Commons Attribution-Non-Commercial-Share Alike 2.5 Canada License.
« Last Edit: February 11, 2010, 09:52:42 PM by Modern Algebra »

********
Resource Artist
Rep:
Level 94
\\\\\
Project of the Month winner for June 2009
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.
« Last Edit: November 19, 2008, 08:26:51 AM by grafikal006 »