Which Ruby Script To Alter For Fading?

So I played Shovel Knight the other day and I love the games
fading. It mimics old NES games. I wan't a fading to show
4 frames of shading to look like an NES game same can be applied to
fading in. Which default script holds the code for the fading in and fading out?
Scene_Map:
Code:
  #--------------------------------------------------------------------------
  # * Fadein Screen
  #--------------------------------------------------------------------------
  def fadein(duration)
    fade_loop(duration) {|v| Graphics.brightness = v }
  end
  #--------------------------------------------------------------------------
  # * Fadeout Screen
  #--------------------------------------------------------------------------
  def fadeout(duration)
    fade_loop(duration) {|v| Graphics.brightness = 255 - v }
  end
  #--------------------------------------------------------------------------
  # * Screen Fade In (White)
  #--------------------------------------------------------------------------
  def white_fadein(duration)
    fade_loop(duration) {|v| @viewport.color.set(255, 255, 255, 255 - v) }
  end
  #--------------------------------------------------------------------------
  # * Screen Fade Out (White)
  #--------------------------------------------------------------------------
  def white_fadeout(duration)
    fade_loop(duration) {|v| @viewport.color.set(255, 255, 255, v) }
  end
Scene_Map:
Code:
  #--------------------------------------------------------------------------
  # * Fadein Screen
  #--------------------------------------------------------------------------
  def fadein(duration)
    fade_loop(duration) {|v| Graphics.brightness = v }
  end
  #--------------------------------------------------------------------------
  # * Fadeout Screen
  #--------------------------------------------------------------------------
  def fadeout(duration)
    fade_loop(duration) {|v| Graphics.brightness = 255 - v }
  end
  #--------------------------------------------------------------------------
  # * Screen Fade In (White)
  #--------------------------------------------------------------------------
  def white_fadein(duration)
    fade_loop(duration) {|v| @viewport.color.set(255, 255, 255, 255 - v) }
  end
  #--------------------------------------------------------------------------
  # * Screen Fade Out (White)
  #--------------------------------------------------------------------------
  def white_fadeout(duration)
    fade_loop(duration) {|v| @viewport.color.set(255, 255, 255, v) }
  end
Thanks so much!!!
By the way could you make me an edit for the fadeout I'am looking for?
And this doesn't work for the transfer command. I wan't something that
works on maps...
Thanks so much!!!
By the way could you make me an edit for the fadeout I'am looking for?
What an annoying way to try and segue into a script request.
The script snippet above is with default RPG Maker projects. Find it in your project and adjust the values there; this isn't something that needs to be added to your game. There's also code below that I think to adjust fadeout/in speed.

In your case you could adjust the fadeout/in speed to 0 frames, and then make 2 common events with tint screens (adjusting darkness and hue) to emulate the screen going darker (fadeouts) and lighter (fadeins) and place them before/after transfers.
The NES fades are color-palette based, so an accurate recreation of it wouldn't work with a simple solution like this.
https://forums.nesdev.com/viewtopic.php?f=2&t=8927
What an annoying way to try and segue into a script request.

Ouch. That was kind of rude. This IS the script request forum.

this isn't something that needs to be added to your game.

I'm sorry but this is such a BS excuse, I'm sick of seeing it on this forum >_>
Minor aesthetic changes can greatly make a game seem more authentic, especially when trying to emulate retro games. I appreciate the request of a more authentic retro screen fade; every little thing counts. Honestly I dislike when retro games try to "look" retro but there are so many technical things that breaks immersion and says, "oh, this is actually just a modern impersonation of a retro game". Smooth fade transitioning would definitely break the immersion for an NES-like game.
Personally, I would use common events, but in OP's new thread he specifies that he's already using a lot of common events and therefore doesn't want to lag the game anymore. Perfectly understandable.

OP, if no one is willing to make a script (which is also understandable; people are doing this out of charity, so they are not obligated) then I do recommend finding out a light-weight way to make a common event; perhaps you can only activate it with a Common Event Call, instead of running it all the time with parallel process. This should make it so that your game won't lag or crash.
Not sure if this helps, but Shaz has a script that does Map Transfer Auto events.
If your transfers are for map transfers, then maybe this script will work for you, but it does require using a common event.
https://forums.rpgmakerweb.com/index.php?threads/map-transfer-auto-events.17401/
retrofade2.gif

Something like this? The best thing I can do.
Ouch. That was kind of rude. This IS the script request forum.



I'm sorry but this is such a BS excuse, I'm sick of seeing it on this forum >_>
Minor aesthetic changes can greatly make a game seem more authentic, especially when trying to emulate retro games. I appreciate the request of a more authentic retro screen fade; every little thing counts. Honestly I dislike when retro games try to "look" retro but there are so many technical things that breaks immersion and says, "oh, this is actually just a modern impersonation of a retro game". Smooth fade transitioning would definitely break the immersion for an NES-like game.
Personally, I would use common events, but in OP's new thread he specifies that he's already using a lot of common events and therefore doesn't want to lag the game anymore. Perfectly understandable.

OP, if no one is willing to make a script (which is also understandable; people are doing this out of charity, so they are not obligated) then I do recommend finding out a light-weight way to make a common event; perhaps you can only activate it with a Common Event Call, instead of running it all the time with parallel process. This should make it so that your game won't lag or crash.
When I said "this isn't something that needs to be added to the game", I meant the script snippet I posted doesn't literally need to be pasted into the editor; it could have looked like a script snippet/add-on so I wanted to clarify that it was just default code (in reference to his original request/post)
View attachment 114120
Something like this? The best thing I can do.
Yes exactly!!!
Now is there a way to implement that into a script?
Code:
class Scene_Map
  Duration = 40*2
  #--------------------------------------------------------------------------
  # * Fadein Screen
  #--------------------------------------------------------------------------
  def white_fadeout(duration)
    duration = Duration
    @tone = $game_map.screen.tone.clone
    fade_loop(duration) do |v|
      if v <= Duration*0.5
        $game_map.screen.tone.blue = -255
      elsif v <= Duration*0.75
        $game_map.screen.tone.red = -255
      else
        $game_map.screen.tone.green = -255
      end
    end
  end
  #--------------------------------------------------------------------------
  # * Fadeout Screen
  #--------------------------------------------------------------------------
  def white_fadein(duration)
    duration = Duration
    fade_loop(duration) do |v|
      if v <= Duration*0.25
        $game_map.screen.tone.blue = @tone.blue
      elsif v <= Duration*0.50
        $game_map.screen.tone.red = @tone.red
      elsif v <= Duration*0.75
        $game_map.screen.tone.green = @tone.green
      else 
        break
      end
    end
  end
end
I overwrite the white fadeout so you have to use that.
Code:
class Scene_Map
  Duration = 40*2
  #--------------------------------------------------------------------------
  # * Fadein Screen
  #--------------------------------------------------------------------------
  def white_fadeout(duration)
    duration = Duration
    @tone = $game_map.screen.tone.clone
    fade_loop(duration) do |v|
      if v <= Duration*0.5
        $game_map.screen.tone.blue = -255
      elsif v <= Duration*0.75
        $game_map.screen.tone.red = -255
      else
        $game_map.screen.tone.green = -255
      end
    end
  end
  #--------------------------------------------------------------------------
  # * Fadeout Screen
  #--------------------------------------------------------------------------
  def white_fadein(duration)
    duration = Duration
    fade_loop(duration) do |v|
      if v <= Duration*0.25
        $game_map.screen.tone.blue = @tone.blue
      elsif v <= Duration*0.50
        $game_map.screen.tone.red = @tone.red
      elsif v <= Duration*0.75
        $game_map.screen.tone.green = @tone.green
      else
        break
      end
    end
  end
end
I overwrite the white fadeout so you have to use that.
Dude thank you so much!!!
It looks like I owe you one Theo!

Original thread: https://forums.rpgmakerweb.com/threads/which-ruby-script-to-alter-for-fading.108106/