Pokémon SDK Wiki
Credits

Time system

Psdk has a time system that can work in two different ways:

The Time System is enabled by default and used by berries. The default in-game clock is the Virtual Clock, but you can switch to Real Clock using this switch:

Setting Real Time
Switching from virtual time to real time using switch 7.

If you want to go back to Virtual Clock just turn off the switch again.

Remember that you have to run Yuki::TJN.force_update_tone script to update the time system to the current one you are using.

In-Game Times

The current in-game day works like this:

Morning Day Evening Night
07:00am - 10:59am 11:00am - 18:59pm 19:00pm - 21:59pm 22:00pm - 06:59am

To change the default one you can use: Yuki::TJN::TIME_SETS[:default].clear.concat([21, 18, 11, 4])

Or you can add your custom one: Yuki::TJN::TIME_SETS[:jaizu_dn] = [21, 18, 11, 4]

If you add a custom time set you also have to have your own tint system. To switch to your time and tint system use $pokemon_party.tint_time_set = :jaizu_dn

Tint System

The Tint System gets enabled by default in the intro script. If you used a custom one or removed that part you can enable or disable it using the Switch 0010: Tint system enabled. To make the game update your changes without warping or refreshing the screen call a script with Yuki::TJN.force_update_tone inside.

The default Tint System uses 5 different tones, like this:

TONE_SETS = {
      default: [
        Tone.new(-85, -85, -20, 0), # Night
        Tone.new(-17, -51, -34, 0), # Evening
        Tone.new(-75, -75, -10, 0), # Midnight
        NEUTRAL_TONE, # Day
        Tone.new(17, -17, -34, 0) # Dawn
      ],

It's also possible to define 24 tones (one / hour) that will be calculated each minutes for smoothness : $pokemon_party.tint_time_set = :winter

The tones aren't correct, they are there for purpose tests only, you can make your owns using:

Yuki::TJN::TONE_SETS[:jaizu_dn] = [
        Tone.new(-75, -75, -10, 0), # 0
        Tone.new(-80, -80, -10, 0), # 1
        Tone.new(-85, -85, -10, 0), # 2
        Tone.new(-80, -80, -12, 0), # 3
        Tone.new(-75, -75, -15, 0), # 4
        Tone.new(-65, -65, -18, 0), # 5
        Tone.new(-55, -55, -20, 0), # 6
        Tone.new(-25, -35, -22, 0), # 7
        Tone.new(-20, -25, -25, 0), # 8
        Tone.new(-15, -20, -30, 0), # 9
        Tone.new(-10, -17, -34, 0), # 10
        Tone.new(5, -8, -15, 0), # 11
        Tone.new(0, 0, -5, 0), # 12
        Tone.new(0, 0, 0, 0), # 13
        Tone.new(0, 0, 0, 0), # 14
        Tone.new(-10, -25, -10, 0), # 15
        Tone.new(-17, -51, -34, 0), # 16
        Tone.new(-20, -43, -30, 0), # 17
        Tone.new(-35, -35, -25, 0), # 18
        Tone.new(-45, -45, -20, 0), # 19
        Tone.new(-55, -55, -15, 0), # 20
        Tone.new(-60, -60, -14, 0), # 21
        Tone.new(-65, -65, -13, 0), # 22
        Tone.new(-70, -70, -10, 0), # 23
      ]

Remember that the Tint System and the In-Game times are tied, so if you add a custom one they must have the same name. You can also use a simplier tone system like this:

Yuki::TJN::TONE_SETS[:jaizu_dn] = [
  night = Tone.new(-85, -85, -20, 0), # Night
  Tone.new(-17, -51, -34, 0), # Evening
  night, # Midnight
  Yuki::TJN::NEUTRAL_TONE, # Day
  Tone.new(17, -17, -34, 0) #Morning
]

Manipulating the Time

PSDK saves time values in variables. To manipulate the time in-game just change the value of this variables:

To refresh your screen to change to the tone of the desired time run a script with Yuki::TJN.force_update_tone

Events based on the current time

PSDK has switches to make things easier

alt text

With those you can easily make events that only occur at certain times of the day.

alt text

Make sure you do not use this type of event too much, as it is not optimized and a little CPU-consuming