Tile - YTime - Day Duration – Ylands
Jump to navigation
Jump to search
No edit summary |
No edit summary |
||
Line 14: | Line 14: | ||
---- | ---- | ||
{{Ylands scripting navbox}} | {{Ylands scripting navbox}} | ||
{{DEFAULTSORT:{{#sub:{{PAGENAME}}|14}}}} | |||
[[Category: Instructions]] | |||
[[Category: Ylands 0.10]] | [[Category: Ylands 0.10]] | ||
Revision as of 12:50, 3 January 2019
- Allows to get / set length of one in-game day.
Notes
- Day duration means how many seconds takes one in-game day-night cycle.
- It's inverse function of Time Scale
- Length of real day is 86400 seconds (60x60x24)
- Time Scale = 86400 / Day duration, meaning that day duration of 86400 seconds represents 1:1 ratio.
Advanced
Even though the returned number of Day Duration is whole, it often happens, that the value is actually decimal and it was just rounded for easier use. For example, if returned value of Day Duration is 3500 (meaning the in-game day duration is 3500 seconds), the exact value the computer is counting with might be something like 3499,99999. This is caused by small imperfections of calculating with numbers with infinite decimal places. So if you compare the 3500 value returned by Get Day Duration with number 3500, comparison will return false. It might not be safe to use values returned by Get Day Duration for other calculations when you are expecting whole numbers.