Help - Search - Members - Calendar
Full Version: Pre Title Splash Screen
RPG RPG Revolution Forums > Scripting > Script Development and Support
rabidmoogle
Hello!

I tried to make a script that puts a splash screen before the title screen, and it works, except for one little detail. I can't seem to get it to skip to the title screen by pressing the specified button (C in this case) confused.gif . Some help would be appreciated.

Here is the script
CODE
class Scene_Splash < Scene_Base

  def start
    super
    SceneManager.clear
    Graphics.freeze
    create_background
  end
  
  def create_background
    @sprite = Sprite.new
    @sprite.bitmap = Cache.picture("Untitled")
  end
  
  def update
    if Input.press?(:C)
      Graphics.fadeout(20)
      SceneManager.call(Scene_Title)
    else
      Graphics.wait(320)
      Graphics.fadeout(20)
      SceneManager.call(Scene_Title)
    end
  end
  
  def dispose_background
    @sprite.bitmap.dispose
    @sprite.dispose
  end
end

module SceneManager
  def self.first_scene_class
    $BTEST ? Scene_Battle : Scene_Splash
  end
end
Thallion
Try this:
CODE
class Scene_Splash < Scene_Base

  def start
    super
    SceneManager.clear
    Graphics.freeze
    create_background
    @frames = 0
  end
  
  def create_background
    @sprite = Sprite.new
    @sprite.bitmap = Cache.picture("Untitled")
  end
  
  def update
    if Input.press?(:C) or @frames > 320
      Graphics.fadeout(20)
      SceneManager.call(Scene_Title)
    end
    @frames += 1
  end
  
  def dispose_background
    @sprite.bitmap.dispose
    @sprite.dispose
  end
end

module SceneManager
  def self.first_scene_class
    $BTEST ? Scene_Battle : Scene_Splash
  end
end


What you were doing was starting the scene, then every time the scene updated checking if the C button was pressed. If it was, you would skip the splash screen and go to Scene_Title. Else, you would wait 320 frames and then go to Scene_Title. What I did was increment a variable every frame and if the C button was pressed or the variable was greater that 320 it would go to Scene_Title.
rabidmoogle
Okay, that helped a lot, and I also realized I missed a few imortant .update lines. pinch.gif
Anyway, it's working now, so thanks for the help. smile.gif

Here is the complete script, anyone can feel free to use it.

CODE
class Scene_Splash < Scene_Base

  def start
    super
    SceneManager.clear
    Graphics.freeze
    create_background
    @frames = 0
  end
  
  def create_background
    @sprite = Sprite.new
    @sprite.bitmap = Cache.picture("Untitled")
  end
  
  def update
    Graphics.update
    Input.update
    if Input.press?(:C) or @frames > 320
      Graphics.fadeout(20)
      SceneManager.call(Scene_Title)
    end
    @frames += 1
  end
  
  def dispose_background
    @sprite.bitmap.dispose
    @sprite.dispose
  end
end

module SceneManager
  def self.first_scene_class
    $BTEST ? Scene_Battle : Scene_Splash
  end
end
Thallion
You don't need the Graphics.update and the Input.update

The main method of Scene_Base automatically calls those methods right before the update method.
This is a "lo-fi" version of our main content. To view the full version with more information, formatting and images, please click here.
Invision Power Board © 2001-2013 Invision Power Services, Inc.