The PokéCommunity Forums Fan Games Game Development Scripts & Tutorials
Essentials Script Photo spot (simple)

Scripts & Tutorials This forum is for scripts and code, as well as all kinds of tutorials, software, tools and so forth. Remember to give credit!
The thread revival limit does not apply here.


Reply
 
Thread Tools
  #1    
Old 1 Week Ago (1:30 AM). Edited 6 Days Ago by bo4p5687.
bo4p5687 bo4p5687 is offline
     
    Join Date: May 2018
    Location: Việt Nam
    Gender: Male
    Nature: Relaxed
    Posts: 52
    This script will helps you create a photo spot and you can watch the photos in a album.
    Moreover, you can delete the photos if you want.

    How to use:
    If you want taking a photo, call script: pbTakePhoto
    If you want watching album, call script: pbWatchAlbum
    Input Z (on your keyboard), you can take a photo and delete a photo.

    Graphics:
    Here, there are Scene for your album:
    Put the images in folder: Graphics\Pictures\Photo\SceneAbum
    and Scene for taking a photo
    Put the images in folder: Graphics\Pictures\Photo\ScenePhoto

    These are a my graphics: Download Graphics
    I use image 712x484 for scene and I set my script with this size. So, if you redraw with an other size, you must change some numbers in this script.

    Code:

    Album:
    Spoiler:
    Code:
    #===============================================================================
    # Photo Spot and Album by bo4p5687
    #===============================================================================
    # How to use:
    #  if you want take a photo, call script: pbTakePhoto
    #  if you want watch album, call script: pbWatchAlbum
    #===============================================================================
    #
    # To this script works, put it above main.
    #
    #===============================================================================
    #===============================================================================
    # How to add a item.
    =begin
      ITEMS.push(
      [:NAME ITEM],
      [:NAME ITEM],
      [:NAME ITEM]
        # You can continue, just keep
        # copying and pasting the previous line over and over...
      )
    =end
    #===============================================================================
    #===============================================================================
    
    ITEMS = []
    # This is a example:
      ITEMS.push(
      [:POTION],
      [:SUPERPOTION],
      [:FULLRESTORE],
      [:REVIVE],
      [:PPUP],
      [:PPMAX],
      [:RARECANDY],
      [:REPEL],
      [:MAXREPEL],
      [:ESCAPEROPE]
      )
      
    #===============================================================================
    #===============================================================================
    # How to add a special item.
    =begin
      SPECIALITEMS.push(
      [:NAME ITEM],
      [:NAME ITEM],
      [:NAME ITEM]
        # You can continue, just keep
        # copying and pasting the previous line over and over...
      )
    =end
    #===============================================================================
    #===============================================================================
    
    SPECIALITEMS = []
    # This is a example:
      SPECIALITEMS.push(
      [:MASTERBALL]
      )
    
    #===============================================================================
    # Watch Album
    #===============================================================================
    class Album
      
      def initialize
        @viewport=Viewport.new(0,0,Graphics.width,Graphics.height)
        @viewport.z=99999
        @viewport1 = Viewport.new(0,0,Graphics.width,Graphics.height)
        @viewport1.z = 99999
        @sprites={}
        
        @sprites["scene1"] = Sprite.new(@viewport1)
        @sprites["scene1"].bitmap = Bitmap.new("Graphics/Pictures/Photo/SceneAbum/FirstPic")
        @sprites["scene1"].x = 0; @sprites["scene1"].y = 0; @sprites["scene1"].visible = false
        
        @sprites["scene2"] = Sprite.new(@viewport1)
        @sprites["scene2"].bitmap = Bitmap.new("Graphics/Pictures/Photo/SceneAbum/LastPic")
        @sprites["scene2"].x = 0; @sprites["scene2"].y = 0; @sprites["scene2"].visible = false
    
        @sprites["scene3"] = Sprite.new(@viewport1)
        @sprites["scene3"].bitmap = Bitmap.new("Graphics/Pictures/Photo/SceneAbum/OnlyOne")
        @sprites["scene3"].x = 0; @sprites["scene3"].y = 0; @sprites["scene3"].visible = false
    
        @sprites["scene4"] = Sprite.new(@viewport1)
        @sprites["scene4"].bitmap = Bitmap.new("Graphics/Pictures/Photo/SceneAbum/PicMid")
        @sprites["scene4"].x = 0; @sprites["scene4"].y = 0; @sprites["scene4"].visible = false
        
        @count = 0
        @other = 0
        @select = 0
        @special = 0
        @specialtwo = 0
        @specialthree = 0
        @specialfour = 0
        @push = 0
        @first = 1
        @exit = false
      end
      
      def pbStart
        if !safeExists?("Graphics/Album")
          Kernel.pbMessage(_INTL("Oh! I see you don't have album! Ok! I will create one for you"))
          Dir.mkdir("Graphics/Album")
        end  
        Graphics.update
        Input.update
        self.update
        takepic
        choice = [_INTL("View"),_INTL("Check reward"),_INTL("Cancel")]
        choose = Kernel.pbMessage(_INTL("What do you want to do?"),choice)
        if choose == 0
          if !File.exist?("Graphics/Album/Album_screen001.png")
            Kernel.pbMessage(_INTL("Let's see... You don't have any photo! Let's take a photo!"))
          else
            Kernel.pbMessage(_INTL("Ok! Let's see..."))
            loop do
              Graphics.update
              Input.update
              self.update
              photo
              break if @exit == true
              if Input.trigger?(Input::B)
                Graphics.update
                Input.update
                self.update
                if Kernel.pbConfirmMessage("Are you sure you want to quit?")
                  pbEndScene
                  Kernel.pbMessage(_INTL("See you again!"))
                  break
                end
              end
            end
          end
        elsif choose == 1
          reward = $game_variables[Reward_Points]; special = $game_variables[Special_Points]
          request = [_INTL("Check reward points"),_INTL("Check special points"),_INTL("Cancel")]
          chooses = Kernel.pbMessage(_INTL("Next, what do you want to do?"),request)
          if chooses == 0
            Kernel.pbMessage(_INTL("Let's see..."))
            pbWait(2)
            if reward == 1 || reward == 0
              Kernel.pbMessage(_INTL("You have...#{reward} point."))
              Kernel.pbMessage(_INTL("I see you don't have enough points. Don't give up!"))
              Kernel.pbMessage(_INTL("Okay?"))
            elsif reward >= 100 # You can change this number
              Kernel.pbMessage(_INTL("You have...#{reward} points."))
              Kernel.pbMessage(_INTL("Wow! Congratulation! Your point is full. You can get item. Take it!"))
              number = rand(ITEMS.length)
              Kernel.pbItemBall(ITEMS[number][0])
              $game_variables[Reward_Points] = 0
              Kernel.pbMessage(_INTL("That's all."))
            elsif reward > 1 && reward < 100
              Kernel.pbMessage(_INTL("You have...#{reward} points."))
              Kernel.pbMessage(_INTL("I see you don't have enough points. Don't give up!"))
              Kernel.pbMessage(_INTL("Okay?"))
            end
            Kernel.pbMessage(_INTL("See you again!"))
          elsif chooses == 1
            Kernel.pbMessage(_INTL("Let's see..."))
            pbWait(2)
            if special == 1 || special == 0
              Kernel.pbMessage(_INTL("You have...#{special} point."))
              Kernel.pbMessage(_INTL("I see you don't have enough points. Don't give up!"))
              Kernel.pbMessage(_INTL("Okay?"))
            elsif special >= 200 # You can change this number
              Kernel.pbMessage(_INTL("You have...#{special} points."))
              Kernel.pbMessage(_INTL("Wow! Congratulation! Your point is full. You can get item. Take it!"))
              numbertwo = rand(SPECIALITEMS.length)
              Kernel.pbItemBall(SPECIALITEMS[numbertwo][0])
              $game_variables[Special_Points] = 0
              Kernel.pbMessage(_INTL("That's all."))
            elsif special > 1 && special < 200
              Kernel.pbMessage(_INTL("You have...#{special} points."))
              Kernel.pbMessage(_INTL("I see you don't have enough points. Don't give up!"))
              Kernel.pbMessage(_INTL("Okay?"))
            end
            Kernel.pbMessage(_INTL("See you again!"))
          elsif chooses == 2
            if Kernel.pbConfirmMessage("Are you sure you want to quit?")
              pbEndScene
              Kernel.pbMessage(_INTL("See you again!"))
            end
          end
        elsif choose == 2
          if Kernel.pbConfirmMessage("Are you sure you want to quit?")
            pbEndScene
            Kernel.pbMessage(_INTL("See you again!"))
          end
        end
      end
    
      def takepic
        p = Dir.glob("Graphics/Album/Album_screen*.png")
        @count = p.size
        if @count > 0
          @other = p.size - 1
          for i in [email protected]
            screenname = sprintf("screen%03d.png",i + 1)
            if i > 0
              @specialthree = -1
              loop do
                @specialthree += 1
                screennameother = sprintf("screen%03d.png",@specialthree + i + 1)
                if File.exist?("Graphics/Album/Album_" + screennameother)
                  File.rename("Graphics/Album/Album_" + screennameother,"Graphics/Album/Album_" + screenname) if !File.exist?("Graphics/Album/Album_" + screenname)
                end
                break if File.exist?("Graphics/Album/Album_" + screenname)
              end
            elsif i == 0
              @specialthree = 0
              loop do
                @specialthree += 1
                screennameother = sprintf("screen%03d.png",@specialthree + i + 1)
                if File.exist?("Graphics/Album/Album_" + screennameother)
                  File.rename("Graphics/Album/Album_" + screennameother,"Graphics/Album/Album_" + screenname) if !File.exist?("Graphics/Album/Album_" + screenname)
                end
                break if File.exist?("Graphics/Album/Album_" + screenname)
              end
            end
            @sprites["#{i}"] = Sprite.new(@viewport)
            @sprites["#{i}"].bitmap = Bitmap.new("Graphics/Album/Album_" + screenname)
            @sprites["#{i}"].x = 0
            @sprites["#{i}"].y = 0
            @sprites["#{i}"].visible = false
          end
        end
      end
        
      def photo
        if @count == 1
          Graphics.update
          Input.update
          self.update
          pbWait(1)
          @sprites["scene3"].visible = true
          @sprites["0"].visible = true
          if Input.trigger?(Input::A)
            Graphics.update
            Input.update
            self.update
            choices = [_INTL("Delete"),_INTL("Cancel")]
            choose_two = Kernel.pbMessage(_INTL("Are you sure? If you want to do this, please come back again."),choices)
            if choose_two == 0
              if Kernel.pbConfirmMessage("Are you sure, again?")
                pbEndScene
                File.delete("Graphics/Album/Album_screen001.png")
                Kernel.pbMessage(_INTL("OK! It's done."))
                @exit = true
              end
            end
          end
        elsif @count == 2
          pbWait(1)
          @sprites["scene1"].visible = true
          @sprites["0"].visible = true
          if Input.trigger?(Input::LEFT)
            Graphics.update
            Input.update
            self.update
            pbWait(1)
            @sprites["scene1"].visible = true
            @sprites["scene2"].visible = false
            @sprites["1"].visible = false
            @sprites["0"].visible = true
            @select = 0
          elsif Input.trigger?(Input::RIGHT)
            Graphics.update
            Input.update
            self.update
            pbWait(1)
            @sprites["scene1"].visible = false
            @sprites["scene2"].visible = true
            @sprites["1"].visible = true
            @sprites["0"].visible = false
            @select = 1
          end
          if Input.trigger?(Input::A)
            Graphics.update
            Input.update
            self.update
            choices = [_INTL("Delete"),_INTL("Cancel")]
            choose_two = Kernel.pbMessage(_INTL("Are you sure? If you want to do this, please come back again."),choices)
            if choose_two == 0
              if Kernel.pbConfirmMessage("Are you sure, again?")
                pbEndScene
                if @select == 1
                  File.delete("Graphics/Album/Album_screen002.png")
                elsif @select == 0
                  File.delete("Graphics/Album/Album_screen001.png")
                end
                @select = 0
                Kernel.pbMessage(_INTL("OK! It's done."))
                @exit = true
              end
            end
          end
        elsif @count == 3
          if @special == 0 
            Graphics.update
            Input.update
            self.update
            pbWait(1)
            @sprites["scene4"].visible = false
            @sprites["scene2"].visible = false
            @sprites["1"].visible = false
            @sprites["scene1"].visible = true
            @sprites["0"].visible = true
            @select = 0
          elsif @special == 1 
            Graphics.update
            Input.update
            self.update
            pbWait(1)
            @sprites["2"].visible = false
            @sprites["scene4"].visible = true
            @sprites["1"].visible = true
            @select = 1
          elsif @special == 2
            Graphics.update
            Input.update
            self.update
            pbWait(1)
            @sprites["scene4"].visible = false
            @sprites["scene2"].visible = true
            @sprites["2"].visible = true
            @select = 2
          end
          if Input.trigger?(Input::RIGHT)
            Input.update
            @special += 1
            if @special >= @other
              @special = @other
            end
          elsif Input.trigger?(Input::LEFT)
            Input.update
            @special -= 1
            if @special <= 0
              @special = 0
            end
          end
          if Input.trigger?(Input::A)
            Graphics.update
            Input.update
            self.update
            choices = [_INTL("Delete"),_INTL("Cancel")]
            choose_two = Kernel.pbMessage(_INTL("Are you sure? If you want to do this, please come back again."),choices)
            if choose_two == 0
              if Kernel.pbConfirmMessage("Are you sure, again?")
                pbEndScene
                if @select == 2
                  File.delete("Graphics/Album/Album_screen003.png")
                elsif @select == 1
                  File.delete("Graphics/Album/Album_screen002.png")
                elsif @select == 0
                  File.delete("Graphics/Album/Album_screen001.png")
                end
                @special = 0
                @select = 0
                Kernel.pbMessage(_INTL("OK! It's done."))
                @exit = true
              end
            end
          end
        elsif @count >= 4
          @specialfour = -1
          @sprites["scene1"].visible = true
          @sprites["0"].visible = true
          if Input.trigger?(Input::RIGHT)
            pbWait(1)
            Input.update
            @push += 1
            @first += 1
            @select += 1
            @specialfour = 0
            if @push > @other
              @push = @other
              @select = @other
            elsif @first > @other
              @first = @other + 1
            end
            if @push == @other
              Graphics.update
              Input.update
              self.update
              @sprites["scene4"].visible = false
              @sprites["scene2"].visible = true
              @sprites["#@push"].visible = true
            elsif @push < @other
              Graphics.update
              Input.update
              self.update
              @sprites["scene1"].visible = false
              @sprites["0"].visible = false
              @sprites["scene4"].visible = true
              @sprites["#@push"].visible = true
            end
          end
          if Input.trigger?(Input::LEFT) 
            pbWait(1)
            Input.update
            @push -= 1; @first = @push + 1; @select = @push; @specialfour = 0
            if @push <= 0
              @push = 0
              @first = 1
            end
            if @push == 1
              @specialtwo = 1
            elsif @push == 0
              @specialtwo = 0
              @specialtwo -= 1
              if @specialtwo <= -2
                @specialtwo = -2
              end
            end
            if @push == @other - 1
              Graphics.update
              Input.update
              self.update
              @sprites["scene2"].visible = false
              @sprites["#@other"].visible = false
              @sprites["scene4"].visible = true
              @sprites["#@push"].visible = true
            elsif @push <= @other - 2 && @push > 0 || @specialtwo == 1
              Graphics.update
              Input.update
              self.update
              @sprites["#@first"].visible = false
              @sprites["scene4"].visible = true
              @sprites["#@push"].visible = true
            elsif @specialtwo < 0 
              Graphics.update
              Input.update
              self.update
              @sprites["scene4"].visible = false
              @sprites["1"].visible = false
              @sprites["scene1"].visible = true
              @sprites["0"].visible = true
            end
          end
          if Input.trigger?(Input::A)
            Graphics.update
            Input.update
            self.update
            choices = [_INTL("Delete"),_INTL("Cancel")]
            choose_two = Kernel.pbMessage(_INTL("Are you sure? If you want to do this, please come back again."),choices)
            if choose_two == 0
              if Kernel.pbConfirmMessage("Are you sure, again?")
                pbEndScene
                if @select == @other
                  @select += 1
                  if @other < 10
                    File.delete("Graphics/Album/Album_screen00" + "#@select" + ".png")
                  elsif @other < 100 && @other >= 10
                    File.delete("Graphics/Album/Album_screen0" + "#@select" + ".png")
                  elsif @other < 1000 && @other >= 100
                    File.delete("Graphics/Album/Album_screen" + "#@select" + ".png")
                  end
                elsif @select <= @other - 1 && @select > 0 || @specialtwo == 1
                  @select += 1
                  if @select < 10
                    File.delete("Graphics/Album/Album_screen00" + "#@select" + ".png")
                  elsif @other < 100 && @other >= 10
                    File.delete("Graphics/Album/Album_screen0" + "#@select" + ".png")
                  elsif @other < 1000 && @other >= 100
                    File.delete("Graphics/Album/Album_screen" + "#@select" + ".png")
                  end
                elsif @specialtwo < 0 || @specialfour == -1
                  File.delete("Graphics/Album/Album_screen001.png")
                end
                @specialtwo = 0
                @push = 0
                @first = 1
                @select = 0
                Kernel.pbMessage(_INTL("OK! It's done."))
                @exit = true
              end
            end
          end
        end
      end
      
      def update
        Graphics.update
        Input.update
        pbUpdateSpriteHash(@sprites)
      end
      
      def pbEndScene
        pbDisposeSpriteHash(@sprites)
        @viewport.dispose
        @viewport1.dispose
      end
      
    end
    
    class ShowPicture
      
      def initialize(scene)
        @scene=scene
      end
      
      def pbStartScreen
        @scene.pbStart
      end
      
    end
      
    def pbWatchAlbum
      scene = Album.new
      screen = ShowPicture.new(scene)
      screen.pbStartScreen
    end

    Photo:
    Spoiler:
    Code:
    #===============================================================================
    # Photo Spot and Album by bo4p5687
    #===============================================================================
    # How to use:
    #  if you want take a photo, call script: pbTakePhoto
    #  if you want watch album, call script: pbWatchAlbum
    #===============================================================================
    #
    # To this script works, put it above main.
    #
    #===============================================================================
    # How to add a new graphic 
    =begin
      CONDITION.push(
      [MAP ID, "NAME GRAPHIC", NUMBER],
      [MAP ID, "NAME GRAPHIC", NUMBER],
      [MAP ID, "NAME GRAPHIC", NUMBER]
        # You can continue, just keep
        # copying and pasting the previous line over and over...
      )
      NUMBER: if you set 0, the scene will change.
    =end
    #===============================================================================
    #===============================================================================
    # * If you want change the scene (color) like the sky, set "true".
    CHANGE_SCENE_TONE = true
    #===============================================================================
    #===============================================================================
    
    CONDITION = []
    # Condition
    # This is a example:
      CONDITION.push(
      [2, "Scene", 1], # Here, the color of scene will not change.
      [32, "Scene", 0], # Here, the color of scene will change.
      [101, "Scene", 2]  # Here, the color of scene will not change.
      )
      
    #===============================================================================
    #===============================================================================
    # How to add a special map
    =begin
      SPECIAL.push(
      [MAP ID],
      [MAP ID],
      [MAP ID]
        # You can continue, just keep
        # copying and pasting the previous line over and over...
      )
    =end
    #===============================================================================
    #===============================================================================
    
    SPECIALMAP = []
    # Determine special maps
    # This is a example:
      SPECIALMAP.push(
      [32]
      )
      
    #===============================================================================
    #===============================================================================
    
    Reward_Points = 199   # Variable should be reserved
    Special_Points = 200  # Variable should be reserved
    
    #===============================================================================
    # Take a photo
    #===============================================================================
    class Photo
        
      def initialize
        @viewport=Viewport.new(0,0,Graphics.width,Graphics.height)
        @viewport.z=99999
        @viewport1=Viewport.new(0,0,Graphics.width,Graphics.height)
        @viewport1.z=99998
        @sprites={}
        @count = 0
        @right = 0
        @left = 0
        @up = 0
        @down = 0
        @zoom = 0
        @ratioappear = 0
      end
      
      def pbStart
        p = Dir.glob("Graphics/Album/Album_screen*.png")
        @count = p.size
        if @count == 999
          Kernel.pbMessage(_INTL("Oh! No! I see your album which is full, you must delete these photo before you take a photo."))
          pbEndScene
        else
          Graphics.update
          Input.update
          self.update
          drawSky
          drawScene
          choice = [_INTL("Take a Photo"),_INTL("Cancel")]
          choose = Kernel.pbMessage(_INTL("What do you want to do?"),choice)
          if choose == 0
            if !safeExists?("Graphics/Album")
              Dir.mkdir("Graphics/Album")
            end
            Kernel.pbMessage(_INTL("Ok! Let's do it!"))
            loop do
              Graphics.update
              Input.update
              self.update
              define
              define_sky
              setInput
              if Input.trigger?(Input::B)
                Graphics.update
                Input.update
                self.update
                if Kernel.pbConfirmMessage("Are you sure you want to quit?")
                  pbEndScene
                  Kernel.pbMessage(_INTL("Bye! See you again!"))
                  break
                end
              end
              if Input.trigger?(Input::A)
                pbWait(2)
                pbCaptureScreenUpgrade
                pbWait(4)
                define_reward
                define_special
                pbEndScene
                Kernel.pbMessage(_INTL("Ok! It's done and you can see this photo in your album!"))
                break
              end
            end
          elsif choose == 1
            pbEndScene
          end
        end
      end
    #===============================================================================
    # * Condition how to decrease or increase the reward points
    #===============================================================================
      def define_reward
        for i in 0...CONDITION.length
          if $game_map.map_id == CONDITION[i][0]
            # * Increase
            if @left == 0 && @right == 0 && @up == 0 && @down == 0 && @zoom == 0 || @left == 1 && @down == 2 # you can change this line
              $game_variables[Reward_Points] += 1
            # * Decrease
            elsif @left >= 15 && @up == 5 # you can change this line
              $game_variables[Reward_Points] -= 1
              if $game_variables[Reward_Points] < 0
                $game_variables[Reward_Points] = 0
              end
            end
          end
        end
      end
    #===============================================================================
    # * Condition how to decrease or increase the reward points on a beautiful scene
    #     (or a special scene) 
    #===============================================================================
      def define_special
        for i in 0...SPECIALMAP.length
          if $game_map.map_id == SPECIALMAP[i][0]
            # * Increase
            if @left == 0 && @right == 0 && @up == 0 && @down == 0 && @zoom == 0 || @left == 1 && @down == 2 # you can change this line
              $game_variables[Special_Points] += 2
            # * Decrease
            elsif @left >= 15 && @up == 5 # you can change this line
              $game_variables[Special_Points] -= 2
              if $game_variables[Special_Points] < 0
                $game_variables[Special_Points] = 0
              end
            end
          end
        end
      end
    #===============================================================================
      def drawSky
        @sprites["sky"] = Sprite.new(@viewport1)
        @sprites["sky"].bitmap = Bitmap.new("Graphics/Pictures/Photo/ScenePhoto/SceneSky")
        @sprites["sky"].visible = false
        @sprites["skynight"] = Sprite.new(@viewport1)
        @sprites["skynight"].bitmap = Bitmap.new("Graphics/Pictures/Photo/ScenePhoto/SceneSkyNight")
        @sprites["skynight"].visible = false
        for i in 1...5
          @sprites["cloud#{i}"] = AnimatedPlane.new(@viewport1)
          @sprites["cloud#{i}"].bitmap = Bitmap.new("Graphics/Pictures/Photo/ScenePhoto/Cloud#{i}")
          @sprites["cloud#{i}"].visible = false
        end
        for i in 1...4
          @sprites["star#{i}"] = Sprite.new(@viewport1)
          @sprites["star#{i}"].bitmap = Bitmap.new("Graphics/Pictures/Photo/ScenePhoto/StarNight#{i}")
          @sprites["star#{i}"].visible = false
        end
        @sprites["cloudnight"] = AnimatedPlane.new(@viewport1)
        @sprites["cloudnight"].bitmap = Bitmap.new("Graphics/Pictures/Photo/ScenePhoto/CloudNight")
        @sprites["cloudnight"].visible = false
      end
      
      def define_sky
        hour = pbGetTimeNow.hour
        if hour >= 5 && hour < 20
          @sprites["skynight"].visible = false
          @sprites["star1"].visible = false
          @sprites["star2"].visible = false
          @sprites["star3"].visible = false
          @sprites["cloudnight"].visible = false
          @sprites["sky"].visible = true
          @sprites["cloud1"].visible = true
          @sprites["cloud2"].visible = true
          @sprites["cloud3"].visible = true
          @sprites["cloud4"].visible = true
          @sprites["cloud1"].ox += 0.75
          @sprites["cloud2"].ox += 0.75
          @sprites["cloud3"].ox += 1
          @sprites["cloud4"].ox += 0.5
          if hour >= 5 && hour < 7
            @sprites["cloud1"].tone = Tone.new(-40, -50, -35, 50)
            @sprites["cloud2"].tone = Tone.new(-40, -50, -35, 50)
            @sprites["cloud3"].tone = Tone.new(-40, -50, -35, 50)
            @sprites["cloud4"].tone = Tone.new(-40, -50, -35, 50)
          elsif hour >= 17 && hour < 20
            @sprites["cloud1"].tone = Tone.new( -5, -30, -20,  0)
            @sprites["cloud2"].tone = Tone.new( -5, -30, -20,  0)
            @sprites["cloud3"].tone = Tone.new( -5, -30, -20,  0)
            @sprites["cloud4"].tone = Tone.new( -5, -30, -20,  0)
          elsif hour >= 7 && hour < 17
            @sprites["cloud1"].tone = Tone.new(  0,   0,   0,  0)
            @sprites["cloud2"].tone = Tone.new(  0,   0,   0,  0)
            @sprites["cloud3"].tone = Tone.new(  0,   0,   0,  0)
            @sprites["cloud4"].tone = Tone.new(  0,   0,   0,  0)
          end
        else
          @sprites["sky"].visible = false
          @sprites["cloud1"].visible = false
          @sprites["cloud2"].visible = false
          @sprites["cloud3"].visible = false
          @sprites["cloud4"].visible = false
          @sprites["skynight"].visible = true
          if @ratioappear >= 0 && @ratioappear < 70
            @ratioappear += 1
            @sprites["star1"].visible = true
          elsif @ratioappear >= 70 && @ratioappear < 72
            @ratioappear += 1
            @sprites["star2"].visible = true
          elsif @ratioappear >= 72 && @ratioappear < 75
            @ratioappear += 1
            @sprites["star3"].visible = true
          elsif @ratioappear >= 75
            @ratioappear = 0
            @sprites["star3"].visible = false
            @sprites["star2"].visible = false
          end
          @sprites["cloudnight"].visible = true
          @sprites["cloudnight"].ox += 0.4
        end
      end
      
      def drawScene
        for i in 0...CONDITION.length
          @sprites["#{i}"] = Sprite.new(@viewport)
          @sprites["#{i}"].bitmap = Bitmap.new("Graphics/Pictures/Photo/ScenePhoto/" + CONDITION[i][1])
          @sprites["#{i}"].x = -100; @sprites["#{i}"].y = -50
          @sprites["#{i}"].visible = false
          if File.exist?("Graphics/Pictures/Photo/ScenePhoto/Spring_" + CONDITION[i][1] + ".png")
            @sprites["sp#{i}"] = Sprite.new(@viewport)
            @sprites["sp#{i}"].bitmap = Bitmap.new("Graphics/Pictures/Photo/ScenePhoto/Spring_" + CONDITION[i][1])
            @sprites["sp#{i}"].x = -100; @sprites["sp#{i}"].y = -50
            @sprites["sp#{i}"].visible = false
          elsif File.exist?("Graphics/Pictures/Photo/ScenePhoto/Summer_" + CONDITION[i][1] + ".png")
            @sprites["su#{i}"] = Sprite.new(@viewport)
            @sprites["su#{i}"].bitmap = Bitmap.new("Graphics/Pictures/Photo/ScenePhoto/Summer_" + CONDITION[i][1])
            @sprites["su#{i}"].x = -100; @sprites["su#{i}"].y = -50
            @sprites["su#{i}"].visible = false
          elsif File.exist?("Graphics/Pictures/Photo/ScenePhoto/Autumn_" + CONDITION[i][1] + ".png")
            @sprites["a#{i}"] = Sprite.new(@viewport)
            @sprites["a#{i}"].bitmap = Bitmap.new("Graphics/Pictures/Photo/ScenePhoto/Autumn_" + CONDITION[i][1])
            @sprites["a#{i}"].x = -100; @sprites["a#{i}"].y = -50
            @sprites["a#{i}"].visible = false
          elsif File.exist?("Graphics/Pictures/Photo/ScenePhoto/Winter_" + CONDITION[i][1] + ".png")
            @sprites["w#{i}"] = Sprite.new(@viewport)
            @sprites["w#{i}"].bitmap = Bitmap.new("Graphics/Pictures/Photo/ScenePhoto/Winter_" + CONDITION[i][1])
            @sprites["w#{i}"].x = -100; @sprites["w#{i}"].y = -50
            @sprites["w#{i}"].visible = false
          end
        end
      end
      
      def define
        hour = pbGetTimeNow.hour
        for i in 0...CONDITION.length
          if $game_map.map_id == CONDITION[i][0]
            if pbIsSpring && File.exist?("Graphics/Pictures/Photo/ScenePhoto/Spring_" + CONDITION[i][1] + ".png")
              @sprites["sp#{i}"].visible = true
            elsif pbIsSummer && File.exist?("Graphics/Pictures/Photo/ScenePhoto/Summer_" + CONDITION[i][1] + ".png")
              @sprites["su#{i}"].visible = true
            elsif pbIsAutumn && File.exist?("Graphics/Pictures/Photo/ScenePhoto/Autumn_" + CONDITION[i][1] + ".png")
              @sprites["a#{i}"].visible = true
            elsif pbIsWinter && File.exist?("Graphics/Pictures/Photo/ScenePhoto/Winter_" + CONDITION[i][1] + ".png")
              @sprites["w#{i}"].visible = true
            else
              @sprites["#{i}"].visible = true
            end
            if CHANGE_SCENE_TONE
              if CONDITION[i][2] == 0
                if hour >= 5 && hour < 7
                  if pbIsSpring && File.exist?("Graphics/Pictures/Photo/ScenePhoto/Spring_" + CONDITION[i][1] + ".png")
                    @sprites["sp#{i}"].tone = Tone.new(-40, -50, -35, 50)
                  elsif pbIsSummer && File.exist?("Graphics/Pictures/Photo/ScenePhoto/Summer_" + CONDITION[i][1] + ".png")
                    @sprites["su#{i}"].tone = Tone.new(-40, -50, -35, 50)
                  elsif pbIsAutumn && File.exist?("Graphics/Pictures/Photo/ScenePhoto/Autumn_" + CONDITION[i][1] + ".png")
                    @sprites["a#{i}"].tone = Tone.new(-40, -50, -35, 50)
                  elsif pbIsWinter && File.exist?("Graphics/Pictures/Photo/ScenePhoto/Winter_" + CONDITION[i][1] + ".png")
                    @sprites["w#{i}"].tone = Tone.new(-40, -50, -35, 50)
                  else
                    @sprites["#{i}"].tone = Tone.new(-40, -50, -35, 50)
                  end
                elsif hour >= 17 && hour < 20
                  if pbIsSpring && File.exist?("Graphics/Pictures/Photo/ScenePhoto/Spring_" + CONDITION[i][1] + ".png")
                    @sprites["sp#{i}"].tone = Tone.new( -5, -30, -20,  0)
                  elsif pbIsSummer && File.exist?("Graphics/Pictures/Photo/ScenePhoto/Summer_" + CONDITION[i][1] + ".png")
                    @sprites["su#{i}"].tone = Tone.new( -5, -30, -20,  0)
                  elsif pbIsAutumn && File.exist?("Graphics/Pictures/Photo/ScenePhoto/Autumn_" + CONDITION[i][1] + ".png")
                    @sprites["a#{i}"].tone = Tone.new( -5, -30, -20,  0)
                  elsif pbIsWinter && File.exist?("Graphics/Pictures/Photo/ScenePhoto/Winter_" + CONDITION[i][1] + ".png")
                    @sprites["w#{i}"].tone = Tone.new( -5, -30, -20,  0)
                  else
                    @sprites["#{i}"].tone = Tone.new( -5, -30, -20,  0)
                  end
                elsif hour >= 20 || hour < 5
                  if pbIsSpring && File.exist?("Graphics/Pictures/Photo/ScenePhoto/Spring_" + CONDITION[i][1] + ".png")
                    @sprites["sp#{i}"].tone = Tone.new(-40, -75,   5, 40)
                  elsif pbIsSummer && File.exist?("Graphics/Pictures/Photo/ScenePhoto/Summer_" + CONDITION[i][1] + ".png")
                    @sprites["su#{i}"].tone = Tone.new(-40, -75,   5, 40)
                  elsif pbIsAutumn && File.exist?("Graphics/Pictures/Photo/ScenePhoto/Autumn_" + CONDITION[i][1] + ".png")
                    @sprites["a#{i}"].tone = Tone.new(-40, -75,   5, 40)
                  elsif pbIsWinter && File.exist?("Graphics/Pictures/Photo/ScenePhoto/Winter_" + CONDITION[i][1] + ".png")
                    @sprites["w#{i}"].tone = Tone.new(-40, -75,   5, 40)
                  else
                    @sprites["#{i}"].tone = Tone.new(-40, -75,   5, 40)
                  end
                else
                  if pbIsSpring && File.exist?("Graphics/Pictures/Photo/ScenePhoto/Spring_" + CONDITION[i][1] + ".png")
                    @sprites["sp#{i}"].tone = Tone.new(  0,   0,   0,  0)
                  elsif pbIsSummer && File.exist?("Graphics/Pictures/Photo/ScenePhoto/Summer_" + CONDITION[i][1] + ".png")
                    @sprites["su#{i}"].tone = Tone.new(  0,   0,   0,  0)
                  elsif pbIsAutumn && File.exist?("Graphics/Pictures/Photo/ScenePhoto/Autumn_" + CONDITION[i][1] + ".png")
                    @sprites["a#{i}"].tone = Tone.new(  0,   0,   0,  0)
                  elsif pbIsWinter && File.exist?("Graphics/Pictures/Photo/ScenePhoto/Winter_" + CONDITION[i][1] + ".png")
                    @sprites["w#{i}"].tone = Tone.new(  0,   0,   0,  0)
                  else
                    @sprites["#{i}"].tone = Tone.new(  0,   0,   0,  0)
                  end
                end
              end
            end
          end
        end
      end
      
      def setInput
        for i in 0...CONDITION.length
          if @sprites["#{i}"].visible == true
            if Input.trigger?(Input::DOWN)
              if @down < 10 && @up == 0
                @sprites["#{i}"].y -= 5
                @down += 1
              elsif @down >= 10 && @up == 0
                @down = 10
                @sprites["#{i}"].y -= 0
              elsif @up > 0
                @up -= 1
                @sprites["#{i}"].y -= 5
              elsif @up < 0
                @up = 0
              end
            end
            if Input.trigger?(Input::UP)
              if @up < 10 && @down == 0
                @sprites["#{i}"].y += 5
                @up += 1
              elsif @up >= 10 && @down == 0
                @up = 10
                @sprites["#{i}"].y += 0
              elsif @down > 0
                @down -= 1
                @sprites["#{i}"].y += 5
              elsif @down < 0
                @down = 0
              end
            end
            if Input.trigger?(Input::RIGHT)
              if @right < 20 && @left == 0
                @sprites["#{i}"].x -= 5
                @right += 1
              elsif @right >= 20 && @left == 0
                @right = 20
                @sprites["#{i}"].x -= 0
              elsif @left > 0
                @left -= 1
                @sprites["#{i}"].x -= 5
              elsif @left < 0
                @left = 0
              end
            end
            if Input.trigger?(Input::LEFT)
              if @left < 20 && @right == 0
                @sprites["#{i}"].x += 5
                @left += 1
              elsif @left >= 20 && @right == 0
                @left = 20
                @sprites["#{i}"].x += 0
              elsif @right > 0
                @right -= 1
                @sprites["#{i}"].x += 5
              elsif @right < 0
                @right = 0
              end
            end
            if Input.trigger?(Input::X)
              if @zoom < 10
                @sprites["#{i}"].zoom_x += 0.1
                @sprites["#{i}"].zoom_y += 0.1
                @sprites["#{i}"].src_rect.width = @sprites["#{i}"].bitmap.width/@sprites["#{i}"].zoom_x
                @sprites["#{i}"].src_rect.height = @sprites["#{i}"].bitmap.height/@sprites["#{i}"].zoom_y
                @sprites["#{i}"].src_rect.x = (@sprites["#{i}"].bitmap.width - @sprites["#{i}"].src_rect.width)/2
                @sprites["#{i}"].src_rect.y = (@sprites["#{i}"].bitmap.height - @sprites["#{i}"].src_rect.height)/2
                @zoom += 1
              end
            end
            if Input.trigger?(Input::Y)
              if @zoom <= 10 && @zoom > 0
                @sprites["#{i}"].zoom_x -= 0.1
                @sprites["#{i}"].zoom_y -= 0.1
                @sprites["#{i}"].src_rect.width = @sprites["#{i}"].bitmap.width/@sprites["#{i}"].zoom_x
                @sprites["#{i}"].src_rect.height = @sprites["#{i}"].bitmap.height/@sprites["#{i}"].zoom_y
                @sprites["#{i}"].src_rect.x = (@sprites["#{i}"].bitmap.width - @sprites["#{i}"].src_rect.width)/2
                @sprites["#{i}"].src_rect.y = (@sprites["#{i}"].bitmap.height - @sprites["#{i}"].src_rect.height)/2
                @zoom -= 1
              end
            end
          elsif File.exist?("Graphics/Pictures/Photo/ScenePhoto/Spring_" + CONDITION[i][1] + ".png")
            if @sprites["sp#{i}"].visible == true
              if Input.trigger?(Input::DOWN)
                if @down < 10 && @up == 0
                  @sprites["sp#{i}"].y -= 5
                  @down += 1
                elsif @down >= 10 && @up == 0
                  @down = 10
                  @sprites["sp#{i}"].y -= 0
                elsif @up > 0
                  @up -= 1
                  @sprites["sp#{i}"].y -= 5
                elsif @up < 0
                  @up = 0
                end
              end
              if Input.trigger?(Input::UP)
                if @up < 10 && @down == 0
                  @sprites["sp#{i}"].y += 5
                  @up += 1
                elsif @up >= 10 && @down == 0
                  @up = 10
                  @sprites["sp#{i}"].y += 0
                elsif @down > 0
                  @down -= 1
                  @sprites["sp#{i}"].y += 5
                elsif @down < 0
                  @down = 0
                end
              end
              if Input.trigger?(Input::RIGHT)
                if @right < 20 && @left == 0
                  @sprites["sp#{i}"].x -= 5
                  @right += 1
                elsif @right >= 20 && @left == 0
                  @right = 20
                  @sprites["sp#{i}"].x -= 0
                elsif @left > 0
                  @left -= 1
                  @sprites["sp#{i}"].x -= 5
                elsif @left < 0
                  @left = 0
                end
              end
              if Input.trigger?(Input::LEFT)
                if @left < 20 && @right == 0
                  @sprites["sp#{i}"].x += 5
                  @left += 1
                elsif @left >= 20 && @right == 0
                  @left = 20
                  @sprites["sp#{i}"].x += 0
                elsif @right > 0
                  @right -= 1
                  @sprites["sp#{i}"].x += 5
                elsif @right < 0
                  @right = 0
                end
              end
              if Input.trigger?(Input::X)
                if @zoom < 10
                  @sprites["sp#{i}"].zoom_x += 0.1
                  @sprites["sp#{i}"].zoom_y += 0.1
                  @sprites["sp#{i}"].src_rect.width = @sprites["sp#{i}"].bitmap.width/@sprites["sp#{i}"].zoom_x
                  @sprites["sp#{i}"].src_rect.height = @sprites["sp#{i}"].bitmap.height/@sprites["sp#{i}"].zoom_y
                  @sprites["sp#{i}"].src_rect.x = (@sprites["sp#{i}"].bitmap.width - @sprites["sp#{i}"].src_rect.width)/2
                  @sprites["sp#{i}"].src_rect.y = (@sprites["sp#{i}"].bitmap.height - @sprites["sp#{i}"].src_rect.height)/2
                  @zoom += 1
                end
              end
              if Input.trigger?(Input::Y)
                if @zoom <= 10 && @zoom > 0
                  @sprites["sp#{i}"].zoom_x -= 0.1
                  @sprites["sp#{i}"].zoom_y -= 0.1
                  @sprites["sp#{i}"].src_rect.width = @sprites["sp#{i}"].bitmap.width/@sprites["sp#{i}"].zoom_x
                  @sprites["sp#{i}"].src_rect.height = @sprites["sp#{i}"].bitmap.height/@sprites["sp#{i}"].zoom_y
                  @sprites["sp#{i}"].src_rect.x = (@sprites["sp#{i}"].bitmap.width - @sprites["sp#{i}"].src_rect.width)/2
                  @sprites["sp#{i}"].src_rect.y = (@sprites["sp#{i}"].bitmap.height - @sprites["sp#{i}"].src_rect.height)/2
                  @zoom -= 1
                end
              end
            end
          elsif File.exist?("Graphics/Pictures/Photo/ScenePhoto/Summer_" + CONDITION[i][1] + ".png")
            if @sprites["su#{i}"].visible == true
              if Input.trigger?(Input::DOWN)
                if @down < 10 && @up == 0
                  @sprites["su#{i}"].y -= 5
                  @down += 1
                elsif @down >= 10 && @up == 0
                  @down = 10
                  @sprites["su#{i}"].y -= 0
                elsif @up > 0
                  @up -= 1
                  @sprites["su#{i}"].y -= 5
                elsif @up < 0
                  @up = 0
                end
              end
              if Input.trigger?(Input::UP)
                if @up < 10 && @down == 0
                  @sprites["su#{i}"].y += 5
                  @up += 1
                elsif @up >= 10 && @down == 0
                  @up = 10
                  @sprites["su#{i}"].y += 0
                elsif @down > 0
                  @down -= 1
                  @sprites["su#{i}"].y += 5
                elsif @down < 0
                  @down = 0
                end
              end
              if Input.trigger?(Input::RIGHT)
                if @right < 20 && @left == 0
                  @sprites["su#{i}"].x -= 5
                  @right += 1
                elsif @right >= 20 && @left == 0
                  @right = 20
                  @sprites["su#{i}"].x -= 0
                elsif @left > 0
                  @left -= 1
                  @sprites["su#{i}"].x -= 5
                elsif @left < 0
                  @left = 0
                end
              end
              if Input.trigger?(Input::LEFT)
                if @left < 20 && @right == 0
                  @sprites["su#{i}"].x += 5
                  @left += 1
                elsif @left >= 20 && @right == 0
                  @left = 20
                  @sprites["su#{i}"].x += 0
                elsif @right > 0
                  @right -= 1
                  @sprites["su#{i}"].x += 5
                elsif @right < 0
                  @right = 0
                end
              end
              if Input.trigger?(Input::X)
                if @zoom < 10
                  @sprites["su#{i}"].zoom_x += 0.1
                  @sprites["su#{i}"].zoom_y += 0.1
                  @sprites["su#{i}"].src_rect.width = @sprites["su#{i}"].bitmap.width/@sprites["su#{i}"].zoom_x
                  @sprites["su#{i}"].src_rect.height = @sprites["su#{i}"].bitmap.height/@sprites["su#{i}"].zoom_y
                  @sprites["su#{i}"].src_rect.x = (@sprites["su#{i}"].bitmap.width - @sprites["su#{i}"].src_rect.width)/2
                  @sprites["su#{i}"].src_rect.y = (@sprites["su#{i}"].bitmap.height - @sprites["su#{i}"].src_rect.height)/2
                  @zoom += 1
                end
              end
              if Input.trigger?(Input::Y)
                if @zoom <= 10 && @zoom > 0
                  @sprites["su#{i}"].zoom_x -= 0.1
                  @sprites["su#{i}"].zoom_y -= 0.1
                  @sprites["su#{i}"].src_rect.width = @sprites["su#{i}"].bitmap.width/@sprites["su#{i}"].zoom_x
                  @sprites["su#{i}"].src_rect.height = @sprites["su#{i}"].bitmap.height/@sprites["su#{i}"].zoom_y
                  @sprites["su#{i}"].src_rect.x = (@sprites["su#{i}"].bitmap.width - @sprites["su#{i}"].src_rect.width)/2
                  @sprites["su#{i}"].src_rect.y = (@sprites["su#{i}"].bitmap.height - @sprites["su#{i}"].src_rect.height)/2
                  @zoom -= 1
                end
              end
            end
          elsif File.exist?("Graphics/Pictures/Photo/ScenePhoto/Autumn_" + CONDITION[i][1] + ".png")
            if @sprites["a#{i}"].visible == true
              if Input.trigger?(Input::DOWN)
                if @down < 10 && @up == 0
                  @sprites["a#{i}"].y -= 5
                  @down += 1
                elsif @down >= 10 && @up == 0
                  @down = 10
                  @sprites["a#{i}"].y -= 0
                elsif @up > 0
                  @up -= 1
                  @sprites["a#{i}"].y -= 5
                elsif @up < 0
                  @up = 0
                end
              end
              if Input.trigger?(Input::UP)
                if @up < 10 && @down == 0
                  @sprites["a#{i}"].y += 5
                  @up += 1
                elsif @up >= 10 && @down == 0
                  @up = 10
                  @sprites["a#{i}"].y += 0
                elsif @down > 0
                  @down -= 1
                  @sprites["a#{i}"].y += 5
                elsif @down < 0
                  @down = 0
                end
              end
              if Input.trigger?(Input::RIGHT)
                if @right < 20 && @left == 0
                  @sprites["a#{i}"].x -= 5
                  @right += 1
                elsif @right >= 20 && @left == 0
                  @right = 20
                  @sprites["a#{i}"].x -= 0
                elsif @left > 0
                  @left -= 1
                  @sprites["a#{i}"].x -= 5
                elsif @left < 0
                  @left = 0
                end
              end
              if Input.trigger?(Input::LEFT)
                if @left < 20 && @right == 0
                  @sprites["a#{i}"].x += 5
                  @left += 1
                elsif @left >= 20 && @right == 0
                  @left = 20
                  @sprites["a#{i}"].x += 0
                elsif @right > 0
                  @right -= 1
                  @sprites["a#{i}"].x += 5
                elsif @right < 0
                  @right = 0
                end
              end
              if Input.trigger?(Input::X)
                if @zoom < 10
                  @sprites["a#{i}"].zoom_x += 0.1
                  @sprites["a#{i}"].zoom_y += 0.1
                  @sprites["a#{i}"].src_rect.width = @sprites["a#{i}"].bitmap.width/@sprites["a#{i}"].zoom_x
                  @sprites["a#{i}"].src_rect.height = @sprites["a#{i}"].bitmap.height/@sprites["a#{i}"].zoom_y
                  @sprites["a#{i}"].src_rect.x = (@sprites["a#{i}"].bitmap.width - @sprites["a#{i}"].src_rect.width)/2
                  @sprites["a#{i}"].src_rect.y = (@sprites["a#{i}"].bitmap.height - @sprites["a#{i}"].src_rect.height)/2
                  @zoom += 1
                end
              end
              if Input.trigger?(Input::Y)
                if @zoom <= 10 && @zoom > 0
                  @sprites["a#{i}"].zoom_x -= 0.1
                  @sprites["a#{i}"].zoom_y -= 0.1
                  @sprites["a#{i}"].src_rect.width = @sprites["a#{i}"].bitmap.width/@sprites["a#{i}"].zoom_x
                  @sprites["a#{i}"].src_rect.height = @sprites["a#{i}"].bitmap.height/@sprites["a#{i}"].zoom_y
                  @sprites["a#{i}"].src_rect.x = (@sprites["a#{i}"].bitmap.width - @sprites["a#{i}"].src_rect.width)/2
                  @sprites["a#{i}"].src_rect.y = (@sprites["a#{i}"].bitmap.height - @sprites["a#{i}"].src_rect.height)/2
                  @zoom -= 1
                end
              end
            end
          elsif File.exist?("Graphics/Pictures/Photo/ScenePhoto/Winter_" + CONDITION[i][1] + ".png")
            if @sprites["w#{i}"].visible == true
              if Input.trigger?(Input::DOWN)
                if @down < 10 && @up == 0
                  @sprites["w#{i}"].y -= 5
                  @down += 1
                elsif @down >= 10 && @up == 0
                  @down = 10
                  @sprites["w#{i}"].y -= 0
                elsif @up > 0
                  @up -= 1
                  @sprites["w#{i}"].y -= 5
                elsif @up < 0
                  @up = 0
                end
              end
              if Input.trigger?(Input::UP)
                if @up < 10 && @down == 0
                  @sprites["w#{i}"].y += 5
                  @up += 1
                elsif @up >= 10 && @down == 0
                  @up = 10
                  @sprites["w#{i}"].y += 0
                elsif @down > 0
                  @down -= 1
                  @sprites["w#{i}"].y += 5
                elsif @down < 0
                  @down = 0
                end
              end
              if Input.trigger?(Input::RIGHT)
                if @right < 20 && @left == 0
                  @sprites["w#{i}"].x -= 5
                  @right += 1
                elsif @right >= 20 && @left == 0
                  @right = 20
                  @sprites["w#{i}"].x -= 0
                elsif @left > 0
                  @left -= 1
                  @sprites["w#{i}"].x -= 5
                elsif @left < 0
                  @left = 0
                end
              end
              if Input.trigger?(Input::LEFT)
                if @left < 20 && @right == 0
                  @sprites["w#{i}"].x += 5
                  @left += 1
                elsif @left >= 20 && @right == 0
                  @left = 20
                  @sprites["w#{i}"].x += 0
                elsif @right > 0
                  @right -= 1
                  @sprites["w#{i}"].x += 5
                elsif @right < 0
                  @right = 0
                end
              end
              if Input.trigger?(Input::X)
                if @zoom < 10
                  @sprites["w#{i}"].zoom_x += 0.1
                  @sprites["w#{i}"].zoom_y += 0.1
                  @sprites["w#{i}"].src_rect.width = @sprites["w#{i}"].bitmap.width/@sprites["w#{i}"].zoom_x
                  @sprites["w#{i}"].src_rect.height = @sprites["w#{i}"].bitmap.height/@sprites["w#{i}"].zoom_y
                  @sprites["w#{i}"].src_rect.x = (@sprites["w#{i}"].bitmap.width - @sprites["w#{i}"].src_rect.width)/2
                  @sprites["w#{i}"].src_rect.y = (@sprites["w#{i}"].bitmap.height - @sprites["w#{i}"].src_rect.height)/2
                  @zoom += 1
                end
              end
              if Input.trigger?(Input::Y)
                if @zoom <= 10 && @zoom > 0
                  @sprites["w#{i}"].zoom_x -= 0.1
                  @sprites["w#{i}"].zoom_y -= 0.1
                  @sprites["w#{i}"].src_rect.width = @sprites["w#{i}"].bitmap.width/@sprites["w#{i}"].zoom_x
                  @sprites["w#{i}"].src_rect.height = @sprites["w#{i}"].bitmap.height/@sprites["w#{i}"].zoom_y
                  @sprites["w#{i}"].src_rect.x = (@sprites["w#{i}"].bitmap.width - @sprites["w#{i}"].src_rect.width)/2
                  @sprites["w#{i}"].src_rect.y = (@sprites["w#{i}"].bitmap.height - @sprites["w#{i}"].src_rect.height)/2
                  @zoom -= 1
                end
              end
            end
          end
        end
      end
      
      def update
        Graphics.update
        Input.update
        pbUpdateSpriteHash(@sprites)
      end
      
      def pbCaptureScreenUpgrade
        capturefile = nil
        5000.times {|i|
          filename = RTP.getAlbum(sprintf("screen%03d.png",i+1))
          if !safeExists?(filename)
            capturefile = filename
            break
          end
          i += 1
        }
        if capturefile && safeExists?("rubyscreen.dll")
          takescreen = Win32API.new("rubyscreen.dll","TakeScreenshot","%w(p)","i")
          takescreen.call(capturefile)
          if safeExists?(capturefile)
            pbSEPlay("Pkmn exp full") if FileTest.audio_exist?("Audio/SE/Pkmn exp full")
          end
        end
      end
      
      def pbEndScene
        pbDisposeSpriteHash(@sprites)
        @viewport.dispose
      end
      
    end
        
    def pbTakePhoto
      scene=Photo.new
      scene.pbStart
    end
    
    module RTP
      def self.getAlbum(fileName)
        return "Graphics/Album/Album_" + fileName
      end
    end


    Credit:
    Photo Spot and Album by bo4p5687

    Note:
    Spoiler:
    You have 2 methods for delete the photos:
    + In main folder(Graphics\Album), you can delete 998 consecutive photos (1,2,etc,998) and after that, you have photo (999), this script will rename this file for you(999 -> 1). Moreover, you can delete the photos anything you like, this script will rename for you.
    (Remember: don't rename if you don't know how this script works).
    + In game, you can delete only one photo if you want to. Of course, this script will rename these files for you.

    About folder "Album", you don't need to create this folder, this script will helps you do this.
    You can have 999 photos in your album.
    The scene of photo is a animation scene (the sky).
    You can move Right, Left, Up, Down the photo and zoom in and zoom out the photos (x1.1,x1.2,x1.3,etc,x2.0) but before you zoom in or zoom out, you must change some line:
    In "PSystem_Controls", find this line:
    Code:
        #when Input::X;     return [0x41]                # A
        #when Input::Y;     return [0x53]                # S
    and you change this into
    Code:
        when Input::X;     return [0x41]                # A
        when Input::Y;     return [0x53]                # S
    Now, you can zoom in with A (on your keyboard) and zoom out with S (on your keyboard).
    You can get item with some conditions.
    Each map, you can have each scene.
    -You can change the sky like in the morning, you have an other sky (color); a special thing, in the night, there are many stars and this is a black sky.
    -Of course, you can change color of the sky, too.
    -You can change the scene, it depends on seasons ( each month, you have each season. Example: Jan: Spring; Feb: Summer; Mar: Autumn; Apr: Winter; May: Spring; etc).
    -You must change name the scene if you want show this scene for each season.
    Example:
    If you want to change a seasonal scene, the scene's name is "Scene", you must have 4 pictures and its name is Spring_Scene, Summer_Scene, Autumn_Scene, Winter_Scene.
    Special:
    About the seasons, you don't want to change or you don't have a graphic, don't worry, this script is still working.
    Reply With Quote

    Relevant Advertising!

      #2    
    Old 1 Week Ago (2:13 AM).
    Richard PT's Avatar
    Richard PT Richard PT is online now
       
      Join Date: Aug 2014
      Location: Portugal
      Gender: Male
      Nature: Calm
      Posts: 111
      This is a feature from an official pokemon game?
      Can we take photos from our adventure in game? Like some kind of screenshot?

      I don't know much about this kind of features in pokemon games.
      I already tested this script and it works fine.

      If you want i can post here the codes for those who want to make this an item. At least for the album first.
      __________________
      Reply With Quote
        #3    
      Old 1 Week Ago (2:48 AM). Edited 1 Week Ago by bo4p5687.
      bo4p5687 bo4p5687 is offline
         
        Join Date: May 2018
        Location: Việt Nam
        Gender: Male
        Nature: Relaxed
        Posts: 52
        Quote:
        Originally Posted by Richard PT View Post
        This is a feature from an official pokemon game?
        Can we take photos from our adventure in game? Like some kind of screenshot?

        I don't know much about this kind of features in pokemon games.
        I already tested this script and it works fine.

        If you want i can post here the codes for those who want to make this an item. At least for the album first.
        Yes, this is like a feature from an official pokemon game but this is simpler. With this script, you can take photos. So, I say "Yes", we can take photos from our adventure in game and I wrote this script with the help of screenshot. Moreover, I completed your idea before I see your post. So, you can't post your code here.
        Reply With Quote
        Reply

        Quick Reply

        Join the conversation!

        Create an account to post a reply in this thread, participate in other discussions, and more!

        Create a PokéCommunity Account

        Sponsored Links
        Thread Tools

        Posting Rules
        You may not post new threads
        You may not post replies
        You may not post attachments
        You may not edit your posts

        BB code is On
        Smilies are On
        [IMG] code is On
        HTML code is Off

        Forum Jump


        All times are GMT -8. The time now is 3:29 PM.