The RPG Maker Resource Kit

RMRK RPG Maker Creation => VX => VX Scripts Database => Topic started by: modern algebra on January 12, 2010, 07:37:41 PM

Title: Deity Random Fadein [XP-style transitions]
Post by: modern algebra on January 12, 2010, 07:37:41 PM
Random Fadein
Version: 0.9
Author: Deity
Date: January 11, 2010

Description


This script allows you to use transition files for regular teleports instead of default fade, similar to the battle transitions. it selects from them randomly  

Features


Instructions

Place this script into its own slot in the Script Editor (F11), above Main and below the default scripts. I would recommend that you put this script ABOVE all other custom scripts you are using.

For setting the script up: first, you need to create a new folder in Graphics named Fadein. Now, add all of the transition files you want to use  into that new folder. Then, all you need to do is configure the settings below and you're all set.

Script


It is recommended that you get the script from the demo (http://rmrk.net/index.php?action=dlattach;topic=37043.0;attach=18980), so you can see where to put the transition files (in a new Fadein folder)

Code: [Select]
#????????????????????????????????????????????????????????????????#
# Script:  Deity's Random Fadein                                 #
# by Deity [translated to English by modern algebra (rmrk.net)]  #
#????????????????????????????????????????????????????????????????#
#  Description:                                                 #
#    This script allows you to use transition files for regular  #
#   teleports instead of default fade, similar to the battle     #
#   transitions                                                  #
#????????????????????????????????????????????????????????????????#
#  Instructions:                                                 #
#    First, you need to create a new folder in Graphics named    #
#   Fadein. Now, add all of the transition files you want to use #
#   into that new folder. Then, all you need to do is configure  #
#   the settings below and you're all set.                       #
#????????????????????????? Settings ?????????????????????????????#
module RandomFadein
  DURATION = 100 # Duration of the Fadein
  B_W = 100      # Intensity of the black colours
  SWITCH_ID = 1  # The ID of the switch that toggles whether this
                 # effect is active. When the switch is ON, the
                 # effect wil be active. When OFF, it will
                 # default to the regular fade
end
# Do not touch anything after this point unless you are a       #
# scripter and know what you're doing.                          #
#???????????????????????????????????????????????????????????????#
include RandomFadein
class Scene_Title
  alias create_game_objects_fade create_game_objects
  def create_game_objects
    create_game_objects_fade
    $game_switches[SWITCH_ID] = true
  end
end
class Scene_Map
  def fadein_deity
    transitions = Dir.entries("Graphics/Fadein/")
    unless transitions.size > 2
      fadein (30)
      return
    end
    effekt = rand (transitions.size - 2)
    Graphics.transition(DURATION,"Graphics/Fadein/"+transitions[effekt + 2], B_W)
  end
  def perform_transition
    if Graphics.brightness == 0   # After battle or loading, etc.
      if $game_switches[SWITCH_ID] == true
        fadein_deity
      else
        fadein(30)
      end
    else                              # Restoration from menu, etc.
      Graphics.transition(15)
    end
  end
  def update_transfer_player
    return unless $game_player.transfer?
    @spriteset.dispose
    @spriteset = Spriteset_Map.new
    $scene = Scene_Map.new
    fade = (Graphics.brightness > 0)
    fadeout(30) if fade
    @spriteset.dispose              # Dispose of sprite set
    $game_player.perform_transfer   # Execute player transfer
    $game_map.autoplay              # Automatically switch BGM and BGS
    $game_map.update
    Graphics.wait(15)
    @spriteset = Spriteset_Map.new  # Recreate sprite set
    Input.update
  end
end

Credit



Support


Please post in this topic at rmrk.net and I will either answer the question myself or refer your question to the script author. You could also go to rpgvx.net and ask Deity directly.

Known Compatibility Issues

The script apparently overwrites a couple methods, so it may interfere with other scripts that deal with transitions or with player transfers. You should put this script above Main and below the other default scripts, but you should probably put it ABOVE any other custom scripts you are using.

Demo


Demo is attached (http://rmrk.net/index.php?action=dlattach;topic=37043.0;attach=18980). It is recommended that you get it from the demo so you can see where to put the transition graphics.

Translator's Notes


All of the credit goes to Deity. I made only one minor edit to the script.