• Just a reminder that providing specifics on, sharing links to, or naming websites where ROMs can be accessed is against the rules. If your post has any of this information it will be removed.
  • Our friends from the Johto Times are hosting a favorite Pokémon poll - and we'd love for you to participate! Click here for information on how to vote for your favorites!
  • Welcome to PokéCommunity! Register now and join one of the best fan communities on the 'net to talk Pokémon and more! We are not affiliated with The Pokémon Company or Nintendo.

[Scripting Question] Adjusting the Seasons

  • 143
    Posts
    11
    Years
    • Seen Jun 11, 2021
    So I'm looking at the code for pbIsSeason, and I'm trying to adjust it, but I'm not sure how to do so.
    Code:
    def pbIsSpring; return pbIsSeason(0,0); end # Jan, May, Sep
    def pbIsSummer; return pbIsSeason(0,1); end # Feb, Jun, Oct
    def pbIsAutumn; return pbIsSeason(0,2); end # Mar, Jul, Nov
    def pbIsFall; return pbIsAutumn; end
    def pbIsWinter; return pbIsSeason(0,3); end # Apr, Aug, Dec
    Basically, I want to change this to where Spring identifies March, April, and May, Summer identifies June, July, and August, Fall identifies September, October, and November, and lastly Winter identifies December, January, and February.
     
    What I use in my own game for Sawsbuck - the seasons correspond to the real life time they are active, or an approximation thereof.

    Code:
    def SeasonNow?(bob=nil)
      time=pbGetTimeNow
      mo=time.month
      day=time.day
      if (mo==3 && day>=20) || mo==4 || mo==5 || (mo==6 && day<20)
        return 0 # spring
      elsif (mo==6 && day>=20) || mo==7 || mo==8 || (mo==9 && day<20)
        return 1 # summer
      elsif (mo==9 && day>=20) || mo==10 || mo==11 || (mo==12 && day<20)
        return 2 # autumn
      elsif (mo==12 && day>=20) || mo==1 || mo==2 || (mo==3 && day<20)
        return 3 # winter
      else
        return 4 # error catching
      end
    end
    
    def isSpring; return (SeasonNow?()==0); end
    def isSummer; return (SeasonNow?()==1); end
    def isAutumn; return (SeasonNow?()==2); end
    def isFall; return (SeasonNow?()==2); end
    def isWinter; return (SeasonNow?()==3); end
     
    Back
    Top