[XP] Transition Pack v1.11

Started by Fantasist, July 24, 2008, 12:45:52 pm

Previous topic - Next topic

Fantasist

July 24, 2008, 12:45:52 pm Last Edit: December 11, 2010, 06:56:33 am by Fantasist
Transition Pack
Authors: Fantasist
Version: 1.11
Type: Eye Candy
Key Term: Misc System



Introduction

This script adds some exotic transitions which can't be attained by regular transition graphics.

Update: I am no longer updating this script, but ForeverZer0 has made a topic with more transition effects here:
http://forum.chaos-project.com/index.php/topic,7862.0.html
Kudos to you FZ :D


Features


  • Exotic transitions for special occasions in your game
  • Easily extendable



Screenshots

You can't appreciate the effects as screenshots, just try the demo :)


Demo
http://www.mediafire.com/?6ety24cpt311att (245.98 KB)






Script

You will need the screenshot dll to use this script. You can find it in the demo. Place the dll in the game folder.

Place this script below Scene_Debug and above Main.

Spoiler: ShowHide

#==============================================================================
# ** Transition Pack
#------------------------------------------------------------------------------
# by Fantasist
# Version: 1.11
# Date: 9-December-2009
#------------------------------------------------------------------------------
# Version History:
#
#   1.0 - First released version
#   1.1 - Added code to make battle scene use the transitions
#   1.11 - Transitions are used when switching maps, fixed some bugs
#------------------------------------------------------------------------------
# Description:
#
#     This script adds some exotic transitions which can't be attained by
#   regular transition graphics.
#------------------------------------------------------------------------------
# Compatibility:
#
#     This script replaces Scene_Map#transfer_player method.
#==============================================================================
# Instructions:
#
#     This script NEEDS "screenshot.dll"! Place it in the game folder.
#     Place this script below Scene_Debug and above Main. To use this, instead
#   of calling a scene directly like this:
#
#           $scene = Scene_Something.new
#
#   call it like this:
#
#           $scene = Transition.new(Scene_Something.new)
#
#     Before calling it, you can change "$game_temp.transition_type" to
#   activate the transiton.
#
#     As of version 1.11 and above, the battle, menu, name, shop and save scenes
#   automatically use the predefined transition effects, so all you have to do
#   is call the scenes using the event command.
#
#     You can also call a certain effect like this:
#
#           Transition.new(NEXT_SCENE, EFFECT_TYPE, EFFECT_TYPE_ARGUMENTS)
#
#
#   Here is the list of transitions (as of version 1.11):
#
#    -1 - Uses the default effect (in most cases, simple transition)
#     0 - Zoom In
#     1 - Zoom Out
#     2 - Shred Horizontal
#     3 - Shred Vertical
#     4 - Fade
#     5 - Explode
#     6 - Explode (Chaos Project Style)
#     7 - Transpose (by Blizzard)
#     8 - Shutter
#     9 - Drop Off
#
#   For Scripters:
#
#     For adding new transitions, check the method Transition#call_effect.
#   Simply add a new case for "type" and add your method. Don't forget to
#   add the *args version, it makes it easier to pass arguments when calling
#   transitions. Check out the call_effect method for reference.
#------------------------------------------------------------------------------
# Configuration:
#
#     Scroll down a bit and you'll see the configuration.
#
#   BATTLE_EFFECT: Effect to be used for calling battles
#   SHOP_EFFECT: Effect to be used for calling the Shop scene
#   NAME_EFFECT: Effect to be used for calling the Name scene
#   MENU_EFFECT: Effect to be used for calling the Menu scene
#   SAVE_EFFECT: Effect to be used for calling the Save scene
#
#   - Set to any number (-1 to 9) to use the respective effect.
#   - Set to "nil" to use the effect defined in "$game_temp.transition_type".
#   - Use an array to use any random effect. For example, setting BATTLE_EFFECT
#     to [1, 3, 6, 8, 9] will use any of those effects each time the battle
#     scene is called.
#
#   Explosion_Sound: Filename of the SE for Explosion transitions
#       Clink_Sound: Filename of the SE for Drop Off transition
#------------------------------------------------------------------------------
# Issues:
#
#     None that I know of.
#------------------------------------------------------------------------------
# Credits and Thanks:
#
#   Fantasist, for making this script
#   Blizzard, for the Transpose effect
#   shdwlink1993, for keeping the demo for so long
#   Ryexander, for helping me with an important scripting aspect
#   Memor-X, for pointing out some bugs
#------------------------------------------------------------------------------
# Notes:
#
#     If you have any problems, suggestions or comments, you can find me at:
#
#  - forum.chaos-project.com
#
#   Enjoy ^_^
#==============================================================================

#==============================================================================
# ** Screen Module
#------------------------------------------------------------------------------
#  This module handles taking screenshots for the transitions.
#==============================================================================
module Screen
 
 @screen = Win32API.new 'screenshot.dll', 'Screenshot', %w(l l l l p l l), ''
 @readini = Win32API.new 'kernel32', 'GetPrivateProfileStringA', %w(p p p p l p), 'l'
 @findwindow = Win32API.new 'user32', 'FindWindowA', %w(p p), 'l'
 #--------------------------------------------------------------------------
 # * Snap (take screenshot)
 #--------------------------------------------------------------------------
 def self.snap(file_name='scrn_tmp', file_type=0)
   game_name = "\0" * 256
   @readini.call('Game', 'Title', '', game_name, 255, '.\Game.ini')
   game_name.delete!('\0')
   window = @findwindow.call('RGSS Player', game_name)
   @screen.call(0, 0, 640, 480, file_name, window, file_type)
 end
end

#==============================================================================
# ** Transition
#------------------------------------------------------------------------------
#  This scene handles transition effects while switching to another scene.
#==============================================================================
class Transition
 
 #::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::
 # * CONFIG BEGIN
 #::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::
 BATTLE_EFFECT = [7, 8, 9] # randomly choose from any of those
 SHOP_EFFECT = 0
 NAME_EFFECT = nil # uses default effect set in $game_temp.transition_type
 MENU_EFFECT = 2
 SAVE_EFFECT = -1 # disable effect/use default
 
 
 Explosion_Sound = nil
     Clink_Sound = nil
 #::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::
 # * CONFIG END
 #::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::
 
 #--------------------------------------------------------------------------
 # * Call Effect
 #     type : Transition type
 #     args : Arguments for specified transition type
 #--------------------------------------------------------------------------
 def call_effect(type, args)
   # if "type" is an array, choose a random element.
   if type.is_a?(Array)
     type = type[rand(type.size)]
   end
   # Call appropriate method with or without arguments depending
   # on values of type and args.
   no_args = args.nil? || args == []
   if no_args
     case type
     when 0 then zoom_in
     when 1 then zoom_out
     when 2 then shred_h
     when 3 then shred_v
     when 4 then fade
     when 5 then explode
     when 6 then explode_cp
     when 7 then transpose
     when 8 then shutter
     when 9 then drop_off
     end
   else
     case type
     when 0 then zoom_in(*args)
     when 1 then zoom_out(*args)
     when 2 then shred_h(*args)
     when 3 then shred_v(*args)
     when 4 then fade(*args)
     when 5 then explode(*args)
     when 6 then explode_cp(*args)
     when 7 then transpose(*args)
     when 8 then shutter(*args)
     when 9 then drop_off(*args)
     end
   end
 end
 #--------------------------------------------------------------------------
 # * Initialize
 #     next_scene : Instance of the scene to transition into
 #           type : Transition type
 #          *args : Arguments for specified transition type
 #--------------------------------------------------------------------------
 def initialize(next_scene=Scene_Menu.new, type=nil, *args)
   @next_scene = next_scene
   @args = args
   # If transition type is specified, use it.
   # Otherwise, use default.
   @type = type.nil? ? $game_temp.transition_type : type
 end
 #--------------------------------------------------------------------------
 # * Main
 #--------------------------------------------------------------------------
 def main
   if @type == -1
     $scene = @next_scene
     return
   end
   # Take screenshot and prepare sprite
   path = ENV['appdata'] + "\\scrn_tmp"
   Screen.snap(path)
   @sprite = Sprite.new
   @sprite.bitmap = Bitmap.new(path)
   @sprite.x = @sprite.ox = @sprite.bitmap.width / 2
   @sprite.y = @sprite.oy = @sprite.bitmap.height / 2
   # Activate effect
   Graphics.transition(0)
   call_effect(@type, @args)
   # Freeze screen and clean up and switch scene
   Graphics.freeze
   @sprite.bitmap.dispose unless @sprite.bitmap.nil?
   @sprite.dispose unless @sprite.nil?
   File.delete(path)
   $scene = @next_scene
 end
 #--------------------------------------------------------------------------
 # * Play SE
 #     filename : Filename of the SE file in Audio/SE folder
 #        pitch : Pitch of sound (50 - 100)
 #       volume : Volume of sound (0 - 100)
 #--------------------------------------------------------------------------
 def play_se(filename, pitch=nil, volume=nil)
   se = RPG::AudioFile.new(filename)
   se.pitch  = pitch unless pitch.nil?
   se.volume = volume unless volume.nil?
   Audio.se_play('Audio/SE/' + se.name, se.volume, se.pitch)
 end
 
 #==========================================================================
 #::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::
 # ** Effect Library
 #::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::
 #==========================================================================
 
 #--------------------------------------------------------------------------
 # * Zoom In
 #     frames : Effect duration in frames
 #   max_zoom : The max amount the screen zooms out
 #--------------------------------------------------------------------------
 def zoom_in(frames=20, max_zoom=12)
   # Calculate difference b/w current and target
   # zooms (1 and max_zoom)
   zoom_diff = max_zoom - 1
   # Calculate unit values
   unit_zoom = zoom_diff.to_f / frames
   unit_opacity = (255.0 / frames).ceil
   # Apply unit values to sprite
   frames.times do
     @sprite.zoom_x += unit_zoom
     @sprite.zoom_y += unit_zoom
     @sprite.opacity -= unit_opacity
     Graphics.update
   end
 end
 #--------------------------------------------------------------------------
 # * Zoom Out
 #     frames : Effect duration in frames
 #--------------------------------------------------------------------------
 def zoom_out(frames=20)
   # Calculate unit values
   unit_zoom = 1.0 / frames
   unit_opacity = (255.0 / frames).ceil
   # Apply unit values to sprite
   frames.times do
     @sprite.zoom_x -= unit_zoom
     @sprite.zoom_y -= unit_zoom
     @sprite.opacity -= unit_opacity
     Graphics.update
   end
 end
 #--------------------------------------------------------------------------
 # * Shred Horizontal
 #      thickness : Shred thickness
 #       slowness : How slow the screens move out
 #    start_speed : Speed of first step in pixels
 #--------------------------------------------------------------------------
 def shred_h(thickness=4, slowness=4, start_speed=8)
   t = thickness
   # Shred screen
   sprite2 = Sprite.new
   sprite2.bitmap = Bitmap.new(@sprite.bitmap.width, @sprite.bitmap.height)
   sprite2.x = sprite2.ox = sprite2.bitmap.width / 2
   sprite2.y = sprite2.oy = sprite2.bitmap.height / 2
   for i in 0..(480/t)
     sprite2.bitmap.blt(0, i*t*2, @sprite.bitmap, Rect.new(0, i*t*2, 640, t))
     @sprite.bitmap.fill_rect(0, i*t*2, 640, t, Color.new(0, 0, 0, 0))
   end
   # Make sure starting step is not zero
   start_speed = slowness if start_speed < slowness
   # Move sprites
   dist = 640 - @sprite.x + start_speed
   loop do
     x_diff = (dist - (640 - @sprite.x)) / slowness
     @sprite.x += x_diff
     sprite2.x -= x_diff
     Graphics.update
     break if @sprite.x >= 640 + 320
   end
   sprite2.bitmap.dispose
   sprite2.dispose
 end
 #--------------------------------------------------------------------------
 # * Shred Vertical
 #      thickness : Shred thickness
 #       slowness : How slow the screens move out
 #    start_speed : Speed of first step in pixels
 #--------------------------------------------------------------------------
 def shred_v(thickness=4, slowness=4, start_speed=8)
   t = thickness
   # Shred screen
   sprite2 = Sprite.new
   sprite2.bitmap = Bitmap.new(@sprite.bitmap.width, @sprite.bitmap.height)
   sprite2.x = sprite2.ox = sprite2.bitmap.width / 2
   sprite2.y = sprite2.oy = sprite2.bitmap.height / 2
   # Shred bitmap
   for i in 0..(640/t)
     sprite2.bitmap.blt(i*t*2, 0, @sprite.bitmap, Rect.new(i*t*2, 0, t, 480))
     @sprite.bitmap.fill_rect(i*t*2, 0, t, 480, Color.new(0, 0, 0, 0))
   end
   # Make sure starting step is not zero
   start_speed = slowness if start_speed < slowness
   # Move sprites
   dist = 480 - @sprite.y + start_speed
   loop do
     y_diff = (dist - (480 - @sprite.y)) / slowness
     @sprite.y += y_diff
     sprite2.y -= y_diff
     Graphics.update
     break if @sprite.y >= 480 + 240
   end
   sprite2.bitmap.dispose
   sprite2.dispose
 end
 #--------------------------------------------------------------------------
 # * Fade
 #     target_color : Color to fade to
 #           frames : Effect duration in frames
 #--------------------------------------------------------------------------
 def fade(target_color=Color.new(255, 255, 255), frames=10)
   loop do
     r = (@sprite.color.red   * (frames - 1) + target_color.red)   / frames
     g = (@sprite.color.green * (frames - 1) + target_color.green) / frames
     b = (@sprite.color.blue  * (frames - 1) + target_color.blue)  / frames
     a = (@sprite.color.alpha * (frames - 1) + target_color.alpha) / frames
     @sprite.color.red   = r
     @sprite.color.green = g
     @sprite.color.blue  = b
     @sprite.color.alpha = a
     frames -= 1
     Graphics.update
     break if frames <= 0
   end
   Graphics.freeze
 end
 #--------------------------------------------------------------------------
 # * Explode
 #     explosion_sound : The SE filename to use for explosion sound
 #--------------------------------------------------------------------------
 def explode(explosion_sound=Explosion_Sound)
   shake_count = 2
   shakes = 40
   tone = 0
   shakes.times do
     @sprite.ox = 320 + (rand(2) == 0 ? -1 : 1) * shake_count
     @sprite.oy = 240 + (rand(2) == 0 ? -1 : 1) * shake_count
     shake_count += 0.2
     tone += 128/shakes
     @sprite.tone.set(tone, tone, tone)
     Graphics.update
   end
   @sprite.ox, @sprite.oy = 320, 240
   Graphics.update
   bitmap = @sprite.bitmap.clone
   @sprite.bitmap.dispose
   @sprite.dispose
   # Slice bitmap and create nodes (sprite parts)
   hor = []
   20.times do |i|
     ver = []
     15.times do |j|
       # Set node properties
       s = Sprite.new
       s.ox, s.oy = 8 + rand(25), 8 + rand(25)
       s.x, s.y = s.ox + 32 * i, s.oy + 32 * j
       s.bitmap = Bitmap.new(32, 32)
       s.bitmap.blt(0, 0, bitmap, Rect.new(i * 32, j * 32, 32, 32))
       s.tone.set(128, 128, 128)
       # Set node physics
       angle  = (rand(2) == 0 ? -1 : 1) * (4 + rand(4) * 10)
       zoom_x = (rand(2) == 0 ? -1 : 1) * (rand(2) + 1).to_f / 100
       zoom_y = (rand(2) == 0 ? -1 : 1) * (rand(2) + 1).to_f / 100
       (zoom_x > zoom_y) ? (zoom_y = -zoom_x) : (zoom_x = -zoom_y)
       x_rand = (2 + rand(2) == 0 ? -2 : 2)
       y_rand = (1 + rand(2) == 0 ? -1 : 1)
       # Store node and it's physics
       ver.push([s, angle, zoom_x, zoom_y, x_rand, y_rand])
     end
     hor.push(ver)
   end
   bitmap.dispose
   # Play sound
   play_se(explosion_sound) if explosion_sound != nil
   # Move pics
   40.times do |k|
     hor.each_with_index do |ver, i|
       ver.each_with_index do |data, j|
         # Get node and it's physics
         s, angle, zoom_x, zoom_y = data[0], data[1], data[2], data[3]
         x_rand, y_rand = data[4], data[5]
         # Manipulate nodes
         s.x += (i - 10) * x_rand
         s.y += (j - 8) * y_rand + (k - 20)/2
         s.zoom_x += zoom_x
         s.zoom_y += zoom_y
         tone = s.tone.red - 8
         s.tone.set(tone, tone, tone)
         s.opacity -= 13 if k > 19
         s.angle += angle % 360
       end
     end
     Graphics.update
   end
   # Dispose
   for ver in hor
     for data in ver
       data[0].bitmap.dispose
       data[0].dispose
     end
   end
   hor = nil
 end
 #--------------------------------------------------------------------------
 # * Explode (Chaos Project Style)
 #     explosion_sound : The SE filename to use for explosion sound
 #--------------------------------------------------------------------------
 def explode_cp(explosion_sound=Explosion_Sound)
   bitmap = @sprite.bitmap.clone
   @sprite.bitmap.dispose
   @sprite.dispose
   # Slice bitmap and create nodes (sprite parts)
   hor = []
   20.times do |i|
     ver = []
     15.times do |j|
       # Set node properties
       s = Sprite.new
       s.ox = s.oy = 16
       s.x, s.y = s.ox + 32 * i, s.oy + 32 * j
       s.bitmap = Bitmap.new(32, 32)
       s.bitmap.blt(0, 0, bitmap, Rect.new(i * 32, j * 32, 32, 32))
       # Set node physics
       angle  = (rand(2) == 0 ? -1 : 1) * rand(8)
       zoom_x = (rand(2) == 0 ? -1 : 1) * (rand(2) + 1).to_f / 100
       zoom_y = (rand(2) == 0 ? -1 : 1) * (rand(2) + 1).to_f / 100
       # Store node and it's physics
       ver.push([s, angle, zoom_x, zoom_y])
     end
     hor.push(ver)
   end
   bitmap.dispose
   # Play sound
   play_se(explosion_sound) if explosion_sound != nil
   # Move pics
   40.times do |k|
     hor.each_with_index do |ver, i|
       ver.each_with_index do |data, j|
         # Get node and it's physics
         s, angle, zoom_x, zoom_y = data[0], data[1], data[2], data[3]
         # Manipulate node
         s.x += i - 9
         s.y += j - 8 + k
         s.zoom_x += zoom_x
         s.zoom_y += zoom_y
         s.angle += angle % 360
       end
     end
     Graphics.update
   end
   # Dispose
   for ver in hor
     for data in ver
       data[0].bitmap.dispose
       data[0].dispose
     end
   end
   hor = nil
 end
 #--------------------------------------------------------------------------
 # * Transpose (bt Blizzard)
 #     frames : Effect duration in frames
 #   max_zoom : The max amount the screen zooms out
 #      times : Number of times screen is zoomed (times * 3 / 2)
 #--------------------------------------------------------------------------
 def transpose(frames=80, max_zoom=12, times=3)
   max_zoom -= 1 # difference b/w zooms
   max_zoom = max_zoom.to_f / frames / times # unit zoom
   unit_opacity = (255.0 / frames).ceil
   spr_opacity = (255.0 * times / 2 / frames).ceil
   @sprites = []
   (times * 3 / 2).times {
     s = Sprite.new
     s.x, s.y, s.ox, s.oy = 320, 240, 320, 240
     s.bitmap = @sprite.bitmap
     s.blend_type = 1
     s.opacity = 128
     s.visible = false
     @sprites.push(s)}
   count = 0
   loop {
       @sprites[count].visible = true
       count += 1 if count < times * 3 / 2 - 1
       (frames / times / 2).times {
           @sprites.each {|s|
               break if !s.visible
               s.zoom_x += max_zoom
               s.zoom_y += max_zoom
               s.opacity -= spr_opacity}
           @sprite.opacity -= unit_opacity
       Graphics.update}
       break if @sprite.opacity == 0}
   @sprites.each {|s| s.dispose}
 end
 #--------------------------------------------------------------------------
 # * Shutter
 #       open_gap : How much the shutters open before moving away
 #       flip_dir : Whether or not the direction of shutters if reversed
 #       slowness : How slow the screens move out
 #    start_speed : Speed of first step in pixels
 #--------------------------------------------------------------------------
 def shutter(flip_dir=true, open_gap=16, slowness=4, start_speed=8)
   # Shred screen
   sprite2 = Sprite.new
   sprite2.bitmap = Bitmap.new(@sprite.bitmap.width, @sprite.bitmap.height)
   sprite2.x = sprite2.ox = sprite2.bitmap.width / 2
   sprite2.y = sprite2.oy = sprite2.bitmap.height / 2
   if flip_dir
     ver_step = 1
     sprite2.bitmap.blt(0, 240, @sprite.bitmap, Rect.new(0, 240, 640, 240))
     @sprite.bitmap.fill_rect(0, 240, 640, 240, Color.new(0, 0, 0, 0))
   else
     ver_step = -1
     sprite2.bitmap.blt(0, 0, @sprite.bitmap, Rect.new(0, 0, 640, 240))
     @sprite.bitmap.fill_rect(0, 0, 640, 240, Color.new(0, 0, 0, 0))
   end
   # Move the shutters apart
   open_gap.times do
     @sprite.y -= ver_step
     sprite2.y += ver_step
     Graphics.update
   end
   # Make sure starting step is not zero
   start_speed = slowness if start_speed < slowness
   # Move sprites
   dist = 640 - @sprite.x + start_speed
   loop do
     x_diff = (dist - (640 - @sprite.x)) / slowness
     @sprite.x += x_diff
     sprite2.x -= x_diff
     Graphics.update
     break if @sprite.x >= 640 + 320
   end
   sprite2.bitmap.dispose
   sprite2.dispose
 end
 #--------------------------------------------------------------------------
 # * Drop Off
 #     clink_sound : The SE filename to use for clinking sound
 #--------------------------------------------------------------------------
 def drop_off(clink_sound=Clink_Sound)
   bitmap = @sprite.bitmap.clone
   @sprite.bitmap.dispose
   @sprite.dispose
   # Slice bitmap and create nodes (sprite parts)
   max_time = 0
   hor = []
   10.times do |i|
     ver = []
     8.times do |j|
       # Set node properties
       s = Sprite.new
       s.ox = rand(32)
       s.oy = 0
       s.x = s.ox + 64 * i
       s.y = s.oy + 64 * j
       s.bitmap = Bitmap.new(64, 64)
       s.bitmap.blt(0, 0, bitmap, Rect.new(i * 64, j * 64, 64, 64))
       # Set node physics
       angle = rand(4) * 2
       angle *= rand(2) == 0 ? -1 : 1
       start_time = rand(30)
       max_time = start_time if max_time < start_time
       # Store node and it's physics
       ver.push([s, angle, start_time])
     end
     hor.push(ver)
   end
   bitmap.dispose
   # Play sound
   play_se(clink_sound) if clink_sound != nil
   # Move pics
   (40 + max_time).times do |k|
     hor.each_with_index do |ver, i|
       ver.each_with_index do |data, j|
         # Get node and it's physics
         s, angle, start_time = data[0], data[1], data[2]
         # Manipulate node
         if k > start_time
           tone = s.tone.red - 6
           s.tone.set(tone, tone, tone)
           s.y += k - start_time
           s.angle += angle % 360
         elsif k == start_time
           tone = 128
           s.tone.set(tone, tone, tone)
           $game_system.se_play(Clink_Sound) if clink_sound != nil
         end
       end
     end
     Graphics.update
   end
   # Dispose
   for ver in hor
     for data in ver
       data[0].bitmap.dispose
       data[0].dispose
     end
   end
   hor = nil
 end
end
#==============================================================================
# ** Game_Temp
#------------------------------------------------------------------------------
#  Added transition_type attribute which controls transition shown.
#==============================================================================
class Game_Temp  
 attr_accessor :transition_type  
 #--------------------------------------------------------------------------
 # * Object Initialization
 #--------------------------------------------------------------------------
 alias transpack_game_temp_init initialize
 def initialize
   @transition_type = 0
   transpack_game_temp_init
 end
end
#==============================================================================
# ** Scene_Map
#------------------------------------------------------------------------------
#  Scene_Map modded to use the transition effect when battle begins.
#==============================================================================
class Scene_Map
 #--------------------------------------------------------------------------
 # * Battle Call
 #--------------------------------------------------------------------------
 alias transpack_call_battle call_battle
 def call_battle
   transpack_call_battle
   $scene = Transition.new($scene, Transition::BATTLE_EFFECT)
 end
 #--------------------------------------------------------------------------
 # * Shop Call
 #--------------------------------------------------------------------------
 alias transpack_call_shop call_shop
 def call_shop
   transpack_call_shop
   $scene = Transition.new($scene, Transition::SHOP_EFFECT)
 end
 #--------------------------------------------------------------------------
 # * Name Input Call
 #--------------------------------------------------------------------------
 alias transpack_call_name call_name
 def call_name
   transpack_call_name
   $scene = Transition.new($scene, Transition::NAME_EFFECT)
 end
 #--------------------------------------------------------------------------
 # * Menu Call
 #--------------------------------------------------------------------------
 alias transpack_call_menu call_menu
 def call_menu
   transpack_call_menu
   $scene = Transition.new($scene, Transition::MENU_EFFECT)
 end
 #--------------------------------------------------------------------------
 # * Save Call
 #--------------------------------------------------------------------------
 alias transpack_call_save call_save
 def call_save
   transpack_call_save
   $scene = Transition.new($scene, Transition::SAVE_EFFECT)
 end
 #--------------------------------------------------------------------------
 # * Player Place Move
 #--------------------------------------------------------------------------
 def transfer_player
   # Clear player place move call flag
   $game_temp.player_transferring = false
   # If move destination is different than current map
   if $game_map.map_id != $game_temp.player_new_map_id
     # Set up a new map
     $game_map.setup($game_temp.player_new_map_id)
   end
   # Set up player position
   $game_player.moveto($game_temp.player_new_x, $game_temp.player_new_y)
   # Set player direction
   case $game_temp.player_new_direction
   when 2  # down
     $game_player.turn_down
   when 4  # left
     $game_player.turn_left
   when 6  # right
     $game_player.turn_right
   when 8  # up
     $game_player.turn_up
   end
   # Straighten player position
   $game_player.straighten
   # Update map (run parallel process event)
   $game_map.update
   # Remake sprite set
   @spriteset.dispose
   @spriteset = Spriteset_Map.new
   # If processing transition
   if $game_temp.transition_processing
     # Clear transition processing flag
     $game_temp.transition_processing = false
     # Execute transition
     $scene = Transition.new($scene)
   end
   # Run automatic change for BGM and BGS set on the map
   $game_map.autoplay
   # Frame reset
   Graphics.frame_reset
   # Update input information
   Input.update
 end
end



Instructions

First of all, you will need the screenshot dll. You will find it in the demo. Put it in your game folder.

To use this, instead of calling a scene directly like this:
$scene = Scene_Something.new


call it like this:
$scene = Transition.new(Scene_Something.new)


Before calling it, you can change "$game_temp.transition_type" to activate the transition.

As of version 1.11 and above, the battle, menu, name, shop and save scenes automatically use the predefined transition effects, so all you have to do is call the scenes using the event command.

Optionally, you can also call a certain effect like this:
Transition.new(NEXT_SCENE, EFFECT_TYPE, EFFECT_TYPE_ARGUMENTS)


                  NEXT_SCENE: An instance of the next scene (eg: Scene_Battle.new)
                 EFFECT_TYPE: (Optional) Number indicating the effect type (eg: 4)
EFFECT_TYPE_ARGUMENTS: (Optional) Arguments for the called effect type (eg: Color.new(255, 0, 0))

For example, the following code will call the menu scene with the Fade effect with green color and the effect lasts for 20 frames (nearly half a second):
$scene = Transition.new(Scene_Menu.new, 4, Color.new(0, 255, 0), 20)


More detailed instructions are found in the script header.

For Scripters:

    For adding new transitions, check the method Transition#call_effect. Simply add a new case for "type" and add your method. Don't forget to add the *args version, it makes it easier to pass arguments when calling transitions. Check out the call_effect method for reference.


Compatibility

This script replaces Scene_Map#transfer_player method.


Credits and Thanks


  • Fantasist, for making this script
  • Blizzard, for the Transpose effect
  • shdwlink1993, for keeping the demo for so long
  • Ryexander, for helping me with an important scripting aspect
  • Memor-X, for pointing out some bugs



Author's Notes

If you have any problems, suggestions or comments, you can find me at:

- forum.chaos-project.com

Enjoy ^_^
Do you like ambient/electronic music? Then you should promote a talented artist! Help out here. (I'm serious. Just listen to his work at least!)


The best of freeware reviews: Gizmo's Freeware Reviews




Starrodkirby86

I'm sorry, I would be very interested in this, but I keep getting an error. It's a font error, and it probably can be corrected with the RGSSwhatever dll or something, but I don't know...The font error is when

Screw this, I tinkered with the scripts and then pressed OK (With no effect) and everything works again. 0_0 Lame Enterbrain.

Fantasist, those transitions are sexy, especially the title screen one. I've been listening to too much Reversing Darts by cuevox recently, which is giving me a techno vibe. Possibly you can do something pixel-related that isn't a mosaic or dissolve effect? And if you have Windows Movie Maker, those transitions you can try implementing in RPG Maker. The more, the merrier! :)

What's osu!? It's a rhythm game. Thought I should have a signature with a working rank. ;P It's now clickable!
Still Aqua's biggest fan (Or am I?).




Fantasist

Mosaic... It's impossible to do in RMXP without lag, so I've decided to skip that one. Dissolve can be done by using a transition graphic. You mentioned Movie Maker, nice, I almost forgot. I've set my target on the powerpoint transitions, though most of them can be done in the regular way by making use of transition graphics. You can find 4 files in the Graphics/Transitions folder and you'll recognize the 'random blinds vertical/horizontal' from powerpoint. Many others need scripting, but are very easy to do. I've just been busy with other stuff.
I picked the shred effect from Pokemon Sapphire, I really liked it. That's what inspired me to complete this.
Do you like ambient/electronic music? Then you should promote a talented artist! Help out here. (I'm serious. Just listen to his work at least!)


The best of freeware reviews: Gizmo's Freeware Reviews




Starrodkirby86

Oh yeah, Pokemon battles have some of the best transitions ever...Especially the crazy Pokeballs, battle split screens, and the flashing screen of doom. Emulating those would be pure awesomeness (Especially the split screen, I know many people would want something along those lines). All of those aforementioned can be easily done with pictures though, but a simple call script mechanism to launch these is even easier than having a lot of pictures moving back and forth.

Maybe you can try having rotated effects toward the blinds? Or make something trippy and drug-like?

What's osu!? It's a rhythm game. Thought I should have a signature with a working rank. ;P It's now clickable!
Still Aqua's biggest fan (Or am I?).




Fantasist

Split screen as in the screen splitting in half and the parts moving away? That's easy to script.

QuoteMaybe you can try having rotated effects toward the blinds? Or make something trippy and drug-like?

I didn't get you :p

Btw, try to think about this, how many effects will people use? I've tried it, and having all those 'special' effects gets annoying. These can be used once in a while or for some special events (like boss battles in CP). That's the reason I've made this topic instead of just making all the transition effects whether graphical or scriptwise.
Do you like ambient/electronic music? Then you should promote a talented artist! Help out here. (I'm serious. Just listen to his work at least!)


The best of freeware reviews: Gizmo's Freeware Reviews




Starrodkirby86

http://youtube.com/watch?v=Rcwj_5NxDAo
This split screen.
---
I have no idea what I'm saying too Fanta...except maybe I was leading on to something from the rotating blinds which gave me the impression of drug-like fantasies. Ask mumerus what's it like.
---
You can't like change effect every teleport map, but the more transitions you have, the more a player can choose to use for their game. They can choose a small list of it and it's cool, while another player can choose a different combination as of which. All of them can be used in a cleverly nice boss battle, maybe transitions can prove to be annoyances or a boss battle's specialty...Hehe.

What's osu!? It's a rhythm game. Thought I should have a signature with a working rank. ;P It's now clickable!
Still Aqua's biggest fan (Or am I?).




Blizzard

July 24, 2008, 10:50:39 pm #6 Last Edit: July 24, 2008, 10:52:32 pm by Blizzard
Very nice. Lemme give you another one for the collection. :naughty:

Spoiler: ShowHide
  def transpose(frames=80, max_zoom=12, times=4)
    max_zoom -= 1 # difference b/w zooms
    max_zoom = max_zoom.to_f / frames / times # unit zoom
    unit_opacity = (255.0 / frames).ceil
    spr_opacity = (255.0 * times / 2 / frames).ceil
    @sprites = []
    (times * 3 / 2).times {
        s = Sprite.new
        s.x, s.y, s.ox, s.oy = 320, 240, 320, 240
        s.bitmap = @sprite.bitmap
        s.blend_type = 1
        s.opacity = 128
        s.visible = false
        @sprites.push(s)}
    count = 0
    loop {
        @sprites[count].visible = true
        count += 1 if count < times * 3 / 2 - 1
        (frames / times / 2).times {
            @sprites.each {|s|
                break if !s.visible
                s.zoom_x += max_zoom
                s.zoom_y += max_zoom
                s.opacity -= spr_opacity}
            @sprite.opacity -= unit_opacity
        Graphics.update}
        break if @sprite.opacity == 0}
    @sprites.each {|s| s.dispose}
  end
Check out Daygames and our games:

King of Booze 2      King of Booze: Never Ever
Drinking Game for Android      Never have I ever for Android
Drinking Game for iOS      Never have I ever for iOS


Quote from: winkioI do not speak to bricks, either as individuals or in wall form.

Quote from: Barney StinsonWhen I get sad, I stop being sad and be awesome instead. True story.

Fantasist

July 24, 2008, 11:59:17 pm #7 Last Edit: July 25, 2008, 12:32:54 am by Fantasist
@Bliz: Awesome! Now that's what I'm talking about people!
@Star: Okay, in the context of RGSS, I'll only be worrying about the part where the screen whites and blacks out. From there, the battle scene is responsible. It can be coded, so I'll try.
Do you like ambient/electronic music? Then you should promote a talented artist! Help out here. (I'm serious. Just listen to his work at least!)


The best of freeware reviews: Gizmo's Freeware Reviews




Berans

I doubt this is even seriously possible, but a "roll-up" fade would be nice.
where one of the screen edges rolls up onto the rest of the screen, leaving black behind, until the whole thing is offscreen

Blizzard

July 25, 2008, 06:23:39 am #9 Last Edit: July 26, 2008, 06:07:32 am by Blizzard
That's not possible without heavy lag.
Check out Daygames and our games:

King of Booze 2      King of Booze: Never Ever
Drinking Game for Android      Never have I ever for Android
Drinking Game for iOS      Never have I ever for iOS


Quote from: winkioI do not speak to bricks, either as individuals or in wall form.

Quote from: Barney StinsonWhen I get sad, I stop being sad and be awesome instead. True story.

Berans


Blizzard

But an effect where you don't see the rolled up edges wouldn't be a problem. =X
Check out Daygames and our games:

King of Booze 2      King of Booze: Never Ever
Drinking Game for Android      Never have I ever for Android
Drinking Game for iOS      Never have I ever for iOS


Quote from: winkioI do not speak to bricks, either as individuals or in wall form.

Quote from: Barney StinsonWhen I get sad, I stop being sad and be awesome instead. True story.

Ryex

you should make one where the screen cracks and then falls apart!
I no longer keep up with posts in the forum very well. If you have a question or comment, about my work, or in general I welcome PM's. if you make a post in one of my threads and I don't reply with in a day or two feel free to PM me and point it out to me.<br /><br />DropBox, the best free file syncing service there is.<br />

Blizzard

Generating the cracks before that transition is time consuming. That's why I haven't used it in my game but instead I use the squares. -_-
Check out Daygames and our games:

King of Booze 2      King of Booze: Never Ever
Drinking Game for Android      Never have I ever for Android
Drinking Game for iOS      Never have I ever for iOS


Quote from: winkioI do not speak to bricks, either as individuals or in wall form.

Quote from: Barney StinsonWhen I get sad, I stop being sad and be awesome instead. True story.

GAX

lol, the Final Fantasy Battle Transition...atleast I know X and X-2 use the screen cracking one and then the pieces bursting out like Blizzard's squares.

It's some crazy shit really, but yeah, it looks like it'd be very time consuming to make that.

Rule 2: ShowHide
Quote from: Rule No.2Keep your signatures at reasonable size. The pictures in your signature may altogether be no more than 200kB and take up an area of 1600px2. That means 2 pictures of 400x200 are fine, one picture of 800x200 is fine and so on. Also your pictures height must not exceed 200 pixels, width can be as big as you want as long as your pictures match the other criteria. Every signature not matching this criteria is a subject of the moderator team to remove and leave this rule as message in your signature.

Blizzard

No, not time consuming to make it, it would consume a lot of time to generate the images. RMXP will always freeze for a moment before that transition can be made.
Check out Daygames and our games:

King of Booze 2      King of Booze: Never Ever
Drinking Game for Android      Never have I ever for Android
Drinking Game for iOS      Never have I ever for iOS


Quote from: winkioI do not speak to bricks, either as individuals or in wall form.

Quote from: Barney StinsonWhen I get sad, I stop being sad and be awesome instead. True story.

Fantasist

Today is Saturday and we're having a party, so I'll post the script on Sunday (tomorrow) or the next Saturday.
Do you like ambient/electronic music? Then you should promote a talented artist! Help out here. (I'm serious. Just listen to his work at least!)


The best of freeware reviews: Gizmo's Freeware Reviews




GAX


Rule 2: ShowHide
Quote from: Rule No.2Keep your signatures at reasonable size. The pictures in your signature may altogether be no more than 200kB and take up an area of 1600px2. That means 2 pictures of 400x200 are fine, one picture of 800x200 is fine and so on. Also your pictures height must not exceed 200 pixels, width can be as big as you want as long as your pictures match the other criteria. Every signature not matching this criteria is a subject of the moderator team to remove and leave this rule as message in your signature.

Blizzard

August 08, 2008, 05:42:00 pm #18 Last Edit: August 08, 2008, 05:43:14 pm by Blizzard
Quote from: Fantasist on July 24, 2008, 12:45:52 pm
So this is a transition pack script I'm making. It has about 7 effects for now. I haven't posted the script yet because I still need to improve the code a bit, and I need more ideas for effects. The current effects are:

1. Zoom In
2. Zoom Out
3. Shred Horizontal
4. Shred Vertical
5. Fade to color
6. Explode (My version)
7. Explode (CP Version)
8. Transpose (by Blizzard)
9. Pokemon Battle Transition 1 (one of the GBA games)

Legend:

Newly added, not in the demo
Considered, not yet added (might not be added)

Here's the demo:
http://www.sendspace.com/file/6sq1li

The project is not encrypted, but there's no point in using the code just yet, it's kind of messy.

So point of this topic is to gather more ideas for transition effects. Someone must have some specific request or some interesting ideas. Remember, I don't guarantee anything, but just give mesome ideas.

I'll wait for 2 days and if I don't get many requests, I'll close this topic and work on trimming the script for posting. So request away :)


:D

If you want transpose, just add a new conditional branch, add the call for my method and add the code for my method (posted above) into that script.
Check out Daygames and our games:

King of Booze 2      King of Booze: Never Ever
Drinking Game for Android      Never have I ever for Android
Drinking Game for iOS      Never have I ever for iOS


Quote from: winkioI do not speak to bricks, either as individuals or in wall form.

Quote from: Barney StinsonWhen I get sad, I stop being sad and be awesome instead. True story.

Fantasist

August 08, 2008, 05:43:04 pm #19 Last Edit: August 08, 2008, 05:44:56 pm by Fantasist
In the first post :p
lol!
I haven't really changed much, so there's no point in uploading it again.

EDIT: They removed the file... I guess I'll have to speed up the process and come up with a proper submission by this Sunday >.<
Do you like ambient/electronic music? Then you should promote a talented artist! Help out here. (I'm serious. Just listen to his work at least!)


The best of freeware reviews: Gizmo's Freeware Reviews




GAX


Rule 2: ShowHide
Quote from: Rule No.2Keep your signatures at reasonable size. The pictures in your signature may altogether be no more than 200kB and take up an area of 1600px2. That means 2 pictures of 400x200 are fine, one picture of 800x200 is fine and so on. Also your pictures height must not exceed 200 pixels, width can be as big as you want as long as your pictures match the other criteria. Every signature not matching this criteria is a subject of the moderator team to remove and leave this rule as message in your signature.

Blizzard

Quote from: Blizzard on August 08, 2008, 05:42:00 pm
Quote from: Fantasist on July 24, 2008, 12:45:52 pm
So this is a transition pack script I'm making. It has about 7 effects for now. I haven't posted the script yet because I still need to improve the code a bit, and I need more ideas for effects. The current effects are:

1. Zoom In
2. Zoom Out
3. Shred Horizontal
4. Shred Vertical
5. Fade to color
6. Explode (My version)
7. Explode (CP Version)
8. Transpose (by Blizzard)
9. Pokemon Battle Transition 1 (one of the GBA games)

Legend:

Newly added, not in the demo
Considered, not yet added (might not be added)

Here's the demo:
http://www.sendspace.com/file/6sq1li

The project is not encrypted, but there's no point in using the code just yet, it's kind of messy.

So point of this topic is to gather more ideas for transition effects. Someone must have some specific request or some interesting ideas. Remember, I don't guarantee anything, but just give mesome ideas.

I'll wait for 2 days and if I don't get many requests, I'll close this topic and work on trimming the script for posting. So request away :)


:D

If you want transpose, just add a new conditional branch, add the call for my method and add the code for my method (posted above) into that script.
Check out Daygames and our games:

King of Booze 2      King of Booze: Never Ever
Drinking Game for Android      Never have I ever for Android
Drinking Game for iOS      Never have I ever for iOS


Quote from: winkioI do not speak to bricks, either as individuals or in wall form.

Quote from: Barney StinsonWhen I get sad, I stop being sad and be awesome instead. True story.

GAX

SOMOENE POST THE FUCKING DEMO PLEASE!!!

Blizzy, don't repost that same thing because the link's broken >.<

Rule 2: ShowHide
Quote from: Rule No.2Keep your signatures at reasonable size. The pictures in your signature may altogether be no more than 200kB and take up an area of 1600px2. That means 2 pictures of 400x200 are fine, one picture of 800x200 is fine and so on. Also your pictures height must not exceed 200 pixels, width can be as big as you want as long as your pictures match the other criteria. Every signature not matching this criteria is a subject of the moderator team to remove and leave this rule as message in your signature.

Blizzard

August 31, 2008, 06:54:16 pm #23 Last Edit: September 01, 2008, 05:45:24 am by Blizzard
It really is. O.o; I'll see if I have it on my HDD somewhere.

EDIT: Sorry, no. ._.

EDIT: LMAO! I DO have the demo still on my HDD! It was on my desktop! xD

http://www.sendspace.com/file/v2bjs4
Check out Daygames and our games:

King of Booze 2      King of Booze: Never Ever
Drinking Game for Android      Never have I ever for Android
Drinking Game for iOS      Never have I ever for iOS


Quote from: winkioI do not speak to bricks, either as individuals or in wall form.

Quote from: Barney StinsonWhen I get sad, I stop being sad and be awesome instead. True story.

GAX

Finally got to play it (yay!) and I already have some things to talk about.

First, what'd be nice is if you could clasify transitions.  I think an easy one would be this:  Separate transtions as Battle Transitions, Map Transitions, Title Transitions, Game Over Transitions, Open Menu Transitions, Continue Transitions, and called transitions (using a script call to make it so the next transition is replaced with a selected transition, useful for boss battles).

The transitions are good, but I think people might only see a game as flashy if the screen explodes just from transfering maps.  Plus, using a transition to open the just the menu looks a bit too flashy, most games just have a momentary lag or a the screen darkens a bit and the menu pops up.

The explodes are great, but in all honesty need a bit of work.  An explode should cause the squares to fall down revealing the battle screen, not a black screen and a basic transition.

The other transitions are all pretty good, I'd probably use them if I had more control over when a transition is active or inactive.

Rule 2: ShowHide
Quote from: Rule No.2Keep your signatures at reasonable size. The pictures in your signature may altogether be no more than 200kB and take up an area of 1600px2. That means 2 pictures of 400x200 are fine, one picture of 800x200 is fine and so on. Also your pictures height must not exceed 200 pixels, width can be as big as you want as long as your pictures match the other criteria. Every signature not matching this criteria is a subject of the moderator team to remove and leave this rule as message in your signature.

Fantasist

Shit -_- I got unlucky again, what's it with me and internet?! @GAX: This demo is just the beginning, I havent even started working on it full time. Classifying the tranbsitions as you mention is going to cause a LOT of compatibility problems (or so I think right now). Anyway, I'm really sporry I left without warning, I couldn't do anything to help. I'll get this done, don't worry.
Do you like ambient/electronic music? Then you should promote a talented artist! Help out here. (I'm serious. Just listen to his work at least!)


The best of freeware reviews: Gizmo's Freeware Reviews




G_G

could someone upload this again?

I've wanted to try it for awhile but the links are broken.

Calintz

This is awesome Fantasist!!

Can you make the screen dissolve from the middle out in different shapes??
And vice-versa for more add-ons.

Fantasist

Holy crap, I have a lot of work to do... I'll get this up and running in 12 hours.

@Calintz: I think you can do that with transition pics, right?
Do you like ambient/electronic music? Then you should promote a talented artist! Help out here. (I'm serious. Just listen to his work at least!)


The best of freeware reviews: Gizmo's Freeware Reviews




Calintz

Perhaps, but I honestly don't like using the pictures, because they don't move right...

Fantasist

Hey, does anyone have the file, mine is lost somewhere deep in one of my backups -_-
Do you like ambient/electronic music? Then you should promote a talented artist! Help out here. (I'm serious. Just listen to his work at least!)


The best of freeware reviews: Gizmo's Freeware Reviews




Blizzard

Check out Daygames and our games:

King of Booze 2      King of Booze: Never Ever
Drinking Game for Android      Never have I ever for Android
Drinking Game for iOS      Never have I ever for iOS


Quote from: winkioI do not speak to bricks, either as individuals or in wall form.

Quote from: Barney StinsonWhen I get sad, I stop being sad and be awesome instead. True story.

Fantasist

I'll have to make it again I guess... ._. my DVD ROM is busted :'(
Do you like ambient/electronic music? Then you should promote a talented artist! Help out here. (I'm serious. Just listen to his work at least!)


The best of freeware reviews: Gizmo's Freeware Reviews




shdwlink1993

Stuff I've made:




"Never think you're perfect or else you'll stop improving yourself."

"Some people say the glass is half full... some half empty... I just wanna know who's been drinking my beer."

Calintz


Tazero

I always like a scene where it kind of shatters like glass or like in the legend of dragoon transition a sand effect


If you were a fish...

Calintz


G_G


Fantasist

Do you like ambient/electronic music? Then you should promote a talented artist! Help out here. (I'm serious. Just listen to his work at least!)


The best of freeware reviews: Gizmo's Freeware Reviews




G_G

wow fantasist this is really neat. I downloaded it and the wierd thing is I didnt try it until like 3 minutes ago. Here's the funny thing, I downloaded it and a few seconds later I forgot what I was doing so I assumed I was working on my game.

Then I saw the file extracted it and tested it out. Its really cool

Calintz

February 14, 2009, 08:14:46 pm #40 Last Edit: February 14, 2009, 08:37:19 pm by Calintz16438
I think I'm gonna have to test this right now...

EDIT
I will download the file that shdwlink uploaded, but could you please fix the link in your 1st post Fantasist!?  :^_^':

**What syntax allows the user to change the transition style from the script command in the event editor??
**This does not work for me!! =(

Blizzard

Does the demo still have my "transpose" transition?
Check out Daygames and our games:

King of Booze 2      King of Booze: Never Ever
Drinking Game for Android      Never have I ever for Android
Drinking Game for iOS      Never have I ever for iOS


Quote from: winkioI do not speak to bricks, either as individuals or in wall form.

Quote from: Barney StinsonWhen I get sad, I stop being sad and be awesome instead. True story.

Fantasist

July 05, 2009, 03:20:19 pm #42 Last Edit: July 06, 2009, 06:18:09 pm by Fantasist
@Cal: I oughta be hanged :cry:
@Blizz: I just checked, it's still there.

Updated the link in 1st post (and the post itself).

EDIT: Updated again, with new demo. Scripters out there, I need some help. Please read the first post if you're willing to help:

Quote
effect_parameters (optional, experimental): If you specified effect_type, you can additionally pass parameters for that particular effect. For details about each effect, check it's documentation in the script. Note that this feature is not fully functional. I want this feature and I will not consider this script complete without it. I am having trouble getting it right so if you can help, I'll be thankful.
Do you like ambient/electronic music? Then you should promote a talented artist! Help out here. (I'm serious. Just listen to his work at least!)


The best of freeware reviews: Gizmo's Freeware Reviews




Ryex

what would happen if you had then store the parameters in an array like
$scene = Transition.new(Scene_Map.new, 1, [20, 12])
then when calling the effect method
insted of this

# Call method with or without arguments depend
# on value of args.
args ? method(args) : method

do this?

case args.size
when 0 #? I forgot what happens when you use size on a empty array so
 method
when 1
 method(args[0])
when 2
 method(args[0], args[1])
when 3
 method(args[0], args[1], args[2])
# ect.
end


I don't know what you mean by you can't get it to work right but this should to the best of my knowledge call methods with the right parameters.
I no longer keep up with posts in the forum very well. If you have a question or comment, about my work, or in general I welcome PM's. if you make a post in one of my threads and I don't reply with in a day or two feel free to PM me and point it out to me.<br /><br />DropBox, the best free file syncing service there is.<br />

Fantasist

Actually, if I use arrays, there's no need even for that. All I need is to pass one array of arguments and check the array size inside the method (just like Blizz aliased Bitmap#initialize in ultimate font override). But then, that defines a rule for passing parameters for all the methods that will be made over time by me or other scripters. I'm trying to make it so that we can pass the arguments in a natural way.
Of course, this is just an idea and I don't know much about the subject. If it's more trouble than it's worth or if it's a performance hog, then I'll just modify the methods to handle array arguments.
Do you like ambient/electronic music? Then you should promote a talented artist! Help out here. (I'm serious. Just listen to his work at least!)


The best of freeware reviews: Gizmo's Freeware Reviews




Ryex

July 08, 2009, 01:52:16 pm #45 Last Edit: July 08, 2009, 02:24:48 pm by Ryexander
personally I would  just use array and get it working the way you want to. then when you find out more about how to do it you can get it to pass them correctly.

EDIT I GOT IT WORKING THE WAY YOU WANT!


def call_effect(type, args)
    # Get method to call depending on transition
    # type specified.
    a = args.nil?
    unless a
      case type
      when 0 then zoom_in(*args)
      when 1 then zoom_out(*args)
      when 2 then shred_h(*args)
      when 3 then shred_v(*args)
      when 4 then fade(*args)
      when 5 then explode
      when 6 then explode_cp
      when 7 then transpose(*args)
      end
    else
      case type
      when 0 then zoom_in
      when 1 then zoom_out
      when 2 then shred_h
      when 3 then shred_v
      when 4 then fade
      when 5 then explode
      when 6 then explode_cp
      when 7 then transpose
      end
    end
    # Call method with or without arguments depend
    # on value of args.
  end


yes the
a = args.nil?
    unless a
is necessary other wise you get a type error
and you need to do
*args when putting it in to call something
*args is all the arguments separated
args is an array with all the arguments
that method works I've tested it
I no longer keep up with posts in the forum very well. If you have a question or comment, about my work, or in general I welcome PM's. if you make a post in one of my threads and I don't reply with in a day or two feel free to PM me and point it out to me.<br /><br />DropBox, the best free file syncing service there is.<br />

Fantasist

July 09, 2009, 10:50:07 am #46 Last Edit: July 09, 2009, 10:56:58 am by Fantasist
I think that is what I did, but instead of using the case statement for all the methods, I stored the method in a variable:


    # Get method to call depending on transition
    # type specified.
    method = case type
    when 0 then zoom_in
    when 1 then zoom_out
    when 2 then shred_h
    when 3 then shred_v
    when 4 then fade
    when 5 then explode
    when 6 then explode_cp
    when 7 then transpose
    end
    # Call method with or without arguments depend
    # on value of args.
    args ? method(*args) : method


That's what I did in the demo I posted. It works when calling transitions without arguments, but if you DO use arguments, it gives an arguments. For example, when I called Zoom In with the "frames" argument:
$scene = Transition.new(Scene_Map.new, 1, 15)


it gives an argument error at the line:
args ? method(*args) : method


saying "15 is not a symbol". Now what's that supposed to mean?

Also, what exactly have you tested? When I tested it, calling effects normally doesn't cause a problem but calling them with type and arguments causes an error.

PS: New effect "Shutter" added (not in demo).
Do you like ambient/electronic music? Then you should promote a talented artist! Help out here. (I'm serious. Just listen to his work at least!)


The best of freeware reviews: Gizmo's Freeware Reviews




Ryex

July 09, 2009, 01:01:17 pm #47 Last Edit: July 09, 2009, 01:02:58 pm by Ryexander
Quote from: Fantasist on July 09, 2009, 10:50:07 am
I think that is what I did, but instead of using the case statement for all the methods, I stored the method in a variable:


   # Get method to call depending on transition
   # type specified.
   method = case type
   when 0 then zoom_in
   when 1 then zoom_out
   when 2 then shred_h
   when 3 then shred_v
   when 4 then fade
   when 5 then explode
   when 6 then explode_cp
   when 7 then transpose
   end
   # Call method with or without arguments depend
   # on value of args.
   args ? method(*args) : method


That's what I did in the demo I posted. It works when calling transitions without arguments, but if you DO use arguments, it gives an arguments. For example, when I called Zoom In with the "frames" argument:
$scene = Transition.new(Scene_Map.new, 1, 15)


it gives an argument error at the line:
args ? method(*args) : method


saying "15 is not a symbol". Now what's that supposed to mean?

Also, what exactly have you tested? When I tested it, calling effects normally doesn't cause a problem but calling them with type and arguments causes an error.

PS: New effect "Shutter" added (not in demo).

Fant that IS the problem! when you tried to store the effect method in 'method' it didn't work. all you were getting is what the method RETURNS which in every case is nil (or for some reason it was returning the arguments of the zoom_in method)! and is ran the method so you were seeing the effect, yes but it was not being run at the time you thought it was. but some p 'hello' commands befor the line
args ? method(args) : method

(also note that the line in the demo is method(args) NOT method(*args))
and you will see that the effect is displayed BEFORE the print command
also you can't use args directly in a if statement you will get a type error (I don't know exactly what this means).
if args.nil?
will get a type error if you use extra arguments
a = args.nil?
if a
for some strange reason will not
also when doing
args ? method(*args) : method

you are testing args for TRUE by default and when it was nil (because you didn't use and extra arguments) it returns false and you didn't notice it doing anything (because method is NOT a effect method) and when args is not nil you get a type error before you get to the error at method(*args) whis WOULD return an error.


the code I posted WORKS you and call ANY of the effects with extra arguments you modify the default values  I TESTED it at least TRY it before telling me it is not going to work, what you doing is NEVER going to work, who CARES if the method is longes by 10 lines it WORKS ans INTENDED!

just TRY it ok?

PS: the zoom_in and zoom_out effects are backwards in the demo zoom_in zooms out and vice versa.
I no longer keep up with posts in the forum very well. If you have a question or comment, about my work, or in general I welcome PM's. if you make a post in one of my threads and I don't reply with in a day or two feel free to PM me and point it out to me.<br /><br />DropBox, the best free file syncing service there is.<br />

Fantasist

July 09, 2009, 01:18:54 pm #48 Last Edit: July 09, 2009, 01:24:48 pm by Fantasist
QuoteFant that IS the problem! when you tried to store the effect method in 'method' it didn't work. all you were getting is what the method RETURNS which in every case is nil (or for some reason it was returning the arguments of the zoom_in method)! and is ran the method so you were seeing the effect, yes but it was not being run at the time you thought it was. but some p 'hello' commands befor the line


Checked that already and strangely enough, the methods are running when they should.

Quote(also note that the line in the demo is method(args) NOT method(*args))
and you will see that the effect is displayed BEFORE the print command
also you can't use args directly in a if statement you will get a type error (I don't know exactly what this means).
if args.nil?
will get a type error if you use extra arguments
a = args.nil?
if a
for some strange reason will not


I've tested both args and *args and I'm sure that's not the problem here. I used * args only twice. While getting the arguments from Transition.new, and when passing them to the effect method. args holds the array, *args holds the contents of the array, that's how I understand it and it seems to work fine so far.
And the effect executed AFTER the print, I checked.
About using args directly, I doubt that's much of a problem, but I noticed something else. This is what I currently use:

no_args = args.nil? || args == []
no_args ? method : method(*args)


It made no difference (regarding using args directly in an if clause). But here, I'm also checking for an empty array as I got it once.

Quote
the code I posted WORKS you and call ANY of the effects with extra arguments you modify the default values  I TESTED it at least TRY it before telling me it is not going to work, what you doing is NEVER going to work, who CARES if the method is longes by 10 lines it WORKS ans INTENDED!

just TRY it ok?

PS: the zoom_in and zoom_out effects are backwards in the demo zoom_in zooms out and vice versa.


You know, why didn't I try this earlier? Sorry about it, really. I'll try it and get back to you. btw, thanks for the help Ryex :)


EDIT: You're right, it works! Let's see what I'll do next...
Do you like ambient/electronic music? Then you should promote a talented artist! Help out here. (I'm serious. Just listen to his work at least!)


The best of freeware reviews: Gizmo's Freeware Reviews




Ryex

well do do need *args otherwise you passing an array and ONE argument with *args you passing the contents of the array as an arguments
and not the methods were NOT executing when they should the were exacuting in the case statement I did a LOT of tests to make sure of that.
the code I posted works try it and find out.
I no longer keep up with posts in the forum very well. If you have a question or comment, about my work, or in general I welcome PM's. if you make a post in one of my threads and I don't reply with in a day or two feel free to PM me and point it out to me.<br /><br />DropBox, the best free file syncing service there is.<br />

Fantasist

QuoteEDIT: You're right, it works! Let's see what I'll do next...

:)
Do you like ambient/electronic music? Then you should promote a talented artist! Help out here. (I'm serious. Just listen to his work at least!)


The best of freeware reviews: Gizmo's Freeware Reviews




Ryex

July 09, 2009, 01:32:53 pm #51 Last Edit: July 09, 2009, 02:58:03 pm by Ryexander
 :)
now you can consider it finished and get it into the database by applying the template! :D
I no longer keep up with posts in the forum very well. If you have a question or comment, about my work, or in general I welcome PM's. if you make a post in one of my threads and I don't reply with in a day or two feel free to PM me and point it out to me.<br /><br />DropBox, the best free file syncing service there is.<br />

Fantasist

July 09, 2009, 01:38:58 pm #52 Last Edit: July 12, 2009, 11:21:53 am by Fantasist
Yeah... I think I will, after adding a couple more effects (I have some more nice ideas :D). Thanks for the help Ryex, consider yourself in the credits.

EDIT: Finally! This is no longer WIP, v1.0 is released, yay :D
Do you like ambient/electronic music? Then you should promote a talented artist! Help out here. (I'm serious. Just listen to his work at least!)


The best of freeware reviews: Gizmo's Freeware Reviews




winkio

Schwing  ;)

Awesome script, Fantasist

Fantasist

Ah, DB'd by our ever vigilant mods, thanks winkio :)
Do you like ambient/electronic music? Then you should promote a talented artist! Help out here. (I'm serious. Just listen to his work at least!)


The best of freeware reviews: Gizmo's Freeware Reviews




Holyrapid


Fantasist

Do you like ambient/electronic music? Then you should promote a talented artist! Help out here. (I'm serious. Just listen to his work at least!)


The best of freeware reviews: Gizmo's Freeware Reviews




Kirye

Alright, i'm pretty noob at this, but hopefully it's something small that i'm just not seeing.

I've been trying to use the transition effects to come in when an important battle starts (Ala Chaos Project). But so far, everytime I do it, it goes back to the map screen in full color, then has the original battle transition.

I tried using this:
$scene = Transition.new(Scene_Map.new, 
7, Color.new(-255, -255, -255) 50)


But it keeps having a Syntax Error.

I also tried to throw in a Change Screen Color Tone to black before the transition, but it doesn't really work the way i'd hope.

I hope I made some sense.

Spoiler: ShowHide

Aqua

Using Scene_Map.new makes it go back to the map; you need it to go to the battle.

You missed a , after the Color.new(), and the color arguments only range from 0-255

Kirye

July 21, 2009, 10:46:44 pm #59 Last Edit: July 21, 2009, 10:50:15 pm by Kirye
I kinda made it work for me, but as for going into Scene_Battle, it always gets an error on my part.

And yeah, I saw the mistake on the Color.New part. ><

If I use Scene_Battle, it crashes after the transition. But if I remove the Wait 1 frame, then it goes into the battle and doesn't have the transition effect.

Spoiler: ShowHide

Fantasist

Post the exact script command you've used. Also, are you using any custom battle scripts?
Do you like ambient/electronic music? Then you should promote a talented artist! Help out here. (I'm serious. Just listen to his work at least!)


The best of freeware reviews: Gizmo's Freeware Reviews




Kirye

Screen Flash @1
Change Screen Color Tone @5
And then the script is:
$game_temp.transition_type = 5
$scene = Transition.new(Scene_Map.new)


I'm using the RTAB and Nortos' Side View battle system.

Spoiler: ShowHide

Fantasist

Try using this:


$game_temp.transition_type = 5
$scene = Transition.new(Scene_Battle.new)
Do you like ambient/electronic music? Then you should promote a talented artist! Help out here. (I'm serious. Just listen to his work at least!)


The best of freeware reviews: Gizmo's Freeware Reviews




Kirye

Sorry for the late reply, I've been at Comic con. XD

That's the first code I tried, but it goes straight into the battle without showing the transition.

Spoiler: ShowHide

Fantasist

You mean you've used Transition.new(Scene_Battle.new)? Also, you don't have to call the battle scene through events again. If the problem still persists, could you send me your Scripts.rxdata? And preferably a map with the event you're using to call the battle.
Do you like ambient/electronic music? Then you should promote a talented artist! Help out here. (I'm serious. Just listen to his work at least!)


The best of freeware reviews: Gizmo's Freeware Reviews




Kirye

Yes, I used Scene_Battle.new, but it crashes when the battle begins if I use Wait 1 frame between the Battle process and the script. The transition will not show at all and will go straight into the battle if Wait 1 frame is not used.

Either way I found a working alternative, so thanks regardless for putting the time in to respond. :D

Spoiler: ShowHide

Fantasist

Well, good for you then :)
But I'm still curious... Oh well.
Do you like ambient/electronic music? Then you should promote a talented artist! Help out here. (I'm serious. Just listen to his work at least!)


The best of freeware reviews: Gizmo's Freeware Reviews




Cid

I'm a bit confused as to how this all works. This is what I have in the call script command:

$game_temp.transition_type = 9
$scene = Transition.new(Scene_Battle.new)


But all that does is show the transition then produce an error. Am I supposed to be specifying which enemy group to call somewhere? Using "Enemy Encounter" just starts the battle with the default transition.

Fantasist

OK, one thing you need to understand about this script is... now follow very closely... it will effect the transition of the scene exiting, not the scene entering next. So the transition is displayed when exiting from the map, not when starting the battle. Of course, those who have played Chaos Project will know that the map changes directly to the battle without any blank screen. That can be done by modifying the battle scene, and I can't even alias the methods (meaning the script won't be plug-and-play).

PS: Maybe I should include this in the first post... nah, I'll do it later.
Do you like ambient/electronic music? Then you should promote a talented artist! Help out here. (I'm serious. Just listen to his work at least!)


The best of freeware reviews: Gizmo's Freeware Reviews




Cid

August 20, 2009, 06:13:04 pm #69 Last Edit: August 20, 2009, 06:14:51 pm by Cid
Okay, so how exactly am I supposed to set it up? The transitions can still be used to "start" a battle, right?

Fantasist

Start a battle... I didn't get you there.

1. The current scene transitions into a black screen, then the battle transition starts with it's regular animation.
2. The current scene directly transitions into the battle scene.

Do you mean case 2? If you want that, you will have to edit your scripts a bit.

PS: btw,

QuoteBut all that does is show the transition then produce an error. Am I supposed to be specifying which enemy group to call somewhere? Using "Enemy Encounter" just starts the battle with the default transition.


What was that error?
Do you like ambient/electronic music? Then you should promote a talented artist! Help out here. (I'm serious. Just listen to his work at least!)


The best of freeware reviews: Gizmo's Freeware Reviews




Cid

Well ideally I'd like it to be case 2, but that depends on how difficult it would be to mod the scripts. I'm alright with having a black screen between the transition and battle start if that's the only viable option.

Script 'Game_Troop' line 30: NoMethodError occurred.
undefined method `members' for nil:NilClass


That's the error I get. I'm also testing it in a blank project with no additional scripts.

Blizzard

The calling method was probably executed before the game data in the title was loaded.
Check out Daygames and our games:

King of Booze 2      King of Booze: Never Ever
Drinking Game for Android      Never have I ever for Android
Drinking Game for iOS      Never have I ever for iOS


Quote from: winkioI do not speak to bricks, either as individuals or in wall form.

Quote from: Barney StinsonWhen I get sad, I stop being sad and be awesome instead. True story.

Fantasist

Well, it turns out that the problem was Scene_Battle being called before the battle stuff was initialized. Anyway, I updated the script and the demo. Thanks for pointing it out guys :)
Do you like ambient/electronic music? Then you should promote a talented artist! Help out here. (I'm serious. Just listen to his work at least!)


The best of freeware reviews: Gizmo's Freeware Reviews




Memor-X

and to think i was just about to ask how to get it to work for battle transistions, i love how the Transpose trasition can be customized by chaning the value at the top of the code for it, it was kinda slow for my taste, got it to be a lot fater and longer, just wondering though, the demo has you using the transition on the same map but how would you get it to work between maps

Fantasist

...good question Memor. I'll look into it.
Do you like ambient/electronic music? Then you should promote a talented artist! Help out here. (I'm serious. Just listen to his work at least!)


The best of freeware reviews: Gizmo's Freeware Reviews




Memor-X

i found a bug, i'm not surprised no one's found it cause it only appears when you encrypt the game files file when you make the game disk, when you got to do a transition, it can't find the screenshot file because the Data folder doesn't exist, i fixed it by making an empty folder called data but i think i know why the error was coming up, the screenshot is being made in the Data folder which becomes encrypted and you can't write to it any more unless you create another folder called Data.....i think you know what i am on about Fantasist, best course of action is to probably chnage the location of the screenshot file to the root directory

also, just to make a note to anyone who wants to burn their game to a CD and play it off from there, you can't if your using this script cause you can't write files to a CD without burning it all the time and in that cause, you need a Rewritable CD/DVD and to change this script to burn and erase the screenshot file every time it's made, i don't expect Fantasist to fix his script to do that cause if anyone on the forum thinks that's a good way to make your game run on a CD, then you obviously don't know why games install then

jasprelao

Wow, this is a great script,
Nice and I want to use it in my game.

By the way,
When I try to do in this sort of commands:

1. Transition
2. Transfer Map

The result will be:Transfer Map Executed First and then the Transition Executed after I've been transferred to other map.
Could you help me for this problem?

Thanks...

MikePjr

Could i make a request for a transition?
I was thinking, a zoom effect much like Final Fantasy 4 for the SNES, where it basically starts to zoom in a little, but then zoomz back out quickly for a sec then zooms all the way in... it's usually done on the overworld map. i'm trying to find a video... but i can't.. so if you have played FF4 on the super nintendo you know what i am talking about.
I was gonna suggest a transition like in caves and such to, but as said before, mosaic would not work too well.
So seeing as their is a zoom already, you could figure out how to do such an affect.

Ryex

Fant is retired from RMXP and we haven't seen him in quite a while. you won't get your request filled here.
I no longer keep up with posts in the forum very well. If you have a question or comment, about my work, or in general I welcome PM's. if you make a post in one of my threads and I don't reply with in a day or two feel free to PM me and point it out to me.<br /><br />DropBox, the best free file syncing service there is.<br />

ForeverZer0

I made a few transitions for this but never bothered posting them. I think I made something like that....
I'll look. If not, it can likely be made in under 5 minutes.
I am done scripting for RMXP. I will likely not offer support for even my own scripts anymore, but feel free to ask on the forum, there are plenty of other talented scripters that can help you.

MikePjr

Awesome!
I stink at scripting.
Does anyone think it would be alright to re-post this script else where?..
It's an awesome script, very useful.

ForeverZer0

Not sure, you would have to ask Fantasist, and as stated above, he is MIA.
I am done scripting for RMXP. I will likely not offer support for even my own scripts anymore, but feel free to ask on the forum, there are plenty of other talented scripters that can help you.

MikePjr

I suppose if he is given full credit it should be alright.
If hes gone, i doubt he would be too upset, plus i looked through the script, i don't see anything about it being not to be re-posted anywhere else..
And if i re-post it in more places, we could end up with more transitions ^_^

Fantasist

December 09, 2010, 07:28:43 am #84 Last Edit: December 09, 2010, 08:07:03 am by Fantasist
OK. Time to update this script and fix the bugs. Coming in the next update v1.11 :

- Ability to use transitions when switching maps.
- Fixed the encrypted RGSSAD issue.
- Battle, Shop, Save, Menu and Name scenes use effects when called using event commands. Each effect can be preset.
- Ability to use random effects.

EDIT: Updated :D
Do you like ambient/electronic music? Then you should promote a talented artist! Help out here. (I'm serious. Just listen to his work at least!)


The best of freeware reviews: Gizmo's Freeware Reviews




Sacred Nym

Quote from: Fantasist on December 09, 2010, 07:28:43 am
OK. Time to update this script and fix the bugs. Coming in the next update v1.11 :

- Ability to use transitions when switching maps.
- Fixed the encrypted RGSSAD issue.
- Battle, Shop, Save, Menu and Name scenes use effects when called using event commands. Each effect can be preset.
- Ability to use random effects.

EDIT: Updated :D


Sweet! Except I'm getting an an error.

Line 216
Undefined method or local variable 'path'

Happens whenever I do anything that would call a transition.
Quote昨日の自分に「さようなら」
Say "Goodbye" to who you were yesterday.

Fantasist

December 11, 2010, 06:23:25 am #86 Last Edit: December 11, 2010, 06:57:28 am by Fantasist
Ah, stupid mistake >.<
I deleted the actual lines of code instead of deleting the debug code (p path). Will update in a few minutes with the fixed version and a more descriptive demo.

EDIT: Fixed script and demo.
Do you like ambient/electronic music? Then you should promote a talented artist! Help out here. (I'm serious. Just listen to his work at least!)


The best of freeware reviews: Gizmo's Freeware Reviews




Sacred Nym

Now it's working great! Level up!
Quote昨日の自分に「さようなら」
Say "Goodbye" to who you were yesterday.

daggeris

Hi. after long time i back to RpgMakerXp. i find this awesome script. But when i edit something in script, after transition effect automatically open menu.

$scene = Transition.new(Scene_Map.new)
$game_temp.transition_type += 1
$game_temp.transition_type %= 10

How fix it? I use RPGXP 1.04
Script work correct only , when i copy from demo. If i enter manually, after effect open menu.
Sorry for my English.

KK20

April 02, 2018, 03:50:03 pm #89 Last Edit: April 02, 2018, 03:53:21 pm by KK20
As the script instructions say, you use the command
$scene = Transition.new(Scene_Something.new)

The problem though is that the script box is too small to fit some Scene classes all on one line. So you saw this:

$scene = Transition.new
(Scene_Map.new)

You should do it like this

$scene = Transition.new(
Scene_Map.new)


FYI, if you fail to put something in the Transition.new, it defaults to Scene_Menu, as seen in the code itself:

  #--------------------------------------------------------------------------
  # * Initialize
  #     next_scene : Instance of the scene to transition into
  #           type : Transition type
  #          *args : Arguments for specified transition type
  #--------------------------------------------------------------------------
  def initialize(next_scene=Scene_Menu.new, type=nil, *args)
    @next_scene = next_scene
    @args = args
    # If transition type is specified, use it.
    # Otherwise, use default.
    @type = type.nil? ? $game_temp.transition_type : type
  end





   


   
   


   
   

Other Projects
RPG Maker XP AceUpgrade RMXP to RMVXA performance!
XPA TilemapTilemap rewrite with many features, including custom resolution!



Nintendo Switch Friend Code: 8310-1917-5318
Discord: KK20 Tyler#8901

Join the CP Discord Server!