Envision, Create, Share

Welcome to HBGames, a leading amateur game development forum and Discord server. All are welcome, and amongst our ranks you will find experts in their field from all aspects of video game design and development.

teleport question

i'm using this code in one of my scripts (code was gotten from the FAQ, edited for my use)
Code:
        #Teleport to map
        $game_temp.player_transferring = true
        $game_temp.player_new_map_id = Monster::Maps[@bestiary_left.index]
        $game_temp.player_new_x = Monster::X[@bestiary_left.index]
        $game_temp.player_new_y = Monster::Y[@bestiary_left.index]
        $scene = Scene_Map.new
        $game_map.autoplay
        # Switch to Map screen

That works fine, but how do i make it do the fadeing screen like when you use the transfer player event command?
At the moment its instant
 
Don't sure about this...
Code:
        #Teleport to map
        $game_temp.player_transferring = true
        $game_temp.player_new_map_id = Monster::Maps[@bestiary_left.index]
        $game_temp.player_new_x = Monster::X[@bestiary_left.index]
        $game_temp.player_new_y = Monster::Y[@bestiary_left.index]
        $scene = Scene_Map.new
        $game_map.autoplay
        Graphics.freeze
        Graphics.transition
 
Try this code:
Code:
        #Teleport to map
        $game_temp.player_transferring = true
        $game_temp.player_new_map_id = Monster::Maps[@bestiary_left.index]
        $game_temp.player_new_x = Monster::X[@bestiary_left.index]
        $game_temp.player_new_y = Monster::Y[@bestiary_left.index]
        Graphics.freeze
        $game_temp.transition_processing = true
 
I find that the simplist way to do this (for me at least) is to use an event. The event should look like this:

Change Screen Color Tone: (-255,-255,-255,0)@10
wait: 10 frames
Transfer Player: (location)
Change Screen Color Tone: (0,0,0,0)@20

Change Screen Color Tone is at the bottom of the second event command page. The wait has to be in there otherwise it wont fade out. This is about the only way I know how to do this because i am just learning how to script. ':|The @10 and @20 is the time taken to fade out. If you want the screen to fade through a color other than black, then just change the numbers in the color tone to match the color.(the Change Color Tone option has sliding bars to select color.)
Hope This helps!
 

Thank you for viewing

HBGames is a leading amateur video game development forum and Discord server open to all ability levels. Feel free to have a nosey around!

Discord

Join our growing and active Discord server to discuss all aspects of game making in a relaxed environment. Join Us

Content

  • Our Games
  • Games in Development
  • Emoji by Twemoji.
    Top