Transition When Teleporting
#1
Transition When Teleporting
By Ánemus
Aug 29 2008

This is a locked, single-post thread from Creation Asylum. Archived here to prevent its loss.
No support is given. If you are the owner of the thread, please contact administration.


Introduction
We all know how to make a transition within the same map. And if you don't it's time you learn. Prepare transition, change whatever you like, execute transition. But... I wantet to find a way I could make transitions within maps. The scritpt came along easily. This is the second version, and basically its manipulated from the Teleport part (except the indication of the transition file).

Code

Code:
#Transition System When changin the map
This is something you should try out. 10 is minimum, indicates that the trasnition wil be sharp
and 120 is the maximum and indicates that the transition is kind of blurry.
AMBIGUITY =40
class Interpreter
# ------------------------------------
  def command_201
    if $game_temp.player_transferring or
       $game_temp.message_window_showing or
       $game_temp.transition_processing
      return false
    end
    $game_temp.player_transferring = true
    if @parameters[0] == 0
      $game_temp.player_new_map_id = @parameters[1]
      $game_temp.player_new_x = @parameters[2]
      $game_temp.player_new_y = @parameters[3]
      $game_temp.player_new_direction = @parameters[4]
    else
      $game_temp.player_new_map_id = $game_variables[@parameters[1]]
      $game_temp.player_new_x = $game_variables[@parameters[2]]
      $game_temp.player_new_y = $game_variables[@parameters[3]]
      $game_temp.player_new_direction = @parameters[4]
    end
    @index += 1
    $game_temp.transition_processing = false
    if @parameters[5] == 0
      $mnm = true
      $game_temp.transition_processing = true
    end
    return false
  end
end

class Scene_Map
  def transfer_player
    hide(3)
    $game_temp.player_transferring = false
    if $game_map.map_id != $game_temp.player_new_map_id
      $game_map.setup($game_temp.player_new_map_id)
    end
    $game_player.moveto($game_temp.player_new_x, $game_temp.player_new_y)
    case $game_temp.player_new_direction
    when 2
      $game_player.turn_down
    when 4
      $game_player.turn_left
    when 6
      $game_player.turn_right
    when 8
      $game_player.turn_up
    end
    $game_player.straighten
    $game_map.update
    if $trans == nil
      $trans = ""
    end
    if $trans == ""
      if $game_temp.transition_processing
        Graphics.freeze
        @a.visible = false
        @spriteset.dispose
        Graphics.transition(20)
        Graphics.freeze
        @spriteset = Spriteset_Map.new
        @a.visible = true
        Graphics.transition(20)
      else
        Graphics.freeze
        @spriteset.dispose
        @spriteset = Spriteset_Map.new
        Graphics.transition(1)
      end
    else
      @trans2 = $trans
      if FileTest.exist?("Graphics/Transitions/"+@trans2+"-.png")
        @trans2 += "-"
      end
      @trans2 = $secondtrans if $secondtrans != nil
      $secondtrans = nil
      if $game_temp.transition_processing
        Graphics.freeze
        @a.visible = false
        @spriteset.dispose
        Graphics.transition(10, "Graphics/Transitions/"+$trans, AMBIGUITY)
        Graphics.freeze
        @a.visible = true
        @spriteset = Spriteset_Map.new
        Graphics.transition(10, "Graphics/Transitions/"+@trans2, AMBIGUITY)
      else
        Graphics.freeze
        @spriteset.dispose
        @spriteset = Spriteset_Map.new
        Graphics.transition(20, "Graphics/Transitions/"+$trans, AMBIGUITY)
      end
    end
    $trans = ""
    $game_temp.transition_processing = false
    $game_map.autoplay if !$blockmusic
    Graphics.frame_reset
    Input.update
  end
end

Instructions
Ok, before calling the teleport, put Call Script, and in it set any of this:

Option 1: Use a single transition file.
Code:
$trans = "file"


where file is the transition file in the Transitions folder. If we put, for example, "Transition1" and there is another transition file called "Transition1-", It will execute the first transition to go to black and the second to go back to the next map. Else, it will use the same transition.

NOTE: If you set the teleport parameter Erase (or whatever in the bottom right corner) to no, it wont check for "Transition1-". I'll explain why later.

Option 2: Using two transition files.

Code:
$trans = "file1"
$secondtrans = "file2"


In this system it wont' matter if file1- exists, the going from black to map will be made with file2.

Note: if you set the Ease thingy in NO, it wont use the second transition.

Now you can call Teleport. In the bottom right of the teleport window (I guess) there is a box that says Erase, yes, no, that is if the map should go to black before going to the second map (in the default script). It works the same with my script. If you want to go to black before going to the other map, say yes (the effect is cooler) and then the second transition will be aplyed. Else, if you set it to no, it will do only the first transition that directly "transicts" to the next map. Try it out, is easier to understand that way.
}




Users browsing this thread: 2 Guest(s)