Tile - YTime - Day Duration – Ylands

From Bohemia Interactive Community
Jump to navigation Jump to search
m (Text replacement - "{{Ylands scripting navbox}}" to "{{Ylands editor navbox}}")
m (Text replacement - "{{DEFAULTSORT:{{#sub:{{PAGENAME}}|14}}}}" to "{{DEFAULTSORT:{{#sub:{{PAGENAME}}|7}}}}")
 
(4 intermediate revisions by 2 users not shown)
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>
=== Availability ===
 
[[Ylands:Tile Availability - Server|Server]]
 
=== 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.




----
----
{{Ylands editor navbox}}
{{Navbox/Ylands}}
{{DEFAULTSORT:{{#sub:{{PAGENAME}}|14}}}}
{{DEFAULTSORT:{{#sub:{{PAGENAME}}|7}}}}


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

Latest revision as of 14:27, 24 November 2023

Day Duration

YlandsTile-161-get.png

YlandsTile-161-set.png

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

Availability

Server

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.