Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- #===============================================================================
- # RAFAEL_SOL_MAKER's ACE TRANSITION SET v1.0
- #-------------------------------------------------------------------------------
- # Description | With this script you can use a set of multiple customized
- # | transitions in the teleport, or at the beginning or end of
- # | battles. You can configure in and out transitions, so a total
- # | of six different transitions can be used within your game.
- #-------------------------------------------------------------------------------
- # Script Usage | To change the transitions in-game use the following command:
- # |
- # -> | set_transition (transition, filename)
- # |
- # | Where 'transition' accepts the following values: MAP_IN,
- # | MAP_OUT, BATTLE_IN, BATTLE_OUT, BATTLE_END_IN, BATTLE_END_OUT;
- # | And 'filename' is the name of the bitmap used for transition,
- # | which should be in the folder 'Graphics/Transitions/'.
- # | If you prefer to use the fade effect instead, just use a blank
- # | filename, a empty quote: "" ;
- # |
- # -> | set_transition_wait (duration)
- # |
- # | To set the transition's delay time, in frames.
- # |
- # -> | OBS.: Also uses a teleport sound effect that can be configured
- # | by Sound module. The settings and default values can be found
- # | in the configurable module.
- #-------------------------------------------------------------------------------
- # Special Thanks: Angel Ivy-chan
- #-------------------------------------------------------------------------------
- #===============================================================================
- #===============================================================================
- # VERSION HISTORY
- #-------------------------------------------------------------------------------
- # ACE TRANSITION SET v1.0 - 04/12/2011(dd/mm/yyyy)
- # * Initial release (and my very first script in RGSS3!)
- #-------------------------------------------------------------------------------
- #===============================================================================
- module PPVXAce_General_Configs
- # TRANSITION BETWEEN THE SCENES
- Transition_In = 'Blind01' # Map Transition (in)
- Transition_Out = 'Blind02' # Map Transition (out)
- Battle_In = 'Blind03' # Battle Transition (in)
- Battle_Out = 'Blind04' # Battle Transition (out)
- Battle_End_In = 'Brick01' # Battle End Transition (in)
- Battle_End_Out = 'Brick02' # Battle End Transition (out)
- Transition_Wait = 60 # Transition Delay, in Frames
- end
- module Cache
- # Preparation of Transitions in Cache
- def self.transition(filename)
- load_bitmap('Graphics/Transitions/', filename)
- end
- end
- module Sound
- # Teleport's Sound Effect
- def self.play_teleport
- Audio.se_play('Audio/SE/Run', 25, 50)
- end
- end
- class Game_Interpreter
- include PPVXAce_General_Configs
- MAP_IN = 1 #Transition: Map In
- MAP_OUT = 2 #Transition: Map Out
- BATTLE_IN = 3 #Transition: Battle In
- BATTLE_OUT = 4 #Transition: Battle Out
- BATTLE_END_IN = 5 #Transition: End of Battle In
- BATTLE_END_OUT = 6 #Transition: End of Battle Out
- #--------------------------------------------------------------------------
- # Change Transitions Between Scenes
- #--------------------------------------------------------------------------
- def set_transition (transition = MAP_IN, filename = '')
- # Selects which transition will be changed
- case transition
- when MAP_IN
- $game_system.map_in = filename
- when MAP_OUT
- $game_system.map_out = filename
- when BATTLE_IN
- $game_system.battle_in = filename
- when BATTLE_OUT
- $game_system.battle_out = filename
- when BATTLE_END_IN
- $game_system.battle_end_in = filename
- when BATTLE_END_OUT
- $game_system.battle_end_out = filename
- end
- end
- #--------------------------------------------------------------------------
- # Change the Transition Delay
- #--------------------------------------------------------------------------
- def set_transition_wait (duration = 45)
- $game_system.transition_wait = duration
- end
- end
- class Game_System
- include PPVXAce_General_Configs
- attr_accessor :map_in
- attr_accessor :map_out
- attr_accessor :battle_in
- attr_accessor :battle_out
- attr_accessor :battle_end_in
- attr_accessor :battle_end_out
- attr_accessor :transition_wait
- attr_accessor :was_in_battle
- alias solmaker_transition_initialize initialize
- def initialize
- solmaker_transition_initialize
- load_transitions
- end
- def load_transitions
- @map_in = Transition_In
- @map_out = Transition_Out
- @battle_in = Battle_In
- @battle_out = Battle_Out
- @battle_end_in = Battle_End_In
- @battle_end_out = Battle_End_Out
- @transition_wait = Transition_Wait
- @was_in_battle = false
- end
- end
- class Scene_Map < Scene_Base
- def pre_transfer
- @map_name_window.close
- case $game_temp.fade_type
- when 0
- perform_map_transition_out
- when 1
- white_fadeout(fadeout_speed)
- end
- end
- def post_transfer
- case $game_temp.fade_type
- when 0
- perform_map_transition_in
- when 1
- white_fadein(fadein_speed)
- end
- @map_name_window.open
- end
- def perform_transition
- if Graphics.brightness == 0
- Graphics.transition(0)
- fadein(fadein_speed)
- else
- $game_system.was_in_battle ? perform_battle_end_transition : super
- end
- end
- def perform_battle_transition
- filename = ""
- if $game_system.battle_out != ""
- filename = 'Graphics/Transitions/'+ $game_system.battle_out
- end
- Graphics.transition($game_system.transition_wait, filename)
- Graphics.freeze
- end
- def perform_battle_end_transition
- $game_system.was_in_battle = false
- filename = ""
- if $game_system.battle_end_in != ""
- filename = 'Graphics/Transitions/' + $game_system.battle_end_in
- end
- Graphics.transition($game_system.transition_wait, filename)
- end
- def perform_map_transition_out
- Graphics.freeze
- @spriteset.dispose
- filename = ""
- if $game_system.map_out != ""
- filename = 'Graphics/Transitions/' + $game_system.map_out
- end
- Graphics.transition($game_system.transition_wait, filename)
- end
- def perform_map_transition_in
- Graphics.wait($game_system.transition_wait / 2)
- Graphics.freeze
- @spriteset = Spriteset_Map.new
- filename = ""
- if $game_system.map_in != ""
- filename = 'Graphics/Transitions/' + $game_system.map_in
- end
- Graphics.transition($game_system.transition_wait, filename)
- end
- end
- class Scene_Battle < Scene_Base
- def perform_transition
- filename = ""
- if $game_system.battle_in != ""
- filename = 'Graphics/Transitions/'+ $game_system.battle_in
- end
- Graphics.transition($game_system.transition_wait, filename)
- end
- def pre_terminate
- super
- $game_system.was_in_battle = true
- perform_map_transition if SceneManager.scene_is?(Scene_Map)
- Graphics.fadeout(60) if SceneManager.scene_is?(Scene_Title)
- end
- def perform_map_transition
- Graphics.freeze
- @spriteset.dispose
- filename = ""
- if $game_system.battle_end_out != ""
- filename = 'Graphics/Transitions/' + $game_system.battle_end_out
- end
- Graphics.transition($game_system.transition_wait, filename)
- end
- end
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement