Thread Rating:
  • 0 Vote(s) - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
Scene_Chapter
#1
This is a locked, single-post thread from Creation Asylum. Archived here to prevent its loss.
No support is given.


Unless you want your project laughed at, do not use this script. It was my first script, and it blows balls. If you use this, I will hunt you down. I do not want credit in any way. Say Lumpy Hippo did it and leave it at that. Once again, I appologize for making such a lame script.

I am only keeping this to show all, that you start somewhere. Though I look at my code now, and say to myself "WTF was I on!", it's all evolution.

Goodbye.

DON'T USE THIS SCRIPT!



Ok Here's The Script Requested by chaingun.

It starts the game with Proceeding to a Chapter_Scene. Then, goes the game. Then, whenever a chapter is finished, it goes back to the Chapter_Scene, and Displays a Chapter End Sprite, Then a Chapter Begin Sprite. You need to make your own Chapter Screen and put them in folder "Graphics/Chapters" and name them "Chapter1start", "Chapter1end". "Chapter2start,...

Note: This uses game variable 1 and game variable 2. You can change it from the script.

First, go to Scene_Title, under command new_game, Find:

Code:
$scene=Scene_Map.new

and replace it with
Code:
$game_variables[1]=1
$game_variables[2]=1
$scene=Scene_Chapter.new

Then, under Scene_Title, add this script:
Code:
#Class Scene_Chapter
#Written by Sephiroth
#You need Pics in Folder "Pictures/Chapters"
#Name then ChapterXstart and ChapterXend
class Scene_Chapter
  def main
    @chapstart=Sprite.new
    @chapend=Sprite.new
    @chapstart.bitmap=RPG::Cache.picture("Chapters/Chapter1start")
    @chapend.bitmap=RPG::Cache.picture("Chapters/Chapter1end")
    @chapstart.opacity=0
    @chapend.opacity=0
    @fadespeed1=5
    @fadespeed2=5
    Graphics.transition
    loop do
      Graphics.update
      Input.update
      update
      if $scene != self
        break
      end
    end
    Graphics.freeze
    @chapstart.dispose
    @chapend.dispose
  end
  # Updates Sprites Opacity
  def update
    case $game_variables[1]
      when 1
        if @chapstart.opacity>=255
          if Input.trigger?(Input::C)
            @fadespeed1*=-1
          end
        end
        @chapstart.opacity+=@fadespeed1
        if @chapstart.opacity<=0
          new_game
        end
      when 2
        @chapend.bitmap= RPG::Cache.picture("Chapters/Chapter"+ ($game_variables[2]).to_s+"end")
        @chapstart.bitmap = RPG::Cache.picture("Chapters/Chapter"+ ($game_variables[2]+1).to_s+"start")
         if @chapend.opacity>=255
           if Input.trigger?(Input::C)
             @fadespeed1*=-1
           end
         end
         @chapend.opacity+=@fadespeed1
           if @chapend.opacity<=0
             if @chapstart.opacity>=255
               if Input.trigger?(Input::C)
                 @fadespeed2*=-1
               end
             end
           @chapstart.opacity+=@fadespeed2
           @chapstart.opacity<=0
           new_game
         end
       end
     when 3
       @chapend.bitmap=RPG::Cache.picture("Chapters/Chapter"+ ($game_variables[2]+1).to_s+"end")
       if @chapend.opacity>=255
         if Input.trigger?(Input::C)
           @fadespeed1*=-1
         end
       end
       @chapend.opacity+=@fadespeed1
       if @chapend.opacity<=0
         end_game
       end
     end
   end
#Returns to Scene_Map
   def new_game
     $scene=Scene_Map.new
   end
#Returns to Scene_Gameover (If you want, Create a End Game Scene for credits, etc)
   def end_game
     $scene=Scene_Gameover.new
   end
end

After the pics are displayed, you are move to Scene_Map. � To end chapter 1, make an event:
Code:
$game_variables[1]+1
$scene=Scene_Chapter.new

To go go another chapter after 1, make an event with the code:
Code:
Variable [0001]=2
Variable [0002]+=1
$scene=Scene_Chapter.new

To finish a final chaper, make an event with the code:
Code:
Variable [0001]=3
$scene=Scene_Chapter.new

Then, the game will proceed to Scene_Gameover. To change that, search in Scene_Chapter for:

Code:
$scene=Scene_Gameover.new
and replace it with whatever scene you want.

I hope this was helpful to someone.
}




Users browsing this thread: