Submit Your Article


 
RPG Maker

Welcome Guest ( Log In | Register )


  Games Resources RPG Maker VX RPG Maker XP Scripts Tutorials Downloads

 
Reply to this topicStart new topic
> Pre Title Splash Screen, or, what have I done wrong?
rabidmoogle
post Dec 9 2012, 04:01 PM
Post #1



Group Icon

Group: Member
Posts: 2
Type: Writer
RM Skill: Undisclosed




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
Go to the top of the page
 
+Quote Post
   
Thallion
post Dec 9 2012, 04:19 PM
Post #2


Level 5
Group Icon

Group: Member
Posts: 68
Type: Scripter
RM Skill: Skilled
Rev Points: 10




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.
Go to the top of the page
 
+Quote Post
   
rabidmoogle
post Dec 10 2012, 09:17 AM
Post #3



Group Icon

Group: Member
Posts: 2
Type: Writer
RM Skill: Undisclosed




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
Go to the top of the page
 
+Quote Post
   
Thallion
post Dec 10 2012, 10:19 AM
Post #4


Level 5
Group Icon

Group: Member
Posts: 68
Type: Scripter
RM Skill: Skilled
Rev Points: 10




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.
Go to the top of the page
 
+Quote Post
   

Reply to this topicStart new topic
1 User(s) are reading this topic (1 Guests and 0 Anonymous Users)
0 Members:

 

Lo-Fi Version Time is now: 21st May 2013 - 08:23 AM
RPG RPG Revolution is an Privacy Policy and Legal
eXTReMe Tracker