Jump to content
krikke93

Fade type when transfering player

Recommended Posts

Hello once again,

 

I'm having a little issue using a lighting script and a custom script I wrote myself. When I'm transferring maps with my custom script, I want the transfer to be "instant", though this causes my map to show a flash for one frame when it's night.
My solution would be a very short fade when transferring maps. I want the fade to be short, so I'll have to make a new fade_type in the class Game_Temp.

 

I know that when you give the command

$game_temp.fade_type = 1

right before

$game_player.reserve_transfer(...)

the fade will be white

Now I want to be able to use for example fade_type = 3 to make the next reserve_transfer almost instantly.

I have done it before, but I can't seem to find where. I was able to change the fade time to 0 frames. (needs to be like 1 or 2 frames now)

 

Where would I be able to do this?

Share this post


Link to post
Share on other sites

Just search for fade_type and watch where it is used to determine the type.

Share this post


Link to post
Share on other sites

Found it. It was located in Scene_Map under the method pre_transfer and post_transfer though it didn't help me out with my problem.

 

Maybe anyone else had this problem with Victor's Light Effects? When you transfer from one dark map to another dak map there's one frame without light effects (completely bright), ending out in a fast flash at the start of a new map.

I'm hoping someone can help me out here, it's really frustrating me :(

 

edit: I've noticed that when I use fadeout and fadein in an event (teleport) when transferring maps this doesn't occur. The darkness gets to load before the fadein ends, but I really want my transfers to be instant, without any fades :/

Edited by krikke93

Share this post


Link to post
Share on other sites

Did you ever figure this out (the fade type for instance transfer)?

 

I see the same problem with Victor Light Effects that you do.

The trick is to fade out before transfer and fade in after transfer.

Edited by ashes999

Share this post


Link to post
Share on other sites

Oh, I had the problem of one frame of light in Khas Awesome Light Effects too! I replaced all my black fades with a new cool crossfade effect using Graphics.transition (which is used for the battle swirl effect). I fixed it by forcing it to update once before displaying anything. I think it will work with Victor's Light Effects too. You can call update_for_fade once instead of fadein or fadeout for a instant fade that updates the screen right I think.

Edited by KilloZapit

Share this post


Link to post
Share on other sites

Maybe like this?

 

class Scene_Map < Scene_Base

  #--------------------------------------------------------------------------
  # * Post Processing for Transferring Player
  #--------------------------------------------------------------------------
  def post_transfer
    case $game_temp.fade_type
    when 0
      Graphics.wait(fadein_speed / 2)
      fadein(fadein_speed)
    when 1
      Graphics.wait(fadein_speed / 2)
      white_fadein(fadein_speed)
    when 3
      update_for_fade
    end
    @map_name_window.open
  end

end
I am no sure what would work best for you really. Like I said I replaced all of my fades with an entirely different effect that uses Graphics.transition but that isn't what what you asked for. Though if you are curious, try this script:

 

 

 

class Scene_Gameover < Scene_Base
  #--------------------------------------------------------------------------
  # * Start Processing
  #--------------------------------------------------------------------------
  def start
    super
    play_gameover_music
    #fadeout_frozen_graphics
    create_background
  end
  #--------------------------------------------------------------------------
  # * Execute Transition
  #--------------------------------------------------------------------------
  def perform_transition
    Graphics.transition(fadein_speed, "Graphics/System/Fade", 100)
  end
  #--------------------------------------------------------------------------
  # * Fade Out Frozen Graphics
  #--------------------------------------------------------------------------
  def fadeout_frozen_graphics
    Graphics.transition(fadeout_speed, "Graphics/System/Fade", 100)
    Graphics.freeze
  end
  #--------------------------------------------------------------------------
  # * Create Background
  #--------------------------------------------------------------------------
  def create_background
    @sprite = Sprite.new
    @sprite.bitmap = Cache.system("GameOver")
    @sprite.ox = @sprite.bitmap.width / 2
    @sprite.oy = @sprite.bitmap.height / 2
    @sprite.x = Graphics.width / 2
    @sprite.y = Graphics.height / 2
  end
end

class Scene_Base

  def perform_transition
    Graphics.transition(transition_speed * 2, "Graphics/System/Fade", 100)
  end
  
  #--------------------------------------------------------------------------
  # * Fade Out All Sounds and Graphics
  #--------------------------------------------------------------------------
  def fadeout_all(time = 1000)
    RPG::BGM.fade(time)
    RPG::BGS.fade(time)
    RPG::ME.fade(time)
    crossfade_to_black
    RPG::BGM.stop
    RPG::BGS.stop
    RPG::ME.stop
  end
  
  # Do a crossfade to a blank screen
  def crossfade_to_black
    Graphics.freeze
    sprite = Sprite.new
    sprite.bitmap = Bitmap.new(Graphics.width, Graphics.height)
    color = Color.new(0, 0, 0)
    sprite.bitmap.fill_rect(0, 0, Graphics.width, Graphics.height, color) 
    sprite.x = 0
    sprite.y = 0
    sprite.z = 10000
    perform_transition
    Graphics.freeze
    sprite.dispose
  end
  
end

class Scene_Map
  alias_method :perform_transition_fade_base, :perform_transition
  def perform_transition
    update_for_fade
    perform_transition_fade_base
  end
  
  #--------------------------------------------------------------------------
  # * Preprocessing for Transferring Player
  #--------------------------------------------------------------------------
  def pre_transfer
    @map_name_window.close
    case $game_temp.fade_type
    when 0
      crossfade_to_black
    when 1
      white_fadeout(fadeout_speed)
    end
  end
  #--------------------------------------------------------------------------
  # * Post Processing for Transferring Player
  #--------------------------------------------------------------------------
  def post_transfer
    case $game_temp.fade_type
    when 0
      perform_transition
    when 1
      Graphics.wait(fadein_speed / 2)
      white_fadein(fadein_speed)
    end
    @map_name_window.open
  end

end

class Scene_Battle < Scene_Base
  
  def pre_terminate
    super
    if SceneManager.scene_is?(Scene_Map)
      if $game_troop.all_dead?
        crossfade_to_black
      else
        Graphics.fadeout(30)
      end
    elsif SceneManager.scene_is?(Scene_Title)
      Graphics.fadeout(60)
    end
  end
  
end

 

 

You will need some image called Fade.png in your Graphics/System/ folder though. You can probably just copy your BattleStart.png image to it to test. It might actually work better for scripts with light effects, I don't know.

 

Edit: Actually I forgot, the normal cross scene transition uses Graphics.transition too, just with no image. I just give it a image and make brightness fadeouts use crossfades to a black screen instead.

 

Ether way it might not be useful, but maybe some of my code can solve some future problems? I don't know.

Edited by KilloZapit
  • Like 1

Share this post


Link to post
Share on other sites
Guest
This topic is now closed to further replies.

  • Recently Browsing   0 members

    No registered users viewing this page.

×
Top ArrowTop Arrow Highlighted