Advertisement
Jaizu85

Untitled

Oct 14th, 2019
87
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 4.53 KB | None | 0 0
  1. # Time system
  2.  
  3. Psdk has a time system that can work in two different ways:
  4. - Using a **Real Clock**: Like in the official games, time goes according your console time (in this case, your computers)
  5. - Using a **Virtual Clock**: Times are shorter (unless you change it) and goes according your internals game clock. This usually allows the player to play in different times of the day in the same game session and time gets resumed when you load your save file.
  6.  
  7. 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:
  8.  
  9. ![Setting Real Time|center](https://i.imgur.com/6OQlyoP.png "Switching from virtual time to real time using switch 7.")
  10.  
  11. If you want to go back to Virtual Clock just turn off the switch again.
  12.  
  13. ![tip](info "Remember that you have to run “.......” script to update the time system to the current one you are using.")
  14.  
  15. ## In-Game Times
  16. The current in-game day works like this:
  17.  
  18. | Morning | Day | Evening | Night |
  19. | ------ | ------ | ------ | ------ |
  20. | 07:00am - 10:59am | 11:00am - 18:59pm | 19:00pm - 21:59pm | 22:00pm - 06:59am |
  21.  
  22. To change the default one you can use:
  23. `Yuki::TJN::TIME_SETS[:default].clear.concat([21, 18, 11, 4])`
  24.  
  25. Or you can add your custom one:
  26. `Yuki::TJN::TIME_SETS[:jaizu_dn] = [21, 18, 11, 4]`
  27.  
  28. ![tip](warning "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`")
  29.  
  30. ## Tint System
  31.  
  32. 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.
  33. To make the game update your changes without warping or refreshing the screen call a script with `Yuki::TJN.force_update_tone` inside.
  34.  
  35. The default Tint System uses 5 different tones, like this:
  36.  
  37. ```ruby
  38. TONE_SETS = {
  39. default: [
  40. Tone.new(-85, -85, -20, 0), # Night
  41. Tone.new(-17, -51, -34, 0), # Evening
  42. Tone.new(-75, -75, -10, 0), # Midnight
  43. NEUTRAL_TONE, # Day
  44. Tone.new(17, -17, -34, 0) # Dawn
  45. ],
  46. ```
  47.  
  48. It's also possible to define 24 tones (one / hour) that will be calculated each minutes for smoothness :
  49. `$pokemon_party.tint_time_set = :winter`
  50.  
  51. The tones aren't correct, they are there for purpose tests only, you can make your owns using:
  52.  
  53. ```ruby
  54. Yuki::TJN::TONE_SETS[:jaizu_dn] = [
  55. Tone.new(-75, -75, -10, 0), # 0
  56. Tone.new(-80, -80, -10, 0), # 1
  57. Tone.new(-85, -85, -10, 0), # 2
  58. Tone.new(-80, -80, -12, 0), # 3
  59. Tone.new(-75, -75, -15, 0), # 4
  60. Tone.new(-65, -65, -18, 0), # 5
  61. Tone.new(-55, -55, -20, 0), # 6
  62. Tone.new(-25, -35, -22, 0), # 7
  63. Tone.new(-20, -25, -25, 0), # 8
  64. Tone.new(-15, -20, -30, 0), # 9
  65. Tone.new(-10, -17, -34, 0), # 10
  66. Tone.new(5, -8, -15, 0), # 11
  67. Tone.new(0, 0, -5, 0), # 12
  68. Tone.new(0, 0, 0, 0), # 13
  69. Tone.new(0, 0, 0, 0), # 14
  70. Tone.new(-10, -25, -10, 0), # 15
  71. Tone.new(-17, -51, -34, 0), # 16
  72. Tone.new(-20, -43, -30, 0), # 17
  73. Tone.new(-35, -35, -25, 0), # 18
  74. Tone.new(-45, -45, -20, 0), # 19
  75. Tone.new(-55, -55, -15, 0), # 20
  76. Tone.new(-60, -60, -14, 0), # 21
  77. Tone.new(-65, -65, -13, 0), # 22
  78. Tone.new(-70, -70, -10, 0), # 23
  79. ]
  80. ```
  81.  
  82. 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.
  83. You can also use a simplier tone system like this:
  84. ```ruby
  85. Yuki::TJN::TONE_SETS[:jaizu_dn] = [
  86. night = Tone.new(-85, -85, -20, 0), # Night
  87. Tone.new(-17, -51, -34, 0), # Evening
  88. night, # Midnight
  89. Yuki::TJN::NEUTRAL_TONE, # Day
  90. Tone.new(17, -17, -34, 0) #Morning
  91. ]
  92. ```
  93.  
  94. ## Manipulating the Time
  95. PSDK saves time values in variables. To manipulate the time in-game just change the value of this variables:
  96. - 0010: Hour (from 0 to 23)
  97. - 0011: Min (from 0 to 59)
  98. - 0013: Week day (from 0 to 6)
  99. - 0014: Week (from 0 to X)
  100. - 0015: Month (from 0 to 11)
  101. - 0016: Day (from 0 to 364)
  102.  
  103. To refresh your screen to change to the tone of the desired time run a script with `Yuki::TJN.force_update_tone`
  104.  
  105. ## Events based on the current time
  106. PSDK has switches to make things easier
  107.  
  108. ![alt text](https://i.imgur.com/qsQmyoS.png "Title Text")
  109.  
  110. With those you can easily make events that only occur at certain times of the day.
  111.  
  112. ![alt text](https://i.imgur.com/IcTaSSG.png "Title Text")
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement