RMRK is retiring.
Registration is disabled. The site will remain online, but eventually become a read-only archive. More information.

RMRK.net has nothing to do with Blockchains, Cryptocurrency or NFTs. We have been around since the early 2000s, but there is a new group using the RMRK name that deals with those things. We have nothing to do with them.
NFTs are a scam, and if somebody is trying to persuade you to buy or invest in crypto/blockchain/NFT content, please turn them down and save your money. See this video for more information.
Screen Fading

0 Members and 1 Guest are viewing this topic.

****
Rep:
Level 84
3...2...1...
It's possible that this is in the wrong topic, because it's not per say a script request so much as asking to have one of the core scripts modified.

But before I say, let me note the maker I'm using: RMVXA.

What I would like to do is be able to set the speed at which the screen fades out (and in) when you use the fade out (and in) screen command from the second page.

Anybody know how to?

pokeball TDSOffline
***
Rep:
Level 84
-T D S-
Silver - GIAW 11 (Hard)Silver - Game In A Week VII
I think this should work.

Use this in a script call.

Code: [Select]
$game_map.screen.start_fadeout(duration)
$game_map.screen.start_fadein(duration)

Example:

Code: [Select]
$game_map.screen.start_fadeout(200)

If you want to change it for every time you use the command you would have to change it here.

Code: [Select]
#==============================================================================
# ? Game_Interpreter
#------------------------------------------------------------------------------
# ????????????????????????????? Game_Map ????
# Game_Troop ????Game_Event ??????????????
#==============================================================================

class Game_Interpreter
  #--------------------------------------------------------------------------
  # ? ??????????
  #--------------------------------------------------------------------------
  def command_221
    Fiber.yield while $game_message.visible
    screen.start_fadeout(30)
    wait(30)
  end
  #--------------------------------------------------------------------------
  # ? ?????????
  #--------------------------------------------------------------------------
  def command_222
    Fiber.yield while $game_message.visible
    screen.start_fadein(30)
    wait(30)
  end
end

Change where it says.

Code: [Select]
screen.start_fadein(30)
wait(30)

The 30 to the new fadein or fadeout default duration.
« Last Edit: January 31, 2012, 06:51:39 AM by TDS »

*****
my name is Timothy what's yours
Rep:
Level 79
Hello
2014 Most Missed Member2014 Zero to Hero2014 Best IRC Quote2012 Zero To HeroSecret Santa 2012 ParticipantContestant - GIAW 9For frequently finding and reporting spam and spam bots2011 Zero to Hero
I know it wasn't necessary, but I whipped up a script anyway. Sorry if this offends you, TDS, your way works perfectly fine, I just thought there would be an easier way for the user (and I was bored).
Code: [Select]
#===============================================================================
#
# Change Fade Time (1.0)
# 31/01/2012
# By Pacman (for Countdown)
# This script will alter the number of frames it takes to fade the screen in
# and out (with the default commands). This is done with a simple script call.
# You can also set an individual fadein or fadeout to have a different number
# of frames.
# Set INITIAL_FRAMES to the number of frames it takes to fade in and out from
# the beginning of the game at line 22.
# Use these script calls to do the functions described next to them:
#   change_fade_time(n)   - Change the number of frames it takes to fade in and
#                           out to n.
#   fadein(n)             - Fade the screen in with n frames.
#   fadeout(n)            - Fade the screen out with n frames.
# Keeping in mind that 60 frames = 1 second.
#
#===============================================================================
#
# BEGIN CONFIGURATION
#

module FADE_TIME  # Do not touch this.
  INITIAL_FRAMES = 30 # Starting number of frames.
end               # Do not touch this.

#
# END CONFIGURATION
#
#===============================================================================

#==============================================================================
# ? Game_System
#------------------------------------------------------------------------------
# ??????????????????????????????????????
# ????????????????? $game_system ????????
#==============================================================================

class Game_System
  #--------------------------------------------------------------------------
  # Public Instance Variables
  #--------------------------------------------------------------------------
  attr_accessor :fade_time
  #--------------------------------------------------------------------------
  # Alias listing
  #--------------------------------------------------------------------------
  alias fade_init initialize
  #--------------------------------------------------------------------------
  # * Object Initialization
  #--------------------------------------------------------------------------
  def initialize(*args)
    fade_init(*args)
    @fade_time = FADE_TIME::INITIAL_FRAMES
  end
end

#==============================================================================
# ? Game_Interpreter
#------------------------------------------------------------------------------
# ????????????????????????????? Game_Map ????
# Game_Troop ????Game_Event ??????????????
#==============================================================================

class Game_Interpreter
  #--------------------------------------------------------------------------
  # * Fadeout screen
  #--------------------------------------------------------------------------
  def command_221
    Fiber.yield while $game_message.visible
    screen.start_fadeout($game_system.fade_time)
    wait($game_system.fade_time)
  end
  #--------------------------------------------------------------------------
  # * Fadein screen
  #--------------------------------------------------------------------------
  def command_222
    Fiber.yield while $game_message.visible
    screen.start_fadein($game_system.fade_time)
    wait($game_system.fade_time)
  end
  #--------------------------------------------------------------------------
  # * Alter fade time for screen
  #     n : new number of frames fadein and fadeout take.
  #--------------------------------------------------------------------------
  def change_fade_time(n)
    $game_system.fade_time = n
  end
  #--------------------------------------------------------------------------
  # * Fadein with specific number of frames
  #     n : number of frames to fade in by (defaults to set number)
  #--------------------------------------------------------------------------
  def fadein(n = nil)
    Fiber.yield while $game_message.visible
    screen.start_fadein(n.nil? ? $game_system.fade_time : n)
    wait(n.nil? ? $game_system.fade_time : n)
  end
  #--------------------------------------------------------------------------
  # * Fadeout with specific number of frames
  #     n : number of frames to fade in by (defaults to set number)
  #--------------------------------------------------------------------------
  def fadeout(n = nil)
    Fiber.yield while $game_message.visible
    screen.start_fadeout(n.nil? ? $game_system.fade_time : n)
    wait(n.nil? ? $game_system.fade_time : n)
  end
end

$imported ||= {}
$imported[:pac_change_fade_time]

#===============================================================================
#
# END OF SCRIPT
#
#===============================================================================
With this you can simply use:
change_fade_time(120)
to make the fadein and fadeout 2 seconds long.
You can also just use:
fadein(60)
fadeout(60)
to make them 1 second long. The default command still works.
it's like a metaphor or something i don't know

****
Rep:
Level 84
3...2...1...
Wow, you two are both amazing. I was seriously not expecting an answer so quickly. +rep for both of you and credit in the game (which I've only just started).