Splash Script - Villain - 03-18-2010
aaaah! good script!)))
Splash Script - yamina-chan - 03-18-2010
:cheery:
Now, with the help of the demo I finally got this to work as well =D
Thank you for releasing the non SDK version too, by the way. Thanks for sharing ^^
Splash Script - rm-rf - 03-19-2010
Ryu-ka: I'm sorry, I found the bug/error and it has been fixed, thank you for pointing it out.
(replace the script you've got now with the updated one at the start of this thread or replace Audio.bgm_play('/Audio/BGM/' + SSConfig::MusicFile) if SSConfig::PlayMusic to Audio.bgm_play('Audio/BGM/' + SSConfig::MusicFile) if SSConfig::PlayMusic)
Villain & yamina-chan: thanks ;D i'm glad you like the script (be sure to update the script to eliminate the bug that ryu-ka found :o )
Splash Script - Ryu-ka - 03-20-2010
I'm sorry for being so picky about this script, but is there any way for it to wait on the title screen for more than 5 frames? If I set it to, say, 15, it goes crazy and only stops for 1-2 frames.
Splash Script - rm-rf - 03-20-2010
Ryu-ka: Just added the feature ;o you edit the SplashWait = # to make it wait before fading out, 100-200 is ideal lol
Code: #==============================================================================
# ** Splash Script
#------------------------------------------------------------------------------
# - Coded by :rm-rf
# - Original by :Lambchops
# - Version :1.1
# - 24/02/2010
#------------------------------------------------------------------------------
# * How to Use:
# - Just add more filenames to SplashFiles = ['filename', ..., ...]
# - and configure the speed of loading each images.
# - That's it ;o
#==============================================================================
module SSConfig
#----------------------------------------------------------------------------
# * Splash Files
# :folder- :Graphics/Picture
# :config- :['filename', 'filename', ..., ...]
#----------------------------------------------------------------------------
SplashFiles = ['splash_sample01', 'splash_sample02', 'splash_sample03']
#----------------------------------------------------------------------------
# * Splash Speed / Wait
# :the speed of transition, 2-4 is ideal
# :wait is for how long the image will show for
#----------------------------------------------------------------------------
SplashSpeed = 3
SplashWait = 100
#----------------------------------------------------------------------------
# * Play Music During Splash?
# :config- :true / false
# :do you want to play music during the splash?
#----------------------------------------------------------------------------
PlayMusic = true
#----------------------------------------------------------------------------
# * Music File
# :folder- :Audio/BGM
# :use the filename for the audio. (dont need the extention i suppose)
#----------------------------------------------------------------------------
MusicFile = '015-Theme04'
end
class Scene_Splash
#----------------------------------------------------------------------------
# * Main
#----------------------------------------------------------------------------
def main
# Setup Variables
main_variable
# Setup Sprites
main_sprite
# Setup Audio
main_audio
# Execute transition
Graphics.transition
# Run main loop
loop do
# Update game screen
Graphics.update
# Update input information
Input.update
# Frame update
update
# Abort loop if screen is changed
break if $scene != self
end
# Prepare for transition
Graphics.freeze
# Dispose sprites
@sprites.each {|i| i.dispose}
end
#----------------------------------------------------------------------------
# * Main: Variable
#----------------------------------------------------------------------------
def main_variable
# Setup important variables
@index = 0
@hide = false
@show = true
@opacity = 0
end
#----------------------------------------------------------------------------
# * Main: Sprite
#----------------------------------------------------------------------------
def main_sprite
# Setup array
@sprites = []
# Make sprites
SSConfig::SplashFiles.each_with_index do |filename, i|
@sprites[i] = Sprite.new
@sprites[i].bitmap = RPG::Cache.picture(filename)
@sprites[i].opacity = 0
end
end
#----------------------------------------------------------------------------
# * Main: Audio
#----------------------------------------------------------------------------
def main_audio
# Play BGM
Audio.bgm_play('Audio/BGM/' + SSConfig::MusicFile) if SSConfig::PlayMusic
end
#----------------------------------------------------------------------------
# * Frame Update
#----------------------------------------------------------------------------
def update
# If input triggered
if Input.trigger?(Input::C) || Input.trigger?(Input::B)
# Switch to Title
Audio.bgm_fade(1000) if SSConfig::PlayMusic
$scene = Scene_Title.new
end
# Do Hide/Show images
process_transition
end
#----------------------------------------------------------------------------
# * Process Transition
#----------------------------------------------------------------------------
def process_transition
# Fade In
if @show
# Increase Opacity
@opacity += SSConfig::SplashSpeed
# If Opacity's at maximum
if @opacity > 255
# Hide images
@show = false
@opacity = 255
@wait = SSConfig::SplashWait
end
end
# Wait for a bit
if @wait > 0
# Decrease Wait Count
@wait -= 1
# Done waiting
if @wait <= 0
# Fade out
@hide = true
# Reset wait
@wait = 0
end
end
# Fade Out
if @hide
# Decrease Opacity
@opacity -= SSConfig::SplashSpeed
# If Opacity's at minimum
if @opacity < 0
# Show images
@hide = false
@show = true
@opacity = 0
# Change Index
@index += 1
end
end
# Branch by index
case @index
when 0...SSConfig::SplashFiles.size
# Set Opacity
@sprites[@index].opacity = @opacity
when (SSConfig::SplashFiles.size)
# Switch to Title
Audio.bgm_fade(1000) if SSConfig::PlayMusic
$scene = Scene_Title.new
end
end
end
The main post is updated, and fixed one bugs, added a feature so... version 1.1 :o
Splash Script - Ryu-ka - 03-20-2010
I'm back, yet again. The wait feature works, but when the game starts, I get a NoMethodError.
Script 'Splash' line 132: NoMethodError occurred.
undefined method `<' for nil:NilClass
Splash Script - rm-rf - 03-20-2010
man, i sucks at scripting lol
Code: #==============================================================================
# ** Splash Script
#------------------------------------------------------------------------------
# - Coded by :rm-rf
# - Original by :Lambchops
# - Version :1.1
# - 24/02/2010
#------------------------------------------------------------------------------
# * How to Use:
# - Just add more filenames to SplashFiles = ['filename', ..., ...]
# - and configure the speed of loading each images.
# - That's it ;o
#==============================================================================
module SSConfig
#----------------------------------------------------------------------------
# * Splash Files
# :folder- :Graphics/Picture
# :config- :['filename', 'filename', ..., ...]
#----------------------------------------------------------------------------
SplashFiles = ['splash_sample01', 'splash_sample02', 'splash_sample03']
#----------------------------------------------------------------------------
# * Splash Speed / Wait
# :the speed of transition, 2-4 is ideal
# :wait is for how long the image will show for
#----------------------------------------------------------------------------
SplashSpeed = 3
SplashWait = 100
#----------------------------------------------------------------------------
# * Play Music During Splash?
# :config- :true / false
# :do you want to play music during the splash?
#----------------------------------------------------------------------------
PlayMusic = true
#----------------------------------------------------------------------------
# * Music File
# :folder- :Audio/BGM
# :use the filename for the audio. (dont need the extention i suppose)
#----------------------------------------------------------------------------
MusicFile = '015-Theme04'
end
class Scene_Splash
#----------------------------------------------------------------------------
# * Main
#----------------------------------------------------------------------------
def main
# Setup Variables
main_variable
# Setup Sprites
main_sprite
# Setup Audio
main_audio
# Execute transition
Graphics.transition
# Run main loop
loop do
# Update game screen
Graphics.update
# Update input information
Input.update
# Frame update
update
# Abort loop if screen is changed
break if $scene != self
end
# Prepare for transition
Graphics.freeze
# Dispose sprites
@sprites.each {|i| i.dispose}
end
#----------------------------------------------------------------------------
# * Main: Variable
#----------------------------------------------------------------------------
def main_variable
# Setup important variables
@index = 0
@hide = false
@show = true
@opacity = 0
@wait = 0
end
#----------------------------------------------------------------------------
# * Main: Sprite
#----------------------------------------------------------------------------
def main_sprite
# Setup array
@sprites = []
# Make sprites
SSConfig::SplashFiles.each_with_index do |filename, i|
@sprites[i] = Sprite.new
@sprites[i].bitmap = RPG::Cache.picture(filename)
@sprites[i].opacity = 0
end
end
#----------------------------------------------------------------------------
# * Main: Audio
#----------------------------------------------------------------------------
def main_audio
# Play BGM
Audio.bgm_play('Audio/BGM/' + SSConfig::MusicFile) if SSConfig::PlayMusic
end
#----------------------------------------------------------------------------
# * Frame Update
#----------------------------------------------------------------------------
def update
# If input triggered
if Input.trigger?(Input::C) || Input.trigger?(Input::B)
# Switch to Title
Audio.bgm_fade(1000) if SSConfig::PlayMusic
$scene = Scene_Title.new
end
# Do Hide/Show images
process_transition
end
#----------------------------------------------------------------------------
# * Process Transition
#----------------------------------------------------------------------------
def process_transition
# Fade In
if @show
# Increase Opacity
@opacity += SSConfig::SplashSpeed
# If Opacity's at maximum
if @opacity > 255
# Hide images
@show = false
@opacity = 255
@wait = SSConfig::SplashWait
end
end
# Wait for a bit
if @wait > 0
# Decrease Wait Count
@wait -= 1
# Done waiting
if @wait <= 0
# Fade out
@hide = true
# Reset wait
@wait = 0
end
end
# Fade Out
if @hide
# Decrease Opacity
@opacity -= SSConfig::SplashSpeed
# If Opacity's at minimum
if @opacity < 0
# Show images
@hide = false
@show = true
@opacity = 0
# Change Index
@index += 1
end
end
# Branch by index
case @index
when 0...SSConfig::SplashFiles.size
# Set Opacity
@sprites[@index].opacity = @opacity
when (SSConfig::SplashFiles.size)
# Switch to Title
Audio.bgm_fade(1000) if SSConfig::PlayMusic
$scene = Scene_Title.new
end
end
end
^ fixed, only needed to add 1 line which i forgot to include from sdk version ;x
|