• Our software update is now concluded. You will need to reset your password to log in. In order to do this, you will have to click "Log in" in the top right corner and then "Forgot your password?".
  • 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.

Date Based Events?

RaulCortez

Maybe active...sometimes?
96
Posts
12
Years
  • Hey guys!

    I was thinking about this since i'd love to implement this on my game, but I don't know if it's a possibility.

    I know I can make an event appear or disappear according to the time of day or day of the week, but I wanted to know if I can actually make them appear at a specific date of the year, as well.

    Let's say a legendary pokemon that appears on October the 31st, or maybe the look of a town changes on December 24th (By ornaments appearing on the houses - those could be events as well, etc.)

    So date based events. Hopefully you got the gist of it. Is that possible? Thanks!
     
    824
    Posts
    8
    Years
  • Code:
    def pbIsDate?(month,day)
      mo=Time.now.month
      da=Time.now.day
      return true if mo==month && da==day
      return false
    end

    then name a few of your switches things like "s:pbIsDate?(10,31)" and "s:pbIsDate?(12,24)" and make your events run on those switches
     

    RaulCortez

    Maybe active...sometimes?
    96
    Posts
    12
    Years
  • Thanks a bunch, man! That's just what i needed!

    Just one question though, where should i put that piece of code exactly? on which script in specific?

    I figured i'd ask before i go around putting things on the wrong places and getting a load of errors {XD}
     
    824
    Posts
    8
    Years
  • I'd suggest in its own script section above Main, but theoretically, adding it to the very bottom of any script section is fine. Just as long as you don't put it inside another function or class or module or something.
     

    RaulCortez

    Maybe active...sometimes?
    96
    Posts
    12
    Years
  • I'd suggest in its own script section above Main, but theoretically, adding it to the very bottom of any script section is fine. Just as long as you don't put it inside another function or class or module or something.

    Perfect, I'll put it on its own section then. Thanks a lot, I'll make sure to credit you for this!
     
    Back
    Top