I'm currently having problems with the splash screen/full screen combo scripts that Kain Noble posted.
It's a Syntax error, but I don't know anything about coding, so I don't know what's up.
Here's the code:
Says the error is on line 208.
It's a Syntax error, but I don't know anything about coding, so I don't know what's up.
Here's the code:
Code:
#===============================================================================
# ** Splash Screen Script
#-------------------------------------------------------------------------------
# Written by : Kain Nobel
# Version : 2.5
# Last Update : 11.27.2008
# Created On : 06.30.2008
#===============================================================================
#-------------------------------------------------------------------------------
# * SDK Log
#-------------------------------------------------------------------------------
SDK.log('System.SplashScreen', 'Kain Nobel', 2.5, '11.27.2008')
SDK.check_requirements(2.0, [1])
#-------------------------------------------------------------------------------
# * SDK Enabled Test - BEGIN
#-------------------------------------------------------------------------------
if SDK.enabled?('System.SplashScreen')
#===============================================================================
# ** SplashSettings
#-------------------------------------------------------------------------------
# ...
#===============================================================================
module SplashSettings
#-----------------------------------------------------------------------------
# * Create Game System and Database (if nil)
#-----------------------------------------------------------------------------
$game_system ||= Game_System.new
$data_system ||= load_data("Data/System.rxdata")
#-----------------------------------------------------------------------------
# * GameMode
# 0.) Enabled in Game.exe & Playtest
# 1.) Enabled only in Game.exe
# 2.) Enabled only in Playtest
# ?.) Any other setting, its not enabled at all
#-----------------------------------------------------------------------------
GameMode = 0
#-----------------------------------------------------------------------------
# * Skip_Enabled = true/false
#-----------------------------------------------------------------------------
Skip_Enabled = true
#-----------------------------------------------------------------------------
# * Next_Scene = 'Scene_???' (String)
#-----------------------------------------------------------------------------
Next_Scene = 'Scene_Title'
#-----------------------------------------------------------------------------
# * BGM = RPG::AudioFile.new(*args)
#-----------------------------------------------------------------------------
BGM = "Audio/BGM/x001-Battle01"
#-----------------------------------------------------------------------------
# * BGS = RPG::AudioFile.new(*args)
#-----------------------------------------------------------------------------
BGS = RPG::AudioFile.new("Audio/BGS/001-Wind01")
#-----------------------------------------------------------------------------
# * SubDir = "Splash/"
#-----------------------------------------------------------------------------
SubDir = ""
#-----------------------------------------------------------------------------
# * Bitmaps = [filename (String), ...]
#-----------------------------------------------------------------------------
Bitmaps = ["Splash01", "Splash02","Splash01", "Splash02","Splash01", "Splash02"]
#-----------------------------------------------------------------------------
# * FadeTime = {order (Numeric) => duration (Numeric), ...}
#-----------------------------------------------------------------------------
SpeedFadeIn = {}
SpeedFadeIn.default = 5
#-----------------------------------------------------------------------------
# * SpeedFadeOut = {order (Numeric) => duration (Numeric), ...}
#-----------------------------------------------------------------------------
SpeedFadeOut = {}
SpeedFadeOut.default = 5
#-----------------------------------------------------------------------------
# * Stretch_BLTÂ = {order (Numeric) => true/false, ...}
#-----------------------------------------------------------------------------
Stretch_BLT = {}
Stretch_BLT.default = false
end
#===============================================================================
# ** Scene_Splash
#-------------------------------------------------------------------------------
# This scene deals with splash screen processing.
#===============================================================================
class Scene_Splash < SDK::Scene_Base
#-----------------------------------------------------------------------------
# * Included Modules
#-----------------------------------------------------------------------------
include SplashSettings
#-----------------------------------------------------------------------------
# * Main
#-----------------------------------------------------------------------------
def main
if skip_to_next_scene?
next_scene
return
end
super
end
#-----------------------------------------------------------------------------
# * Main To Next Scene?
#-----------------------------------------------------------------------------
def skip_to_next_scene?
return !($DEBUG ? [0,2].include?(GameMode) : [0,1].include?(GameMode))
end
#-----------------------------------------------------------------------------
# * Main Variable
#-----------------------------------------------------------------------------
def main_variable
super
@index = 0
@delay = 0
@reverse = false
end
#-----------------------------------------------------------------------------
# * Main Sprite
#-----------------------------------------------------------------------------
def main_sprite
super
@screens = Array.new
for i in 0...Bitmaps.size
vp = Viewport.new(0, 0, 640, 480)
@screens << Sprite.new(vp)
@screens[i].bitmap = Bitmap.new(vp.rect.width, vp.rect.height)
subdir = ((SubDir.include?("/") && !SubDir == "") ? SubDir : "#{SubDir}/")
begin ; b = RPG::Cache.title("#{subdir}#{Bitmaps[i]}")
rescue ; b = RPG::Cache.title($data_system.title_name)
end
cx = (Stretch_BLT[i] ? 0 : (320 - b.width / 2))
cy = (Stretch_BLT[i] ? 0 : (240 - b.height / 2))
cw = (Stretch_BLT[i] ? 640 : b.width)
ch = (Stretch_BLT[i] ? 480 : b.height)
src_rect = Rect.new(0, 0, b.width, b.height)
dest_rect = Rect.new(cx, cy, cw, ch)
@screens[i].bitmap.stretch_blt(dest_rect, b, src_rect)
@screens[i].visible = true
@screens[i].opacity = 0
end
end
#-----------------------------------------------------------------------------
# * Main Audio
#-----------------------------------------------------------------------------
def main_audio
super
case BGM.class.to_s
when "RPG::AudioFile"
Audio.bgm_play(BGM.name, BGM.volume, BGM.pitch)
when "String"
bgm = (BGM.include?("Audio/BGM/") ? BGM : "Audio/BGM/#{BGM}")
Audio.bgm_play(bgm, 100, 100)
when "Array"
n = (BGM.size > 0 ? BGM[0] : "")
v = (BGM.size > 1 ? BGM[1] : 100)
p = (BGM.size > 2 ? BGM[2] : 100)
n = (n.include?("Audio/BGM/") ? n : "Audio/BGM/#{n}")
Audio.bgm_play(n, v, p)
when "NilClass"
$game_system.bgm_play($data_system.title_bgm)
end
case BGS.class.to_s
when "RPG::AudioFile"
Audio.bgs_play(BGS.name, BGS.volume, BGS.pitch)
when "String"
bgs = (BGS.include?("Audio/BGS/") ? BGS : "Audio/BGS/#{BGS}")
Audio.bgs_play(bgs, 100, 100)
when "Array"
n = (BGS.size > 0 ? BGS[0] : "")
v = (BGS.size > 1 ? BGS[1] : 100)
p = (BGS.size > 2 ? BGS[2] : 100)
n = (n.include?("Audio/BGS/") ? n : "Audio/BGS/#{n}")
Audio.bgs_play(n, v, p)
end
end
#-----------------------------------------------------------------------------
# * Update
#-----------------------------------------------------------------------------
def update
super
if Input.trigger?(Input::B) && Skip_Enabled
next_scene
return
elsif Input.trigger?(Input::C) && Skip_Enabled
@reverse = true
return
end
@delay += (@reverse ? -SpeedFadeOut[@index] : SpeedFadeIn[@index])
begin ; @screens[@index].opacity = @delay
rescue ; next_scene
end
if @delay >= 255
@reverse = true
@delay = 255
elsif @delay <= 0
@reverse = false
@delay = 0
@index += 1
end
end
#-----------------------------------------------------------------------------
# * Next Scene
#-----------------------------------------------------------------------------
def next_scene
begin ; eval "$scene = #{Next_Scene}.new"
rescue ; $scene = Scene_Title.new
end
end
end
#-------------------------------------------------------------------------------
# * SDK Enabled Test - END
#-------------------------------------------------------------------------------
end
Says the error is on line 208.