Advertisement
Guest User

Simple Transfers

a guest
Jan 2nd, 2012
259
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Ruby 3.92 KB | None | 0 0
  1. #==============================================================================
  2. #   Simple Transfers
  3. #   Author: Nicke
  4. #   Created: 12/12/2011
  5. #   Edited: 02/01/2012
  6. #   Version: 1.0a
  7. #==============================================================================
  8. # Instructions
  9. # -----------------------------------------------------------------------------
  10. # To install this script, open up your script editor and copy/paste this script
  11. # to an open slot below ▼ Materials but above ▼ Main. Remember to save.
  12. #
  13. # This simple script basically just changes the method when a player is transferring.
  14. # You can set up a random transition to use when they are changing the map.
  15. #
  16. # You can also change the transfer fade in/fade out time if the transition
  17. # is not in use.
  18. #==============================================================================
  19. ($imported ||= {})["NICKE-SIMPLE-TRANSFERS"] = true
  20. module NICKE
  21.   module TRANSFERS
  22.   #--------------------------------------------------------------------------#
  23.   # * Settings
  24.   #--------------------------------------------------------------------------#
  25.   # Change the fade out/fade in speed with variables ingame.
  26.   # (Not enabled if transition image is in use.)
  27.   #
  28.   # Default values in frames: 30, 30, 15.
  29.   # TRANSFERS [ FADE_OUT_VARIABLE, FADE_IN_VARIABLE, WAIT(frames) ]
  30.     TRANSFERS = [39, 40, 10]        
  31.  
  32.   # Use transition? SWITCH_ID to turn it on/off.
  33.   # Change the TRANSITION string to your image file located in PATH.
  34.   # Note: If random is enabled the filename must be 0,1,2 etc and TRANSITION will
  35.   # not be in use since it gets the transition file from rand_transition instead.
  36.   # TRANSITION [ SWITCH_ID, PATH, SPEED, TRANSITION, OPACITY, RANDOM ]
  37.     TRANSITION = [8, "Graphics/Transitions/", 40, "", 50, true]
  38.  
  39.   # Only if TRANSITION random is enabled.
  40.   # Specify the value of randomized transition images in here.
  41.   # As of right now the value is 4 which means you need to have 4 images
  42.   # inside your transition folder starting from 0 to 4.
  43.     RANDOM_VALUE = 4
  44.   end
  45. end
  46. # *** Don't edit below unless you know what you are doing. ***
  47. #==============================================================================#
  48. # ** Scene_Map
  49. #==============================================================================#
  50. class Scene_Map < Scene_Base
  51.  
  52.   @@transition_path = NICKE::TRANSFERS::TRANSITION[1]
  53.  
  54.   # // Method to get a random transition.
  55.   def rand_transition(number)
  56.     transition_rand = rand(number)
  57.     transition = "#{@@transition_path}#{transition_rand}"
  58.   end
  59.  
  60.   # // Method when the player is transferring. (override)
  61.   def update_transfer_player
  62.     return unless $game_player.transfer?
  63.     transition_disabler = $game_switches[NICKE::TRANSFERS::TRANSITION[0]]
  64.     Graphics.freeze
  65.     fade = (Graphics.brightness > 0)
  66.     fadeout($game_variables[TRANSFERS[0]]) if fade && transition_disabler
  67.     @spriteset.dispose              
  68.     $game_player.perform_transfer  
  69.     $game_map.autoplay              
  70.     $game_map.update
  71.     Graphics.wait(NICKE::TRANSFERS::TRANSFERS[2]) if !transition_disabler
  72.     @spriteset = Spriteset_Map.new
  73.     fadein($game_variables[TRANSFERS[2]]) if fade && transition_disabler
  74.     if !transition_disabler
  75.       if NICKE::TRANSFERS::TRANSITION[5] # // Random enabled or not?
  76.         Graphics.transition(NICKE::TRANSFERS::TRANSITION[2],rand_transition(NICKE::TRANSFERS::RANDOM_VALUE),NICKE::TRANSFERS::TRANSITION[4])
  77.       else
  78.         transition = NICKE::TRANSFERS::TRANSITION[3]
  79.         Graphics.transition(NICKE::TRANSFERS::TRANSITION[2],"#{@@transition_path}#{transition}",NICKE::TRANSFERS::TRANSITION[4])
  80.       end
  81.     else
  82.       Graphics.transition(30)
  83.     end
  84.     Input.update
  85.   end
  86.  
  87. end # END OF FILE
  88.  
  89. #=*==========================================================================*=#
  90. # ** END OF FILE
  91. #=*==========================================================================*=#
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement