Need help with a script!
4 posters
Page 1 of 1
Need help with a script!
Hey everyone, for my game I would like to use the script shown below for the title sequence, But I was Wondering if anyone could possibly add in a few things for me!
Script in spoilers:
Could anyone add the following effects on?
I would like it if the screen just ran the background... the title then slowly faded in... then, a second or two later the New game, continue and exit Also then faded in!
* This isnt really important if you can do the below, but I would appreaciate it! *
Is it possible that after you hit the new game button that you could have the screen slowly fade out to dark?
Thank you to whoever helps me! I will credit you when my game finally comes out!
Script in spoilers:
- Spoiler:
- #==============================================================================
# Hanzo Kimura's Animated Title Screen, a re-do by Speed.
# Scripted Date: 02/24/09
# PLEASE CREDIT: Hanzo Kimura and Speed for the edit
# if you are going to use this script for your title.
#
# IMAGES USED(All in Graphics/System) Folder:
# "TitleBGLoop.jpg" - For Scrolling Upward Effect
# "TitleBGSprite.jpg" - For Horizantally Endless Scrolling
# "TitleCursor.png" - For the title cursor
# "TitleMenu01.png" - For the title Menu (First Menu Active)
# "TitleMenu02.png" - For the title Menu (Second Menu Active)
# "TitleMenu03.png" - For the title Menu (Third Menu Active)
# "TitleLogo.png" - For the Title Logo
# "TitleSpark01.png" - For the Title Spark
# "TitleSpark02.png" - For the Title Spark
# "TitleSymbol.png" - For the Title Symbol
# "TitleCursorStrike01.png" - For Title Cursor Strike Effect(Left)
# "TitleCursorStrike02.png" - For Title Cursor Strike Effect(Right)
# **"TitleBG.jpg" - For Still Version Title Background
#
# RE-CODE by Speed:
# - Removed unneccecary duplicate code from Scene_Title
# - Aliased what I can, it's not compatible with other scripts, but still
# it saves lines and duplicate code.
# - Removed disposal of unneccecary objects (if you dispose @sprite, you don't
# need to dispose @sprite.bitmap after that)
# - Added an array for the image objects, for faster disposal and removes of
# duplicate code.
# - Fixed unneccecary if blocks.
# - Removed all global variables except $STILL_BG, since you won't change
# the speed and everything in game it's unneccecary, consumes memory and
# it's dangerous as it can kill other scripts.
# - Moved the variables into a start method (initializing them).
# - Changed @wave.dispose if @wave != nil
# now more robust, because now it disposes the sprite if it was created,
# before you could turn off the $STILL_BG in title and it would keep the
# background on screen if you would change scenes.
# - More minor things. All and all, the script is now less dangerous and
# obtrusive, and the number of lines of code was halved.
#
# IF YOU FIND ANY BUGS REPORT HERE:
# http://www.rpgmakervx.net/index.php?showtopic=16133&st=60
#==============================================================================
$STILL_BG = false # true=Still Background false=Animated Background.
#-|-|-|-|-|-|-|-|-|-|-|-|-|-|-|-|-|-|-|-|-|-|-|-|-|-|-|-|-|-|-|-|-|-|-|-|-\
#----|Scene_Title|--------------------------------------------------------/
#-|-|-|-|-|-|-|-|-|-|-|-|-|-|-|-|-|-|-|-|-|-|-|-|-|-|-|-|-|-|-|-|-|-|-|-|-\
#--This class performs the title screen processing.-----------------------/
#========================================================================/
class Scene_Title < Scene_Base
#--------------------------------------------------------------------------
# * Start (Alias) | EDITING AREA
#--------------------------------------------------------------------------
alias :start_oldie_speed :start
def start
#NEW FUNCTIONS
@TITLE_MENU_X = 184 # Menu X Position
@TITLE_MENU_Y = 260 # Menu Y Position
@LOGO_X = 0 # Logo X Position
@LOGO_Y = 0 # Logo Y Position
@SPARK_COUNT = 350 # SPARK COUNT: Frames before the spark appears again
@SPARK_SPEED = 10 # The speed of the sparks
@MENU_NEW = 260 # THE Y Position of the cursor on NEW GAME
@MENU_CONTINUE = 305 # THE Y Position of the cursor on CONTINUE
@MENU_EXIT = 345 # THE Y Position of the cursor on EXIT
@SYMBOL_SPEED = 1
#-|-|-|-|-|-|-|-|-|-|-|-|-|-|-|-|-|-|-|-|-|-|-|-|-|-|-|-|-|-|-|-|-|-|-|-|-\
#---|DO NOT EDIT BELOW!|--------------------------------------------------/
#-|-|-|-|-|-|-|-|-|-|-|-|-|-|-|-|-|-|-|-|-|-|-|-|-|-|-|-|-|-|-|-|-|-|-|-|-\
#========================================================================/
@SYMBOL_RESET = false
start_oldie_speed
end
#--------------------------------------------------------------------------
# * Frame Update (Overwrite)
#--------------------------------------------------------------------------
def update
super
if $STILL_BG == false
#=======Wave Animation=========
@wave.update
#=====Background Animation=====
if @sprite.oy != 0
@sprite.oy -= 1
elsif @sprite.oy == 0
@sprite.ox += 1
end
if @wave.oy != 0
@wave.oy -= 1
elsif @wave.oy == 0
if @TITLE_LOOP == 1 && @wave.ox != 1289
@wave.ox += 1
else
@TITLE_LOOP == 2
end
if @TITLE_LOOP == 2 && @wave.ox != -1189
@wave.ox -= 1
else
@TITLE_LOOP == 1
end
end
end
#=======Symbol Animation=======
@s[7].ox -= @SYMBOL_SPEED
@SYMBOL_RESET = false if @SYMBOL_RESET == true && @s[7].opacity == 0
@s[7].opacity += 3 if @s[7].opacity != 255
#=======Spark Animation========
@s[8].x += @SPARK_SPEED
@s[9].x -= @SPARK_SPEED
if @SPARK_COUNT != 0
@SPARK_COUNT -= 1
else
@SPARK_COUNT = 350
@s[8].x = -172
@s[9].x = 544
end
if @s[8].opacity != 255
@s[8].opacity += 20
@s[9].opacity += 20
end
#=======Menu Animation=========
case @command_window.index
when 0 #New game
@s[8].y = @MENU_NEW - 20
@s[7].oy = @MENU_NEW + 183
@s[5].y = @s[6].y = @s[9].y = @MENU_NEW
if @s[1].opacity != 255
@s[1].opacity += 20
@s[2].opacity -= 20
@s[3].opacity -= 20
end
@s[4].y -= 5 if @s[4].y != @TITLE_MENU_Y
when 1 #Continue
@s[8].y = @MENU_CONTINUE - 20
@s[7].oy = @MENU_CONTINUE + 93
@s[5].y = @s[6].y = @s[9].y = @MENU_CONTINUE
if @s[2].opacity != 255
@s[2].opacity += 20
@s[1].opacity -= 20
@s[3].opacity -= 20
end
if @s[4].y != @MENU_CONTINUE && @s[4].y < @MENU_CONTINUE
@s[4].y += 5
elsif @s[4].y != @MENU_CONTINUE && @s[4].y > @MENU_CONTINUE
@s[4].y -= 5
end
when 2 #Shutdown
@s[8].y = @MENU_EXIT - 20
@s[7].oy = @MENU_EXIT + 13
@s[5].y = @s[6].y = @s[9].y = @MENU_EXIT
if @s[3].opacity != 255
@s[3].opacity += 20
@s[1].opacity -= 20
@s[2].opacity -= 20
end
@s[4].y += 5 if @s[4].y != @MENU_EXIT
end
@command_window.update
#====Cursor Animation=====
@s[5].x += 11 if @s[5].x != 0
@s[6].x -= 12 if @s[6].x != 308
check_menu
if Input.trigger?(Input::C)
case @command_window.index
when 0 #New game
command_new_game
when 1 # Continue
command_continue
when 2 # Shutdown
command_shutdown
end
end
end
#--------------------------------------------------------------------------
# * Checking Current Menu (Overwrite)
#--------------------------------------------------------------------------
def check_menu
if Input.trigger?(Input::UP) or Input.trigger?(Input::DOWN)
@SPARK_COUNT = 350
@s[8].x = -172; @s[9].x = 640
@s[8].opacity = @s[9].opacity = @s[7].opacity = 0
@SYMBOL_RESET = true
@s[5].x = -330; @s[6].x = 680
case @command_window.index
when 0 #New game
@s[8].y = 280; @s[9].y = 300
@s[7].oy = 403
@s[5].y = @s[6].y = 300
when 1 # Continue
@s[8].y = 325; @s[9].y = 345
@s[7].oy = 358
@s[5].y = @s[6].y = 345
when 2 # Shutdown
@s[8].y = 365; @s[9].y = 385
@s[7].oy = 317
@s[5].y = @s[6].y = 385
end
end
end
#--------------------------------------------------------------------------
# * Create Title Graphic (Overwrite)
#--------------------------------------------------------------------------
def create_title_graphic
@viewport1 = Viewport.new(0, 0, 1288, 891)
@viewport2 = Viewport.new(0, 0, 824, 480)
@viewport2.z = 10
if $STILL_BG == false
@sprite = Plane.new(@viewport1)
@sprite.bitmap = Cache.system("TitleBGLoop")
@sprite.oy = 371; @sprite.ox = 100; @sprite.z = -100
@wave = Sprite.new(@viewport1)
@wave.bitmap = Cache.system("TitleBGSprite")
@wave.oy = 371; @wave.ox = 100; @wave.wave_amp = 50; @wave.wave_length = 440
@wave.wave_speed = 1250; @wave.opacity = 125; @wave.z = 5
else
@sprite = Sprite.new
@sprite.bitmap = Cache.system("TitleBG")
@sprite.y = @sprite.x = 0; @sprite.z = -100
end
#sprite array
@s = []
for i in 0...10
@s[i] = Sprite.new
end
#logo
@s[0].bitmap = Cache.system("TitleLogo")
@s[0].x = @LOGO_X; @s[0].y = @LOGO_Y; @s[0].z = 10
#menu01, menu 02, menu 03
@s[1].bitmap = Cache.system("TitleMenu01")
@s[2].bitmap = Cache.system("TitleMenu02")
@s[3].bitmap = Cache.system("TitleMenu03")
@s[2].opacity = @s[3].opacity = 0
@s[1].x = @s[2].x = @s[3].x = @TITLE_MENU_X
@s[1].y = @s[2].y = @s[3].y = @TITLE_MENU_Y
#cursor
@s[4].bitmap = Cache.system("TitleCursor")
@s[4].x = @TITLE_MENU_X; @s[4].y = @TITLE_MENU_Y; @s[4].z = 12
#strike1, strike2
@s[5].bitmap = Cache.system("TitleCursorStrike01")
@s[5].x = 0; @s[5].y = 260; @s[5].z = 9
@s[6].bitmap = Cache.system("TitleCursorStrike02")
@s[6].x = 308; @s[6].y = 260; @s[6].z = 9
#symbol
@s[7] = Plane.new(@viewport2)
@s[7].bitmap = Cache.system("TitleSymbol")
@s[7].oy = 443; @s[7].ox = 100
#spark01, spark02
@s[8].bitmap = Cache.system("TitleSpark01")
@s[8].y = 280; @s[8].x = -172; @s[8].z = 12
@s[9].bitmap = Cache.system("TitleSpark02")
@s[9].y = 300; @s[9].x = 640; @s[9].z = 12
@s[1].z = @s[2].z = @s[3].z = 13
if @continue_enabled
@s[1].opacity = 0; @s[2].opacity = 255
@s[4].y = 305; @s[5].y = 305; @s[6].y = 305
@s[7].oy = 398
end
end
#--------------------------------------------------------------------------
# * Dispose of Title Graphic (Overwrite)
#--------------------------------------------------------------------------
def dispose_title_graphic
@wave.dispose if @wave != nil
@sprite.dispose
for i in 0...@s.size
@s[i].dispose
end
end
#--------------------------------------------------------------------------
# * Create Command Window (Alias)
#--------------------------------------------------------------------------
alias :create_command_window_oldie_speed :create_command_window
def create_command_window
create_command_window_oldie_speed
@command_window.x = (Graphics.width - @command_window.width) / 2
@command_window.y = 998
end
end
Could anyone add the following effects on?
I would like it if the screen just ran the background... the title then slowly faded in... then, a second or two later the New game, continue and exit Also then faded in!
* This isnt really important if you can do the below, but I would appreaciate it! *
Is it possible that after you hit the new game button that you could have the screen slowly fade out to dark?
Thank you to whoever helps me! I will credit you when my game finally comes out!
The Creator- Legendary
- Posts : 786
Gald : 920
Stats
Cookies: 0
Re: Need help with a script!
In future please use code tags. It makes it easier to read.
This is ugly code, but it should work (haven't tested it).
This is ugly code, but it should work (haven't tested it).
- Code:
class Scene_Title
FADE_OUT_FRAME_LENGTH = 300
SPEED_OF_LOGO_FADEIN = 1
SPEED_OF_MENU_FADEIN = 1
#-----------------------------------------------------------------------------
# Overwritten to make fade out longer
#-----------------------------------------------------------------------------
def command_new_game
confirm_player_location
Sound.play_decision
$game_party.setup_starting_members # Initial party
$game_map.setup($data_system.start_map_id) # Initial map position
$game_player.moveto($data_system.start_x, $data_system.start_y)
$game_player.refresh
$scene = Scene_Map.new
RPG::BGM.fade(FADE_OUT_FRAME_LENGTH+(1500-60))
close_command_window
Graphics.fadeout(FADE_OUT_FRAME_LENGTH)
Graphics.wait(40)
Graphics.frame_count = 0
RPG::BGM.stop
$game_map.autoplay
end
#-----------------------------------------------------------------------------
# Aliased to make certain things not opaque to begin with.
#-----------------------------------------------------------------------------
alias imp_edit_create_title_graphic create_title_graphic unless $@
def create_title_graphic
for i in 0..@s.size
@s[i].opacity = 0
end
imp_edit_create_title_graphic
end
#-----------------------------------------------------------------------------
# Overwritten for fading in background and menu.
#-----------------------------------------------------------------------------
def update
if !$STILL_BG
@stage = 1 if @stage.nil?
@timer = 0 if @timer.nil?
case @stage
when 1
#-----------------------------------------------------------------------
# Wait 30 frames.
#-----------------------------------------------------------------------
@wave.update
update_background_animation
@timer += 1
if @timer >= 30
@timer = 0
@stage = 2
end
when 2
#-----------------------------------------------------------------------
# Fade in logo.
#-----------------------------------------------------------------------
@wave.update
update_background_animation
@s[0].opacity += SPEED_OF_LOGO_FADEIN
if @s[0].opacity >= 255
@stage = 3
end
when 3
#-----------------------------------------------------------------------
# Wait 90 frames.
#-----------------------------------------------------------------------
@wave.update
update_background_animation
@timer += 1
if @timer >= 90
@timer = 0
@stage = 4
end
when 4
@wave.update
update_background_animation
for i in 1..@s.size
a = i == 1 and @continue_enabled
b = i == 2 and !@continue_enabled
@s[i].opacity += SPEED_OF_MENU_FADEIN unless a or b
end
if @s[3].opacity >= 255
@SPARK_COUNT = 350
@stage = 5
end
when 5
@wave.update
update_background_animation
update_symbol_animation
update_spark_animation
update_menu_animation
check_menu
update_input
end
end
end
#-----------------------------------------------------------------------------
# Edited to make the different updates their own methods.
#-----------------------------------------------------------------------------
def update_background_animation
if @sprite.oy != 0
@sprite.oy -= 1
elsif @sprite.oy == 0
@sprite.ox += 1
end
if @wave.oy != 0
@wave.oy -= 1
elsif @wave.oy == 0
if @TITLE_LOOP == 1 && @wave.ox != 1289
@wave.ox += 1
else
@TITLE_LOOP == 2
end
if @TITLE_LOOP == 2 && @wave.ox != -118
@wave.ox -= 1
else
@TITLE_LOOP == 1
end
end
end
def update_symbol_animation
@s[7].ox -= @SYMBOL_SPEED
@SYMBOL_RESET = false if @SYMBOL_RESET == true && @s[7].opacity == 0
@s[7].opacity += 3 if @s[7].opacity != 255
end
def update_spark_animation
@s[8].x += @SPARK_SPEED
@s[9].x -= @SPARK_SPEED
if @SPARK_COUNT != 0
@SPARK_COUNT -= 1
else
@SPARK_COUNT = 350
@s[8].x = -172
@s[9].x = 544
end
if @s[8].opacity != 255
@s[8].opacity += 20
@s[9].opacity += 20
end
end
def update_menu_animation
case @command_window.index
when 0 #New game
@s[8].y = @MENU_NEW - 20
@s[7].oy = @MENU_NEW + 183
@s[5].y = @s[6].y = @s[9].y = @MENU_NEW
if @s[1].opacity != 255
@s[1].opacity += 20
@s[2].opacity -= 20
@s[3].opacity -= 20
end
@s[4].y -= 5 if @s[4].y != @TITLE_MENU_Y
when 1 #Continue
@s[8].y = @MENU_CONTINUE - 20
@s[7].oy = @MENU_CONTINUE + 93
@s[5].y = @s[6].y = @s[9].y = @MENU_CONTINUE
if @s[2].opacity != 255
@s[2].opacity += 20
@s[1].opacity -= 20
@s[3].opacity -= 20
end
if @s[4].y != @MENU_CONTINUE && @s[4].y < @MENU_CONTINUE
@s[4].y += 5
elsif @s[4].y != @MENU_CONTINUE && @s[4].y > @MENU_CONTINUE
@s[4].y -= 5
end
when 2 #Shutdown
@s[8].y = @MENU_EXIT - 20
@s[7].oy = @MENU_EXIT + 13
@s[5].y = @s[6].y = @s[9].y = @MENU_EXIT
if @s[3].opacity != 255
@s[3].opacity += 20
@s[1].opacity -= 20
@s[2].opacity -= 20
end
@s[4].y += 5 if @s[4].y != @MENU_EXIT
end
@command_window.update
@s[5].x += 11 if @s[5].x != 0
@s[6].x -= 12 if @s[6].x != 308
end
end
end
def update_input
if Input.trigger?(Input::C)
case @command_window.index
when 0 #New game
command_new_game
when 1 # Continue
command_continue
when 2 # Shutdown
command_shutdown
end
end
end
IMP1- Coding Moderator
- Posts : 503
Gald : 1399
Stats
Cookies: 5
Re: Need help with a script!
AS in a seperate script in itself?? Alright! Ill give it a try!
The Creator- Legendary
- Posts : 786
Gald : 920
Stats
Cookies: 0
Re: Need help with a script!
ALright, sorry for the double post, but I just got an error... posting now!
I would post script demo link, but being as it is that I am banned from RPGmakervx * thanks to Elf* I cannot retreive it for you... sorry!*
I would post script demo link, but being as it is that I am banned from RPGmakervx * thanks to Elf* I cannot retreive it for you... sorry!*
The Creator- Legendary
- Posts : 786
Gald : 920
Stats
Cookies: 0
Re: Need help with a script!
Argh, you got banned again? What the hell happened this time?
Peva- Development Moderator
- Posts : 1281
Gald : 4414
Stats
Cookies: 0
Re: Need help with a script!
Oh, my bad. Copied and pasted it wrong. Although this is completely your fault for not using code tags
- Code:
class Scene_Title
FADE_OUT_FRAME_LENGTH = 300
SPEED_OF_LOGO_FADEIN = 1
SPEED_OF_MENU_FADEIN = 1
#-----------------------------------------------------------------------------
# Overwritten to make fade out longer
#-----------------------------------------------------------------------------
def command_new_game
confirm_player_location
Sound.play_decision
$game_party.setup_starting_members # Initial party
$game_map.setup($data_system.start_map_id) # Initial map position
$game_player.moveto($data_system.start_x, $data_system.start_y)
$game_player.refresh
$scene = Scene_Map.new
RPG::BGM.fade(FADE_OUT_FRAME_LENGTH+(1500-60))
close_command_window
Graphics.fadeout(FADE_OUT_FRAME_LENGTH)
Graphics.wait(40)
Graphics.frame_count = 0
RPG::BGM.stop
$game_map.autoplay
end
#-----------------------------------------------------------------------------
# Aliased to make certain things not opaque to begin with.
#-----------------------------------------------------------------------------
alias imp_edit_create_title_graphic create_title_graphic unless $@
def create_title_graphic
for i in 0..@s.size
@s[i].opacity = 0
end
imp_edit_create_title_graphic
end
#-----------------------------------------------------------------------------
# Overwritten for fading in background and menu.
#-----------------------------------------------------------------------------
def update
if !$STILL_BG
@stage = 1 if @stage.nil?
@timer = 0 if @timer.nil?
case @stage
when 1
#-----------------------------------------------------------------------
# Wait 30 frames.
#-----------------------------------------------------------------------
@wave.update
update_background_animation
@timer += 1
if @timer >= 30
@timer = 0
@stage = 2
end
when 2
#-----------------------------------------------------------------------
# Fade in logo.
#-----------------------------------------------------------------------
@wave.update
update_background_animation
@s[0].opacity += SPEED_OF_LOGO_FADEIN
if @s[0].opacity >= 255
@stage = 3
end
when 3
#-----------------------------------------------------------------------
# Wait 90 frames.
#-----------------------------------------------------------------------
@wave.update
update_background_animation
@timer += 1
if @timer >= 90
@timer = 0
@stage = 4
end
when 4
@wave.update
update_background_animation
for i in 1..@s.size
a = i == 1 and @continue_enabled
b = i == 2 and !@continue_enabled
@s[i].opacity += SPEED_OF_MENU_FADEIN unless a or b
end
if @s[3].opacity >= 255
@SPARK_COUNT = 350
@stage = 5
end
when 5
@wave.update
update_background_animation
update_symbol_animation
update_spark_animation
update_menu_animation
check_menu
update_input
end
end
end
#-----------------------------------------------------------------------------
# Edited to make the different updates their own methods.
#-----------------------------------------------------------------------------
def update_background_animation
if @sprite.oy != 0
@sprite.oy -= 1
elsif @sprite.oy == 0
@sprite.ox += 1
end
if @wave.oy != 0
@wave.oy -= 1
elsif @wave.oy == 0
if @TITLE_LOOP == 1 && @wave.ox != 1289
@wave.ox += 1
else
@TITLE_LOOP == 2
end
if @TITLE_LOOP == 2 && @wave.ox != -118
@wave.ox -= 1
else
@TITLE_LOOP == 1
end
end
end
def update_symbol_animation
@s[7].ox -= @SYMBOL_SPEED
@SYMBOL_RESET = false if @SYMBOL_RESET == true && @s[7].opacity == 0
@s[7].opacity += 3 if @s[7].opacity != 255
end
def update_spark_animation
@s[8].x += @SPARK_SPEED
@s[9].x -= @SPARK_SPEED
if @SPARK_COUNT != 0
@SPARK_COUNT -= 1
else
@SPARK_COUNT = 350
@s[8].x = -172
@s[9].x = 544
end
if @s[8].opacity != 255
@s[8].opacity += 20
@s[9].opacity += 20
end
end
def update_menu_animation
case @command_window.index
when 0 #New game
@s[8].y = @MENU_NEW - 20
@s[7].oy = @MENU_NEW + 183
@s[5].y = @s[6].y = @s[9].y = @MENU_NEW
if @s[1].opacity != 255
@s[1].opacity += 20
@s[2].opacity -= 20
@s[3].opacity -= 20
end
@s[4].y -= 5 if @s[4].y != @TITLE_MENU_Y
when 1 #Continue
@s[8].y = @MENU_CONTINUE - 20
@s[7].oy = @MENU_CONTINUE + 93
@s[5].y = @s[6].y = @s[9].y = @MENU_CONTINUE
if @s[2].opacity != 255
@s[2].opacity += 20
@s[1].opacity -= 20
@s[3].opacity -= 20
end
if @s[4].y != @MENU_CONTINUE && @s[4].y < @MENU_CONTINUE
@s[4].y += 5
elsif @s[4].y != @MENU_CONTINUE && @s[4].y > @MENU_CONTINUE
@s[4].y -= 5
end
when 2 #Shutdown
@s[8].y = @MENU_EXIT - 20
@s[7].oy = @MENU_EXIT + 13
@s[5].y = @s[6].y = @s[9].y = @MENU_EXIT
if @s[3].opacity != 255
@s[3].opacity += 20
@s[1].opacity -= 20
@s[2].opacity -= 20
end
@s[4].y += 5 if @s[4].y != @MENU_EXIT
end
@command_window.update
@s[5].x += 11 if @s[5].x != 0
@s[6].x -= 12 if @s[6].x != 308
end
end
def update_input
if Input.trigger?(Input::C)
case @command_window.index
when 0 #New game
command_new_game
when 1 # Continue
command_continue
when 2 # Shutdown
command_shutdown
end
end
end
end
IMP1- Coding Moderator
- Posts : 503
Gald : 1399
Stats
Cookies: 5
Re: Need help with a script!
@Peva: Well, they decided that I was not worthy of coming back to their forums... so I got banned again, but they did manage to send a list of greviances that Elf comitted while there!
@IMP1: XD Alright, lets see if this works now!
@IMP1: XD Alright, lets see if this works now!
The Creator- Legendary
- Posts : 786
Gald : 920
Stats
Cookies: 0
Re: Need help with a script!
- Code:
#==============================================================================
# Hanzo Kimura's Animated Title Screen, a re-do by Speed.
# Scripted Date: 02/24/09
# PLEASE CREDIT: Hanzo Kimura and Speed for the edit
# if you are going to use this script for your title.
#
# IMAGES USED(All in Graphics/System) Folder:
# "TitleBGLoop.jpg" - For Scrolling Upward Effect
# "TitleBGSprite.jpg" - For Horizantally Endless Scrolling
# "TitleCursor.png" - For the title cursor
# "TitleMenu01.png" - For the title Menu (First Menu Active)
# "TitleMenu02.png" - For the title Menu (Second Menu Active)
# "TitleMenu03.png" - For the title Menu (Third Menu Active)
# "TitleLogo.png" - For the Title Logo
# "TitleSpark01.png" - For the Title Spark
# "TitleSpark02.png" - For the Title Spark
# "TitleSymbol.png" - For the Title Symbol
# "TitleCursorStrike01.png" - For Title Cursor Strike Effect(Left)
# "TitleCursorStrike02.png" - For Title Cursor Strike Effect(Right)
# **"TitleBG.jpg" - For Still Version Title Background
#
# RE-CODE by Speed:
# - Removed unneccecary duplicate code from Scene_Title
# - Aliased what I can, it's not compatible with other scripts, but still
# it saves lines and duplicate code.
# - Removed disposal of unneccecary objects (if you dispose @sprite, you don't
# need to dispose @sprite.bitmap after that)
# - Added an array for the image objects, for faster disposal and removes of
# duplicate code.
# - Fixed unneccecary if blocks.
# - Removed all global variables except $STILL_BG, since you won't change
# the speed and everything in game it's unneccecary, consumes memory and
# it's dangerous as it can kill other scripts.
# - Moved the variables into a start method (initializing them).
# - Changed @wave.dispose if @wave != nil
# now more robust, because now it disposes the sprite if it was created,
# before you could turn off the $STILL_BG in title and it would keep the
# background on screen if you would change scenes.
# - More minor things. All and all, the script is now less dangerous and
# obtrusive, and the number of lines of code was halved.
#
# IF YOU FIND ANY BUGS REPORT HERE:
# http://www.rpgmakervx.net/index.php?showtopic=16133&st=60
#==============================================================================
$STILL_BG = false # true=Still Background false=Animated Background.
#-|-|-|-|-|-|-|-|-|-|-|-|-|-|-|-|-|-|-|-|-|-|-|-|-|-|-|-|-|-|-|-|-|-|-|-|-\
#----|Scene_Title|--------------------------------------------------------/
#-|-|-|-|-|-|-|-|-|-|-|-|-|-|-|-|-|-|-|-|-|-|-|-|-|-|-|-|-|-|-|-|-|-|-|-|-\
#--This class performs the title screen processing.-----------------------/
#========================================================================/
class Scene_Title < Scene_Base
#--------------------------------------------------------------------------
# * Start (Alias) | EDITING AREA
#--------------------------------------------------------------------------
alias :start_oldie_speed :start
def start
#NEW FUNCTIONS
@TITLE_MENU_X = 184 # Menu X Position
@TITLE_MENU_Y = 260 # Menu Y Position
@LOGO_X = 0 # Logo X Position
@LOGO_Y = 0 # Logo Y Position
@SPARK_COUNT = 350 # SPARK COUNT: Frames before the spark appears again
@SPARK_SPEED = 10 # The speed of the sparks
@MENU_NEW = 260 # THE Y Position of the cursor on NEW GAME
@MENU_CONTINUE = 305 # THE Y Position of the cursor on CONTINUE
@MENU_EXIT = 345 # THE Y Position of the cursor on EXIT
@SYMBOL_SPEED = 1
#-|-|-|-|-|-|-|-|-|-|-|-|-|-|-|-|-|-|-|-|-|-|-|-|-|-|-|-|-|-|-|-|-|-|-|-|-\
#---|DO NOT EDIT BELOW!|--------------------------------------------------/
#-|-|-|-|-|-|-|-|-|-|-|-|-|-|-|-|-|-|-|-|-|-|-|-|-|-|-|-|-|-|-|-|-|-|-|-|-\
#========================================================================/
@SYMBOL_RESET = false
start_oldie_speed
end
#--------------------------------------------------------------------------
# * Frame Update (Overwrite)
#--------------------------------------------------------------------------
def update
super
if $STILL_BG == false
#=======Wave Animation=========
@wave.update
#=====Background Animation=====
if @sprite.oy != 0
@sprite.oy -= 1
elsif @sprite.oy == 0
@sprite.ox += 1
end
if @wave.oy != 0
@wave.oy -= 1
elsif @wave.oy == 0
if @TITLE_LOOP == 1 && @wave.ox != 1289
@wave.ox += 1
else
@TITLE_LOOP == 2
end
if @TITLE_LOOP == 2 && @wave.ox != -1189
@wave.ox -= 1
else
@TITLE_LOOP == 1
end
end
end
#=======Symbol Animation=======
@s[7].ox -= @SYMBOL_SPEED
@SYMBOL_RESET = false if @SYMBOL_RESET == true && @s[7].opacity == 0
@s[7].opacity += 3 if @s[7].opacity != 255
#=======Spark Animation========
@s[8].x += @SPARK_SPEED
@s[9].x -= @SPARK_SPEED
if @SPARK_COUNT != 0
@SPARK_COUNT -= 1
else
@SPARK_COUNT = 350
@s[8].x = -172
@s[9].x = 544
end
if @s[8].opacity != 255
@s[8].opacity += 20
@s[9].opacity += 20
end
#=======Menu Animation=========
case @command_window.index
when 0 #New game
@s[8].y = @MENU_NEW - 20
@s[7].oy = @MENU_NEW + 183
@s[5].y = @s[6].y = @s[9].y = @MENU_NEW
if @s[1].opacity != 255
@s[1].opacity += 20
@s[2].opacity -= 20
@s[3].opacity -= 20
end
@s[4].y -= 5 if @s[4].y != @TITLE_MENU_Y
when 1 #Continue
@s[8].y = @MENU_CONTINUE - 20
@s[7].oy = @MENU_CONTINUE + 93
@s[5].y = @s[6].y = @s[9].y = @MENU_CONTINUE
if @s[2].opacity != 255
@s[2].opacity += 20
@s[1].opacity -= 20
@s[3].opacity -= 20
end
if @s[4].y != @MENU_CONTINUE && @s[4].y < @MENU_CONTINUE
@s[4].y += 5
elsif @s[4].y != @MENU_CONTINUE && @s[4].y > @MENU_CONTINUE
@s[4].y -= 5
end
when 2 #Shutdown
@s[8].y = @MENU_EXIT - 20
@s[7].oy = @MENU_EXIT + 13
@s[5].y = @s[6].y = @s[9].y = @MENU_EXIT
if @s[3].opacity != 255
@s[3].opacity += 20
@s[1].opacity -= 20
@s[2].opacity -= 20
end
@s[4].y += 5 if @s[4].y != @MENU_EXIT
end
@command_window.update
#====Cursor Animation=====
@s[5].x += 11 if @s[5].x != 0
@s[6].x -= 12 if @s[6].x != 308
check_menu
if Input.trigger?(Input::C)
case @command_window.index
when 0 #New game
command_new_game
when 1 # Continue
command_continue
when 2 # Shutdown
command_shutdown
end
end
end
#--------------------------------------------------------------------------
# * Checking Current Menu (Overwrite)
#--------------------------------------------------------------------------
def check_menu
if Input.trigger?(Input::UP) or Input.trigger?(Input::DOWN)
@SPARK_COUNT = 350
@s[8].x = -172; @s[9].x = 640
@s[8].opacity = @s[9].opacity = @s[7].opacity = 0
@SYMBOL_RESET = true
@s[5].x = -330; @s[6].x = 680
case @command_window.index
when 0 #New game
@s[8].y = 280; @s[9].y = 300
@s[7].oy = 403
@s[5].y = @s[6].y = 300
when 1 # Continue
@s[8].y = 325; @s[9].y = 345
@s[7].oy = 358
@s[5].y = @s[6].y = 345
when 2 # Shutdown
@s[8].y = 365; @s[9].y = 385
@s[7].oy = 317
@s[5].y = @s[6].y = 385
end
end
end
#--------------------------------------------------------------------------
# * Create Title Graphic (Overwrite)
#--------------------------------------------------------------------------
def create_title_graphic
@viewport1 = Viewport.new(0, 0, 1288, 891)
@viewport2 = Viewport.new(0, 0, 824, 480)
@viewport2.z = 10
if $STILL_BG == false
@sprite = Plane.new(@viewport1)
@sprite.bitmap = Cache.system("TitleBGLoop")
@sprite.oy = 371; @sprite.ox = 100; @sprite.z = -100
@wave = Sprite.new(@viewport1)
@wave.bitmap = Cache.system("TitleBGSprite")
@wave.oy = 371; @wave.ox = 100; @wave.wave_amp = 50; @wave.wave_length = 440
@wave.wave_speed = 1250; @wave.opacity = 125; @wave.z = 5
else
@sprite = Sprite.new
@sprite.bitmap = Cache.system("TitleBG")
@sprite.y = @sprite.x = 0; @sprite.z = -100
end
#sprite array
@s = []
for i in 0...10
@s[i] = Sprite.new
end
#logo
@s[0].bitmap = Cache.system("TitleLogo")
@s[0].x = @LOGO_X; @s[0].y = @LOGO_Y; @s[0].z = 10
#menu01, menu 02, menu 03
@s[1].bitmap = Cache.system("TitleMenu01")
@s[2].bitmap = Cache.system("TitleMenu02")
@s[3].bitmap = Cache.system("TitleMenu03")
@s[2].opacity = @s[3].opacity = 0
@s[1].x = @s[2].x = @s[3].x = @TITLE_MENU_X
@s[1].y = @s[2].y = @s[3].y = @TITLE_MENU_Y
#cursor
@s[4].bitmap = Cache.system("TitleCursor")
@s[4].x = @TITLE_MENU_X; @s[4].y = @TITLE_MENU_Y; @s[4].z = 12
#strike1, strike2
@s[5].bitmap = Cache.system("TitleCursorStrike01")
@s[5].x = 0; @s[5].y = 260; @s[5].z = 9
@s[6].bitmap = Cache.system("TitleCursorStrike02")
@s[6].x = 308; @s[6].y = 260; @s[6].z = 9
#symbol
@s[7] = Plane.new(@viewport2)
@s[7].bitmap = Cache.system("TitleSymbol")
@s[7].oy = 443; @s[7].ox = 100
#spark01, spark02
@s[8].bitmap = Cache.system("TitleSpark01")
@s[8].y = 280; @s[8].x = -172; @s[8].z = 12
@s[9].bitmap = Cache.system("TitleSpark02")
@s[9].y = 300; @s[9].x = 640; @s[9].z = 12
@s[1].z = @s[2].z = @s[3].z = 13
if @continue_enabled
@s[1].opacity = 0; @s[2].opacity = 255
@s[4].y = 305; @s[5].y = 305; @s[6].y = 305
@s[7].oy = 398
end
end
#--------------------------------------------------------------------------
# * Dispose of Title Graphic (Overwrite)
#--------------------------------------------------------------------------
def dispose_title_graphic
@wave.dispose if @wave != nil
@sprite.dispose
for i in 0...@s.size
@s[i].dispose
end
end
#--------------------------------------------------------------------------
# * Create Command Window (Alias)
#--------------------------------------------------------------------------
alias :create_command_window_oldie_speed :create_command_window
def create_command_window
create_command_window_oldie_speed
@command_window.x = (Graphics.width - @command_window.width) / 2
@command_window.y = 998
end
end
I got Another error... something with the end... Also but the script in code tages so that you could use it better! Anyways, hope this helps!
The Creator- Legendary
- Posts : 786
Gald : 920
Stats
Cookies: 0
Re: Need help with a script!
If it says the error is at a certain line, report the line\s here as well.
mitchi.exe- Resource Moderator
- Posts : 409
Gald : 1920
Stats
Cookies: 10
Re: Need help with a script!
Ok, right off the bat, you haven't copied the script you're using. The error says that there's a syntax error on line 479, but the script you just put in code tags is only 282 lines long.
IMP1- Coding Moderator
- Posts : 503
Gald : 1399
Stats
Cookies: 5
Re: Need help with a script!
Ha, oops... that was actually my fault... I was trying out variations of places to place it... here is the real error
The Creator- Legendary
- Posts : 786
Gald : 920
Stats
Cookies: 0
Re: Need help with a script!
Hrmm... now its saying the error is on line 197 of the addon script that you gave me to try... How strange!
The Creator- Legendary
- Posts : 786
Gald : 920
Stats
Cookies: 0
Re: Need help with a script!
try chucking another 'end' (sans quotation marks) on a new line (line 198)
IMP1- Coding Moderator
- Posts : 503
Gald : 1399
Stats
Cookies: 5
Re: Need help with a script!
hmm, gotcha! Ill give it a shot!
* edit * Same error... posting layout also...
* edit * Same error... posting layout also...
The Creator- Legendary
- Posts : 786
Gald : 920
Stats
Cookies: 0
Re: Need help with a script!
I've pretty much forgotten what this whole code is, and I might just start again if i can't get it done soon. Try this (replaceing the whole fix with it):
- Code:
class Scene_Title
FADE_OUT_FRAME_LENGTH = 300
SPEED_OF_LOGO_FADEIN = 1
SPEED_OF_MENU_FADEIN = 1
#-----------------------------------------------------------------------------
# Overwritten to make fade out longer
#-----------------------------------------------------------------------------
def command_new_game
confirm_player_location
Sound.play_decision
$game_party.setup_starting_members # Initial party
$game_map.setup($data_system.start_map_id) # Initial map position
$game_player.moveto($data_system.start_x, $data_system.start_y)
$game_player.refresh
$scene = Scene_Map.new
RPG::BGM.fade(FADE_OUT_FRAME_LENGTH+(1500-60))
close_command_window
Graphics.fadeout(FADE_OUT_FRAME_LENGTH)
Graphics.wait(40)
Graphics.frame_count = 0
RPG::BGM.stop
$game_map.autoplay
end
#-----------------------------------------------------------------------------
# Aliased to make certain things not opaque to begin with.
#-----------------------------------------------------------------------------
alias imp_edit_create_title_graphic create_title_graphic unless $@
def create_title_graphic
for i in 0..@s.size
@s[i].opacity = 0
end
imp_edit_create_title_graphic
end
#-----------------------------------------------------------------------------
# Overwritten for fading in background and menu.
#-----------------------------------------------------------------------------
def update
if !$STILL_BG
@stage = 1 if @stage.nil?
@timer = 0 if @timer.nil?
case @stage
when 1
#-----------------------------------------------------------------------
# Wait 30 frames.
#-----------------------------------------------------------------------
@wave.update
update_background_animation
@timer += 1
if @timer >= 30
@timer = 0
@stage = 2
end
when 2
#-----------------------------------------------------------------------
# Fade in logo.
#-----------------------------------------------------------------------
@wave.update
update_background_animation
@s[0].opacity += SPEED_OF_LOGO_FADEIN
if @s[0].opacity >= 255
@stage = 3
end
when 3
#-----------------------------------------------------------------------
# Wait 90 frames.
#-----------------------------------------------------------------------
@wave.update
update_background_animation
@timer += 1
if @timer >= 90
@timer = 0
@stage = 4
end
when 4
@wave.update
update_background_animation
for i in 1..@s.size
a = i == 1 and @continue_enabled
b = i == 2 and !@continue_enabled
@s[i].opacity += SPEED_OF_MENU_FADEIN unless a or b
end
if @s[3].opacity >= 255
@SPARK_COUNT = 350
@stage = 5
end
when 5
@wave.update
update_background_animation
update_symbol_animation
update_spark_animation
update_menu_animation
check_menu
update_input
end
end
end
#-----------------------------------------------------------------------------
# Edited to make the different updates their own methods.
#-----------------------------------------------------------------------------
def update_background_animation
if @sprite.oy != 0
@sprite.oy -= 1
elsif @sprite.oy == 0
@sprite.ox += 1
end
if @wave.oy != 0
@wave.oy -= 1
elsif @wave.oy == 0
if @TITLE_LOOP == 1 && @wave.ox != 1289
@wave.ox += 1
else
@TITLE_LOOP == 2
end
if @TITLE_LOOP == 2 && @wave.ox != -118
@wave.ox -= 1
else
@TITLE_LOOP == 1
end
end
end
def update_symbol_animation
@s[7].ox -= @SYMBOL_SPEED
@SYMBOL_RESET = false if @SYMBOL_RESET == true && @s[7].opacity == 0
@s[7].opacity += 3 if @s[7].opacity != 255
end
def update_spark_animation
@s[8].x += @SPARK_SPEED
@s[9].x -= @SPARK_SPEED
if @SPARK_COUNT != 0
@SPARK_COUNT -= 1
else
@SPARK_COUNT = 350
@s[8].x = -172
@s[9].x = 544
end
if @s[8].opacity != 255
@s[8].opacity += 20
@s[9].opacity += 20
end
end
def update_menu_animation
case @command_window.index
when 0 #New game
@s[8].y = @MENU_NEW - 20
@s[7].oy = @MENU_NEW + 183
@s[5].y = @MENU_NEW
@s[6].y = @MENU_NEW
@s[9].y = @MENU_NEW
if @s[1].opacity != 255
@s[1].opacity += 20
@s[2].opacity -= 20
@s[3].opacity -= 20
end
@s[4].y -= 5 if @s[4].y != @TITLE_MENU_Y
when 1 #Continue
@s[8].y = @MENU_CONTINUE - 20
@s[7].oy = @MENU_CONTINUE + 93
@s[5].y = @s[6].y = @s[9].y = @MENU_CONTINUE
if @s[2].opacity != 255
@s[2].opacity += 20
@s[1].opacity -= 20
@s[3].opacity -= 20
end
if @s[4].y != @MENU_CONTINUE && @s[4].y < @MENU_CONTINUE
@s[4].y += 5
elsif @s[4].y != @MENU_CONTINUE && @s[4].y > @MENU_CONTINUE
@s[4].y -= 5
end
when 2 #Shutdown
@s[8].y = @MENU_EXIT - 20
@s[7].oy = @MENU_EXIT + 13
@s[5].y = @s[6].y = @s[9].y = @MENU_EXIT
if @s[3].opacity != 255
@s[3].opacity += 20
@s[1].opacity -= 20
@s[2].opacity -= 20
end
@s[4].y += 5 if @s[4].y != @MENU_EXIT
end
@command_window.update
@s[5].x += 11 if @s[5].x != 0
@s[6].x -= 12 if @s[6].x != 308
end
def update_input
if Input.trigger?(Input::C)
case @command_window.index
when 0 #New game
command_new_game
when 1 # Continue
command_continue
when 2 # Shutdown
command_shutdown
end
end
end
end
IMP1- Coding Moderator
- Posts : 503
Gald : 1399
Stats
Cookies: 5
Re: Need help with a script!
Got anohter error... posting below
The Creator- Legendary
- Posts : 786
Gald : 920
Stats
Cookies: 0
Re: Need help with a script!
- Code:
class Scene_Title
FADE_OUT_FRAME_LENGTH = 300
SPEED_OF_LOGO_FADEIN = 1
SPEED_OF_MENU_FADEIN = 1
#-----------------------------------------------------------------------------
# Overwritten to make fade out longer
#-----------------------------------------------------------------------------
def command_new_game
confirm_player_location
Sound.play_decision
$game_party.setup_starting_members # Initial party
$game_map.setup($data_system.start_map_id) # Initial map position
$game_player.moveto($data_system.start_x, $data_system.start_y)
$game_player.refresh
$scene = Scene_Map.new
RPG::BGM.fade(FADE_OUT_FRAME_LENGTH+(1500-60))
close_command_window
Graphics.fadeout(FADE_OUT_FRAME_LENGTH)
Graphics.wait(40)
Graphics.frame_count = 0
RPG::BGM.stop
$game_map.autoplay
end
#-----------------------------------------------------------------------------
# Aliased to make certain things not opaque to begin with.
#-----------------------------------------------------------------------------
alias imp_edit_create_title_graphic create_title_graphic unless $@
def create_title_graphic
imp_edit_create_title_graphic
for i in 0..@s.size
@s[i].opacity = 0
end
end
#-----------------------------------------------------------------------------
# Overwritten for fading in background and menu.
#-----------------------------------------------------------------------------
def update
if !$STILL_BG
@stage = 1 if @stage.nil?
@timer = 0 if @timer.nil?
case @stage
when 1
#-----------------------------------------------------------------------
# Wait 30 frames.
#-----------------------------------------------------------------------
@wave.update
update_background_animation
@timer += 1
if @timer >= 30
@timer = 0
@stage = 2
end
when 2
#-----------------------------------------------------------------------
# Fade in logo.
#-----------------------------------------------------------------------
@wave.update
update_background_animation
@s[0].opacity += SPEED_OF_LOGO_FADEIN
if @s[0].opacity >= 255
@stage = 3
end
when 3
#-----------------------------------------------------------------------
# Wait 90 frames.
#-----------------------------------------------------------------------
@wave.update
update_background_animation
@timer += 1
if @timer >= 90
@timer = 0
@stage = 4
end
when 4
@wave.update
update_background_animation
for i in 1..@s.size
a = i == 1 and @continue_enabled
b = i == 2 and !@continue_enabled
@s[i].opacity += SPEED_OF_MENU_FADEIN unless a or b
end
if @s[3].opacity >= 255
@SPARK_COUNT = 350
@stage = 5
end
when 5
@wave.update
update_background_animation
update_symbol_animation
update_spark_animation
update_menu_animation
check_menu
update_input
end
end
end
#-----------------------------------------------------------------------------
# Edited to make the different updates their own methods.
#-----------------------------------------------------------------------------
def update_background_animation
if @sprite.oy != 0
@sprite.oy -= 1
elsif @sprite.oy == 0
@sprite.ox += 1
end
if @wave.oy != 0
@wave.oy -= 1
elsif @wave.oy == 0
if @TITLE_LOOP == 1 && @wave.ox != 1289
@wave.ox += 1
else
@TITLE_LOOP == 2
end
if @TITLE_LOOP == 2 && @wave.ox != -118
@wave.ox -= 1
else
@TITLE_LOOP == 1
end
end
end
def update_symbol_animation
@s[7].ox -= @SYMBOL_SPEED
@SYMBOL_RESET = false if @SYMBOL_RESET == true && @s[7].opacity == 0
@s[7].opacity += 3 if @s[7].opacity != 255
end
def update_spark_animation
@s[8].x += @SPARK_SPEED
@s[9].x -= @SPARK_SPEED
if @SPARK_COUNT != 0
@SPARK_COUNT -= 1
else
@SPARK_COUNT = 350
@s[8].x = -172
@s[9].x = 544
end
if @s[8].opacity != 255
@s[8].opacity += 20
@s[9].opacity += 20
end
end
def update_menu_animation
case @command_window.index
when 0 #New game
@s[8].y = @MENU_NEW - 20
@s[7].oy = @MENU_NEW + 183
@s[5].y = @MENU_NEW
@s[6].y = @MENU_NEW
@s[9].y = @MENU_NEW
if @s[1].opacity != 255
@s[1].opacity += 20
@s[2].opacity -= 20
@s[3].opacity -= 20
end
@s[4].y -= 5 if @s[4].y != @TITLE_MENU_Y
when 1 #Continue
@s[8].y = @MENU_CONTINUE - 20
@s[7].oy = @MENU_CONTINUE + 93
@s[5].y = @s[6].y = @s[9].y = @MENU_CONTINUE
if @s[2].opacity != 255
@s[2].opacity += 20
@s[1].opacity -= 20
@s[3].opacity -= 20
end
if @s[4].y != @MENU_CONTINUE && @s[4].y < @MENU_CONTINUE
@s[4].y += 5
elsif @s[4].y != @MENU_CONTINUE && @s[4].y > @MENU_CONTINUE
@s[4].y -= 5
end
when 2 #Shutdown
@s[8].y = @MENU_EXIT - 20
@s[7].oy = @MENU_EXIT + 13
@s[5].y = @s[6].y = @s[9].y = @MENU_EXIT
if @s[3].opacity != 255
@s[3].opacity += 20
@s[1].opacity -= 20
@s[2].opacity -= 20
end
@s[4].y += 5 if @s[4].y != @MENU_EXIT
end
@command_window.update
@s[5].x += 11 if @s[5].x != 0
@s[6].x -= 12 if @s[6].x != 308
end
def update_input
if Input.trigger?(Input::C)
case @command_window.index
when 0 #New game
command_new_game
when 1 # Continue
command_continue
when 2 # Shutdown
command_shutdown
end
end
end
end
IMP1- Coding Moderator
- Posts : 503
Gald : 1399
Stats
Cookies: 5
Re: Need help with a script!
- Code:
class Scene_Title
FADE_OUT_FRAME_LENGTH = 300
SPEED_OF_LOGO_FADEIN = 1
SPEED_OF_MENU_FADEIN = 1
#-----------------------------------------------------------------------------
# Overwritten to make fade out longer
#-----------------------------------------------------------------------------
def command_new_game
confirm_player_location
Sound.play_decision
$game_party.setup_starting_members # Initial party
$game_map.setup($data_system.start_map_id) # Initial map position
$game_player.moveto($data_system.start_x, $data_system.start_y)
$game_player.refresh
$scene = Scene_Map.new
RPG::BGM.fade(FADE_OUT_FRAME_LENGTH+(1500-60))
close_command_window
Graphics.fadeout(FADE_OUT_FRAME_LENGTH)
Graphics.wait(40)
Graphics.frame_count = 0
RPG::BGM.stop
$game_map.autoplay
end
#-----------------------------------------------------------------------------
# Aliased to make certain things not opaque to begin with.
#-----------------------------------------------------------------------------
alias imp_edit_create_title_graphic create_title_graphic unless $@
def create_title_graphic
imp_edit_create_title_graphic
for i in 0...@s.size
@s[i].opacity = 0
end
end
#-----------------------------------------------------------------------------
# Overwritten for fading in background and menu.
#-----------------------------------------------------------------------------
def update
if !$STILL_BG
@stage = 1 if @stage.nil?
@timer = 0 if @timer.nil?
case @stage
when 1
#-----------------------------------------------------------------------
# Wait 30 frames.
#-----------------------------------------------------------------------
@wave.update
update_background_animation
@timer += 1
if @timer >= 30
@timer = 0
@stage = 2
end
when 2
#-----------------------------------------------------------------------
# Fade in logo.
#-----------------------------------------------------------------------
@wave.update
update_background_animation
@s[0].opacity += SPEED_OF_LOGO_FADEIN
if @s[0].opacity >= 255
@stage = 3
end
when 3
#-----------------------------------------------------------------------
# Wait 90 frames.
#-----------------------------------------------------------------------
@wave.update
update_background_animation
@timer += 1
if @timer >= 90
@timer = 0
@stage = 4
end
when 4
@wave.update
update_background_animation
for i in 1...@s.size
a = i == 1 and @continue_enabled
b = i == 2 and !@continue_enabled
@s[i].opacity += SPEED_OF_MENU_FADEIN unless a or b
end
if @s[3].opacity >= 255
@SPARK_COUNT = 350
@stage = 5
end
when 5
@wave.update
update_background_animation
update_symbol_animation
update_spark_animation
update_menu_animation
check_menu
update_input
end
end
end
#-----------------------------------------------------------------------------
# Edited to make the different updates their own methods.
#-----------------------------------------------------------------------------
def update_background_animation
if @sprite.oy != 0
@sprite.oy -= 1
elsif @sprite.oy == 0
@sprite.ox += 1
end
if @wave.oy != 0
@wave.oy -= 1
elsif @wave.oy == 0
if @TITLE_LOOP == 1 && @wave.ox != 1289
@wave.ox += 1
else
@TITLE_LOOP == 2
end
if @TITLE_LOOP == 2 && @wave.ox != -118
@wave.ox -= 1
else
@TITLE_LOOP == 1
end
end
end
def update_symbol_animation
@s[7].ox -= @SYMBOL_SPEED
@SYMBOL_RESET = false if @SYMBOL_RESET == true && @s[7].opacity == 0
@s[7].opacity += 3 if @s[7].opacity != 255
end
def update_spark_animation
@s[8].x += @SPARK_SPEED
@s[9].x -= @SPARK_SPEED
if @SPARK_COUNT != 0
@SPARK_COUNT -= 1
else
@SPARK_COUNT = 350
@s[8].x = -172
@s[9].x = 544
end
if @s[8].opacity != 255
@s[8].opacity += 20
@s[9].opacity += 20
end
end
def update_menu_animation
case @command_window.index
when 0 #New game
@s[8].y = @MENU_NEW - 20
@s[7].oy = @MENU_NEW + 183
@s[5].y = @MENU_NEW
@s[6].y = @MENU_NEW
@s[9].y = @MENU_NEW
if @s[1].opacity != 255
@s[1].opacity += 20
@s[2].opacity -= 20
@s[3].opacity -= 20
end
@s[4].y -= 5 if @s[4].y != @TITLE_MENU_Y
when 1 #Continue
@s[8].y = @MENU_CONTINUE - 20
@s[7].oy = @MENU_CONTINUE + 93
@s[5].y = @s[6].y = @s[9].y = @MENU_CONTINUE
if @s[2].opacity != 255
@s[2].opacity += 20
@s[1].opacity -= 20
@s[3].opacity -= 20
end
if @s[4].y != @MENU_CONTINUE && @s[4].y < @MENU_CONTINUE
@s[4].y += 5
elsif @s[4].y != @MENU_CONTINUE && @s[4].y > @MENU_CONTINUE
@s[4].y -= 5
end
when 2 #Shutdown
@s[8].y = @MENU_EXIT - 20
@s[7].oy = @MENU_EXIT + 13
@s[5].y = @s[6].y = @s[9].y = @MENU_EXIT
if @s[3].opacity != 255
@s[3].opacity += 20
@s[1].opacity -= 20
@s[2].opacity -= 20
end
@s[4].y += 5 if @s[4].y != @MENU_EXIT
end
@command_window.update
@s[5].x += 11 if @s[5].x != 0
@s[6].x -= 12 if @s[6].x != 308
end
def update_input
if Input.trigger?(Input::C)
case @command_window.index
when 0 #New game
command_new_game
when 1 # Continue
command_continue
when 2 # Shutdown
command_shutdown
end
end
end
end
IMP1- Coding Moderator
- Posts : 503
Gald : 1399
Stats
Cookies: 5
Re: Need help with a script!
Wait a sec... that actually works!!! You did it! Thank you so much for this IMP1!
The Creator- Legendary
- Posts : 786
Gald : 920
Stats
Cookies: 0
Re: Need help with a script!
Jesus christ.....
I'm glad it works (finally). Never let it be said I give up on people >.<
May I close this on up and forget all about it?
I'm glad it works (finally). Never let it be said I give up on people >.<
May I close this on up and forget all about it?
IMP1- Coding Moderator
- Posts : 503
Gald : 1399
Stats
Cookies: 5
Re: Need help with a script!
Lol, yes... please do!
The Creator- Legendary
- Posts : 786
Gald : 920
Stats
Cookies: 0
Page 1 of 1
Permissions in this forum:
You cannot reply to topics in this forum
|
|