Tile - YTime - Day Duration – Ylands

From Bohemia Interactive Community
Jump to navigation Jump to search
m (YlandsClassyBot moved page Ylands Tile - Day duration to Ylands:Tile - YTime - Day Duration: New Structure)
No edit summary
Line 1: Line 1:
[[Image:Ylands_Tile_-_Day_duration.png]]
<!---
*Allows to '''get''' / '''set'''  '''length''' of one in-game '''day'''.
THIS PAGE WAS GENERATED AUTOMATICALLY; DO NOT EDIT IT, OTHERWISE YOUR CHANGES WILL BE LOST DURING FUTURE UPDATE.
-->
== Day Duration ==


=Notes=
[[File:YlandsTile-161-get.png]]
*Day duration means how many '''seconds''' takes '''one''' in-game day-night '''cycle'''.
 
*It's '''inverse''' function of [[Ylands Tile - Time scale|'''Time Scale''']]
[[File:YlandsTile-161-set.png]]
**Length of real '''day''' is '''86400 seconds''' (60x60x24)
 
**Time Scale = 86400 / Day duration, meaning that day duration of 86400 seconds represents 1:1 ratio.
<pre>static get dayDuration(): number;
static set dayDuration(value: number);</pre>
=== Description ===
 
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 =


=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.
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.


Line 17: Line 31:


[[Category: Instructions]]
[[Category: Instructions]]
[[Category: Ylands 0.10]]

Revision as of 08:51, 8 July 2021

Day Duration

YlandsTile-161-get.png

YlandsTile-161-set.png

static get dayDuration(): number;
static set dayDuration(value: number);

Description

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.