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

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 4 Weeks Ago (10:41 AM). Edited 1 Day Ago by bo4p5687.
bo4p5687 bo4p5687 is offline
     
    Join Date: May 2018
    Location: Việt Nam
    Gender: Male
    Nature: Relaxed
    Posts: 48
    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 in Day/Season Checker by Crazyninjaguy; Modified by : Zeak6464 & 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
    $season = false # 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)
        
        CheckTime.new
      
        checkmonagain = (Time.now.strftime("%m").to_i-1)%4
        
        if $checkseasons != checkmonagain && @check.nil?
          if val
            $checkseasons = checkmonagain
            @season = Sprite.new
            if $game_switches[TimeChecker::SPRING]
              @season.bitmap = RPG::Cache.picture("spring")
            elsif $game_switches[TimeChecker::SUMMER]
              @season.bitmap = RPG::Cache.picture("summer")
            elsif $game_switches[TimeChecker::AUTUMN]
              @season.bitmap = RPG::Cache.picture("autumn")      
            elsif $game_switches[TimeChecker::WINTER]
              @season.bitmap = RPG::Cache.picture("winter")
            end
            @season.opacity = 0
            @season.z = 9999997
          end
        end
    
        if val
          if $season == false 
            if @season.opacity < 255
              @season.opacity += 5
            elsif @season.opacity == 255
              $season = true
              Graphics.wait(90)
            end
          elsif $season == true 
            if @season.opacity > 0
              @season.opacity -= 5
            end
            @check = 1
          end
        else
          return if $season == false
          if $season == true && $checkseasons != checkmonagain 
            $season = false
            @check = nil
          end
        end
      end
    end
    Credits:
    bo4p5687
    based in Day/Season Checker by Crazyninjaguy; Modified by : Zeak6464 & Ulithium_Dragon

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

    You must put these pictures in Graphics\Pictures

    I tested in Essentials v17.2
    Reply With Quote

    Relevant Advertising!

    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 AM.