The PokéCommunity Forums Fan Games Game Development Scripts, Tutorials & Tools
Essentials Script Show picture seasons like B2W2

Scripts, Tutorials & Tools 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 June 17th, 2018 (10:41 AM). Edited September 2nd, 2018 by bo4p5687.
bo4p5687 bo4p5687 is offline
     
    Join Date: May 2018
    Location: Việt Nam (Vietnam)
    Gender: Male
    Nature: Relaxed
    Posts: 75
    Hello everyone!

    There are the script that makes you check seasons like Pokemon B2W2.

    Place the script above Main.

    Code:
    #===============================================================================
    # * Check Seasons like B2W2 by bo4p5687
    # * based on Day/Season Checker by (Crazyninjaguy, Zeak6464 and Ulithium_Dragon) 
    #===============================================================================
    
    module TimeChecker
      
      # Number of the switch to turn on per day of week
      MONDAY = 600
      TUESDAY = 601
      WEDNESDAY = 602
      THURSDAY = 603
      FRIDAY = 604
      SATURDAY = 605
      SUNDAY = 606
      # Switch to turn on according to season
      WINTER = 607
      SPRING = 608
      SUMMER = 609
      AUTUMN = 610
      
    end
    
    class CheckTime
      
      include TimeChecker
      def initialize
        @day = Time.now.strftime("%A")
        @month = Time.now.strftime("%m").to_i
    #===============================================================================
    # Check month for each season
    #===============================================================================
        if @month == 1 || @month == 5 || @month == 9 # Spring: Jan, May, Sep
          $game_switches[WINTER] = false
          $game_switches[SPRING] = true
          $game_switches[SUMMER] = false
          $game_switches[AUTUMN] = false
        elsif @month == 2 || @month == 6 || @month == 10 # Summer: Feb, Jun, Oct
          $game_switches[WINTER] = false
          $game_switches[SPRING] = false
          $game_switches[SUMMER] = true
          $game_switches[AUTUMN] = false
        elsif @month == 3 || @month == 7 || @month == 11 #Autumn: Mar, Jul, Nov
          $game_switches[WINTER] = false
          $game_switches[SPRING] = false
          $game_switches[SUMMER] = false
          $game_switches[AUTUMN] = true
        elsif @month == 4 || @month == 8 || @month == 12 #Winter: Apr, Aug, Dec
          $game_switches[WINTER] = true
          $game_switches[SPRING] = false
          $game_switches[SUMMER] = false
          $game_switches[AUTUMN] = false
        end
    #===============================================================================
    # Check day of the week 
    #===============================================================================
        if @day == "Monday"
          $game_switches[MONDAY] = true
          $game_switches[TUESDAY] = false
          $game_switches[WEDNESDAY] = false
          $game_switches[THURSDAY] = false
          $game_switches[FRIDAY] = false
          $game_switches[SATURDAY] = false
          $game_switches[SUNDAY] = false
        elsif @day == "Tuesday"
          $game_switches[MONDAY] = false
          $game_switches[TUESDAY] = true
          $game_switches[WEDNESDAY] = false
          $game_switches[THURSDAY] = false
          $game_switches[FRIDAY] = false
          $game_switches[SATURDAY] = false
          $game_switches[SUNDAY] = false
        elsif @day == "Wednesday"
          $game_switches[MONDAY] = false
          $game_switches[TUESDAY] = false
          $game_switches[WEDNESDAY] = true
          $game_switches[THURSDAY] = false
          $game_switches[FRIDAY] = false
          $game_switches[SATURDAY] = false
          $game_switches[SUNDAY] = false
        elsif @day == "Thursday"
          $game_switches[MONDAY] = false
          $game_switches[TUESDAY] = false
          $game_switches[WEDNESDAY] = false
          $game_switches[THURSDAY] = true
          $game_switches[FRIDAY] = false
          $game_switches[SATURDAY] = false
          $game_switches[SUNDAY] = false
        elsif @day == "Friday"
          $game_switches[MONDAY] = false
          $game_switches[TUESDAY] = false
          $game_switches[WEDNESDAY] = false
          $game_switches[THURSDAY] = false
          $game_switches[FRIDAY] = true
          $game_switches[SATURDAY] = false
          $game_switches[SUNDAY] = false
        elsif @day == "Saturday"
          $game_switches[MONDAY] = false
          $game_switches[TUESDAY] = false
          $game_switches[WEDNESDAY] = false
          $game_switches[THURSDAY] = false
          $game_switches[FRIDAY] = false
          $game_switches[SATURDAY] = true
          $game_switches[SUNDAY] = false
        elsif @day == "Sunday"
          $game_switches[MONDAY] = false
          $game_switches[TUESDAY] = false
          $game_switches[WEDNESDAY] = false
          $game_switches[THURSDAY] = false
          $game_switches[FRIDAY] = false
          $game_switches[SATURDAY] = false
          $game_switches[SUNDAY] = true
        end
      end
      
    end
    #===============================================================================
    $checkseasons = 4 # Don't change
    #===============================================================================
    class Scene_Map
    
      alias cng_dayseason_map_update update
      def update
        cng_dayseason_map_update
        
        val = pbGetMetadata($game_map.map_id,MetadataOutdoor)
        checkmonagain = (pbGetTimeNow.mon-1)%4
        CheckTime.new
        if val
          if $checkseasons != checkmonagain && @check.nil?
            $checkseasons = checkmonagain
            @viewport = Viewport.new(0,0,Graphics.width,Graphics.height)
            @viewport.z = 9999997
            @season = Sprite.new(@viewport)
            if $game_switches[TimeChecker::SPRING]
              @season.bitmap = BitmapCache.load_bitmap("Graphics/Pictures/spring")
            elsif $game_switches[TimeChecker::SUMMER]
              @season.bitmap = BitmapCache.load_bitmap("Graphics/Pictures/summer")
            elsif $game_switches[TimeChecker::AUTUMN]
              @season.bitmap = BitmapCache.load_bitmap("Graphics/Pictures/autumn")
            elsif $game_switches[TimeChecker::WINTER]
              @season.bitmap = BitmapCache.load_bitmap("Graphics/Pictures/winter")
            end
            @season.opacity = 0
            @check = 1
          end
        end
        
        if val
          if @check == 1
            @season.opacity += 5
            @check = 2 if @season.opacity >= 255
          end
          if @check == 2
            Graphics.wait(30)
            @check = 3
          end
          if @check == 3
            @season.opacity -= 5
            if @season.opacity <= 0
              @season.dispose 
              @check = 4
            end
          end
        else
          if $checkseasons != checkmonagain
            @check = nil
          end
        end
      end
    end
    Credits:
    bo4p5687
    based on Day/Season Checker by (Crazyninjaguy, Zeak6464 and Ulithium_Dragon)

    Graphics:
    http://www.mediafire.com/file/icwa8s2xv5u6szr/Pictures.rar

    You must put these pictures in Graphics\Pictures.
    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
    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 2:37 AM.