skipTime: Difference between revisions

From Bohemia Interactive Community
Jump to navigation Jump to search
(add. ArmA2 classification)
m (template:command argument fix)
(16 intermediate revisions by 9 users not shown)
Line 5: Line 5:


|1.00|= Game version
|1.00|= Game version
 
|exec= server|= Exec
|eff= local |= Effects in MP
____________________________________________________________________________________________
____________________________________________________________________________________________


| Skiptime duration is in hours. The time of day and tides are adjusted, but no changes are made in any units. If present, the lower level of clouds instantly jump to the position they would be in if time had passed normally.|= Description
| Jumps the specified number of hours forward or backward.<br>The time of day and tides are adjusted, but no changes are made to any units. If present, the lower level of clouds instantly jump to the position they would be in if time had passed normally.|DESCRIPTION=
____________________________________________________________________________________________
____________________________________________________________________________________________


| '''skipTime''' duration |= Syntax
| '''skipTime''' duration |SYNTAX=


|p1= duration: [[Number]] |= Parameter 1
|p1= duration: [[Number]] - Hours to skip.<br>A positive value will create a forward time jump, a negative value will jump backwards.<br>One second is roughly 0.00026 hours.<br>Any calculations must be enclosed in parentheses, e.g. skipTime (_seconds/3600) |PARAMETER1=


| [[Nothing]] |= Return value
| [[Nothing]] |RETURNVALUE=
____________________________________________________________________________________________
____________________________________________________________________________________________
   
   
|x1= <code>'''skipTime''' 5</code>  |= Example 1
|x1= <code>[[skipTime]] 5;</code>  |EXAMPLE1=
____________________________________________________________________________________________
____________________________________________________________________________________________


| |= See also
| [[setDate]], [[accTime]], [[setTimeMultiplier]], [[timeMultiplier]] |SEEALSO=
 
|mp= Even though the ''immediate'' effect of skipTime is only local, the new time will propagate through the network after 30 seconds or so.|=


}}
}}
Line 29: Line 30:
<dl class="command_description">
<dl class="command_description">
<!-- Note Section BEGIN -->
<!-- Note Section BEGIN -->
<dd class="notedate"></dd>
<dt class="note"></dt><dd class="note">
Here is a very useful function - great for giving a "campaign" feel to a running battle. Try this in your init.sqs file:
while(true) do {
skiptime 0.00333  ~0.1  }
This will make each day pass in around 12 minutes - great fun watching sunsets and the night sky!</dd>
<dd class="notedate"></dd>
<dt class="note"></dt><dd class="note">skipTime is not to be confused with [[accTime]].</dd>
<dd class="notedate"></dd>
<dt class="note"></dt><dd class="note">Here is a useful piece of code that will enable the mission to skip forward to any given time, irrespective of what time it happens to be in the mission:
skipTime (_timeToSkipTo - [[daytime]] + 24 ) % 24


See also: [[a % b]]</dd>
<dt class="note">Unknwon
<dd class="note">To simulate a smooth time-lapse effect (e.g. in cut-scenes), you can use the following code:
<code>while {true} do {skiptime 0.00333; sleep 0.1};</code>


<dd class="notedate">Posted on Feb 25, 2007</dd>
<dt class="note">'''[[User:Manny|Manny]]'''</dt><dd class="note">Note that time can also be skipped "backwards", ie. you can provide negative values and jump back in time.</dd>


<dd class="notedate">Posted on March 21, 2007</dd>
<dt class="note">Unknown
<dt class="note">'''[[User:granQ|granQ]]'''</dt><dd class="note">One second is roughly 0.00026.</dd>
<dd class="note">To skip forward to a specific time, irrespective of the current mission time, use
<code>skipTime (_timeToSkipTo - [[daytime]] + 24 ) [[a % b|%]] 24;</code>


<dd class="notedate"></dd>
<dt class="note">'''[[User:Ceeeb|Ceeeb]]'''</dt><dd class="note">In ArmA & OFP, skipTime does not actually estimate weather changes beyond moving the clouds across the sky. Weather counters continue as if no time has passed. The [[setDate]] command can be used instead of skiptime to change the time ''without'' the visual give-away of the lower clouds jumping.</dd>


<dd class="notedate">Posted on August 28, 2008</dd>
<dd class="notedate">
<dt class="note">'''[[User:BarmyArmy|BarmyArmy]]'''</dt><dd class="note">Always always always wrap any calculation in brackets.
<dt class="note">'''[[User:Ceeeb|Ceeeb]]'''<dd class="note">In ArmA & OFP, skipTime does not actually estimate weather changes beyond moving the clouds across the sky. Weather counters continue as if no time has passed. The [[setDate]] command can be used instead of skiptime to change the time ''without'' the visual give-away of the lower clouds jumping.


skipTime seconds*3600


will acutally only do skipTime seconds,  
<dd class="notedate">
<dt class="note">'''[[User:Kju|kju]]'''
<dd class="note">I cannot confirm this for OA 1.60 beta (85889):
MP: Even though the immediate effect of skipTime is only local,
the new time will propagate through the network after 30 seconds or so.
Instead the [[date]], which includes time, is synced automatically for new JIP clients - NOT for present instances.
So one has to apply skipTime on all instances in MP (server + all present clients).


skipTime (seconds*3600)


will achieve the desired result</dd>
<dd class="notedate">
<dt class="note">'''[[User:Killzone_Kid|Killzone_Kid]]'''
<dd class="note">This command is blocking and in some cases it may take up to 1.5 seconds (probably depends on CPU) for it to calculate the changes to the environment, during which the game will microfreeze. It largely depends on weather changes, which are quite random. However one thing remains consistent, [[skipTime]] 24 hours is always almost instant. This is quite helpful when used in conjunction with commands such as [[setOvercast]] for instant and seamless effect. To try it yourself use this script:
<code>[] [[spawn]] {
[[for]] "_i" [[from]] 1 [[to]] 24 [[do]] {
_time = [[diag_tickTime]];
[[skipTime]] _i;
[[diag_log]]  [_i, [[diag_tickTime]] - _time];
[[sleep]] 3;
};
};</code>
One of the results (results will vary depending on weather conditions):
<code>[1,1.44507]
[2,1.46118]
[3,1.33105]
[4,1.396]
[5,0.0310059]
[6,1.37891]
[7,1.4502]
[8,1.37817]
[9,1.37695]
[10,1.37012]
[11,1.448]
[12,1.32593]
[13,1.45508]
[14,1.448]
[15,0.0349121]
[16,0.0368652]
[17,1.25903]
[18,1.38599]
[19,1.4519]
[20,0.052002]
[21,0.0400391]
[22,0.0490723]
[23,1.35205]
[24,0.0151367] //this is always the lowest</code>


<dd class="notedate"></dd>
<dt class="note">'''[[User:Jtgibson|Jtgibson]]'''</dt><dd class="note">I should point out that you should divide, not multiply, in this context.  Thus, you want
skipTime (seconds/3600)
For instance, 600 seconds&mdash;ten minutes&mdash;is (600/3600) or 1/6 hour.</dd>


<dt class="note">'''[[User:Killzone_Kid|Killzone_Kid]]'''
<dd class="note">In Arma 3 (around v1.14) [[skipTime]] executed on the server will get synced in 5 seconds or so with all the clients. It will also be JIP compatible. [[skipTime]] executed on a client will change time on client for about 5 seconds after which it will sync back to server time.
<br><br>
<!-- Note Section END -->
<!-- Note Section END -->
</dl>
</dl>
Line 76: Line 100:
<h3 style="display:none">Bottom Section</h3>
<h3 style="display:none">Bottom Section</h3>
[[Category:Scripting Commands|SKIPTIME]]
[[Category:Scripting Commands|SKIPTIME]]
[[Category:Scripting Commands OFP 1.99|{{uc:{{PAGENAME}}}}]]
[[Category:Scripting Commands OFP 1.96|SKIPTIME]]
[[Category:Scripting Commands OFP 1.96|SKIPTIME]]
[[Category:Scripting Commands OFP 1.46|SKIPTIME]]
[[Category:Scripting Commands OFP 1.46|SKIPTIME]]
Line 82: Line 107:
[[Category:Command_Group:_Environment|{{uc:{{PAGENAME}}}}]]
[[Category:Command_Group:_Environment|{{uc:{{PAGENAME}}}}]]
[[Category:Scripting Commands ArmA2|{{uc:{{PAGENAME}}}}]]
[[Category:Scripting Commands ArmA2|{{uc:{{PAGENAME}}}}]]
[[Category:Scripting Commands Arma 3|{{uc:{{PAGENAME}}}}]]
[[Category:Scripting_Commands_Take_On_Helicopters|{{uc:{{PAGENAME}}}}]]
[[Category:Notes: Improper Formatting|{{uc:{{PAGENAME}}}}]]

Revision as of 15:49, 7 April 2019

Hover & click on the images for description

Description

Description:
Jumps the specified number of hours forward or backward.
The time of day and tides are adjusted, but no changes are made to any units. If present, the lower level of clouds instantly jump to the position they would be in if time had passed normally.
Multiplayer:
Even though the immediate effect of skipTime is only local, the new time will propagate through the network after 30 seconds or so.
Groups:
Uncategorised

Syntax

Syntax:
skipTime duration
Parameters:
duration: Number - Hours to skip.
A positive value will create a forward time jump, a negative value will jump backwards.
One second is roughly 0.00026 hours.
Any calculations must be enclosed in parentheses, e.g. skipTime (_seconds/3600)
Return Value:
Nothing

Examples

Example 1:
skipTime 5;

Additional Information

See also:
setDateaccTimesetTimeMultipliertimeMultiplier

Notes

Report bugs on the Feedback Tracker and/or discuss them on the Arma Discord or on the Forums.
Only post proven facts here! Add Note

Notes

Unknwon
To simulate a smooth time-lapse effect (e.g. in cut-scenes), you can use the following code: while {true} do {skiptime 0.00333; sleep 0.1};
Unknown
To skip forward to a specific time, irrespective of the current mission time, use skipTime (_timeToSkipTo - daytime + 24 ) % 24;
Ceeeb
In ArmA & OFP, skipTime does not actually estimate weather changes beyond moving the clouds across the sky. Weather counters continue as if no time has passed. The setDate command can be used instead of skiptime to change the time without the visual give-away of the lower clouds jumping.
kju
I cannot confirm this for OA 1.60 beta (85889): MP: Even though the immediate effect of skipTime is only local, the new time will propagate through the network after 30 seconds or so. Instead the date, which includes time, is synced automatically for new JIP clients - NOT for present instances. So one has to apply skipTime on all instances in MP (server + all present clients).
Killzone_Kid
This command is blocking and in some cases it may take up to 1.5 seconds (probably depends on CPU) for it to calculate the changes to the environment, during which the game will microfreeze. It largely depends on weather changes, which are quite random. However one thing remains consistent, skipTime 24 hours is always almost instant. This is quite helpful when used in conjunction with commands such as setOvercast for instant and seamless effect. To try it yourself use this script: [] spawn { for "_i" from 1 to 24 do { _time = diag_tickTime; skipTime _i; diag_log [_i, diag_tickTime - _time]; sleep 3; }; }; One of the results (results will vary depending on weather conditions): [1,1.44507] [2,1.46118] [3,1.33105] [4,1.396] [5,0.0310059] [6,1.37891] [7,1.4502] [8,1.37817] [9,1.37695] [10,1.37012] [11,1.448] [12,1.32593] [13,1.45508] [14,1.448] [15,0.0349121] [16,0.0368652] [17,1.25903] [18,1.38599] [19,1.4519] [20,0.052002] [21,0.0400391] [22,0.0490723] [23,1.35205] [24,0.0151367] //this is always the lowest
Killzone_Kid
In Arma 3 (around v1.14) skipTime executed on the server will get synced in 5 seconds or so with all the clients. It will also be JIP compatible. skipTime executed on a client will change time on client for about 5 seconds after which it will sync back to server time.

Bottom Section