skipTime: Difference between revisions

From Bohemia Interactive Community
Jump to navigation Jump to search
m (VBS2 scripting category removal)
m (Text replacement - "[] spawn" to "0 spawn")
 
(82 intermediate revisions by 12 users not shown)
Line 1: Line 1:
{{Command|= Comments
{{RV|type=command
____________________________________________________________________________________________


| ofp |= Game name
|game1= ofp
|version1= 1.00


|1.00|= Game version
|game2= ofpe
|version2= 1.00


|eff= local |= Effects in MP
|game3= arma1
____________________________________________________________________________________________
|version3= 1.00


| 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
|game4= arma2
____________________________________________________________________________________________
|version4= 1.00


| '''skipTime''' duration |= Syntax
|game5= arma2oa
|version5= 1.50


|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) |= Parameter 1
|game6= tkoh
|version6= 1.00


| [[Nothing]] |= Return value
|game7= arma3
____________________________________________________________________________________________
|version7= 0.50
 
|x1= <code>'''skipTime''' 5</code>  |= Example 1
____________________________________________________________________________________________


| [[setDate]], [[accTime]] |= See also
|serverExec= server


|mp= Even though the ''immediate'' effect of skipTime is only local, the new time will propagate through the network after 30 seconds or so.|=
|gr1= Time


}}
|gr2= Environment
 
|descr= 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.
 
|mp= In {{arma3}} (around v1.14) [[skipTime]] executed on the server will get synced in 5 seconds or so with all the clients. It will also be [[Multiplayer Scripting#Join In Progress|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>
For other games' behaviour, see {{Link|Multiplayer Scripting#Join In Progress}}.
 
{{Feature|important|Since {{GVI|arma3|2.10}} [[skipTime]] is limited to max +/- 1000 hours per skip for game stability. The command is intended for short time jumps. For large intervals, use [[setDate]].}}
 
|s1= [[skipTime]] duration
 
|p1= duration: [[Number]] - hours to skip. A positive value will create a forward time jump, a negative value will jump backwards.
 
|r1= [[Nothing]]
 
|x1= <sqf>skipTime 5;</sqf>
 
|x2= <sqf>skipTime (5/60); // be sure to use parentheses, otherwise here (skipTime 5)/60 will happen</sqf>


<h3 style="display:none">Notes</h3>
|x3= <sqf>
<dl class="command_description">
while {true} do  
<!-- Note Section BEGIN -->
{
<dd class="notedate"></dd>
skipTime 0.00333;
<dt class="note"></dt><dd class="note">
sleep 0.1; // smooth time transition
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}
</sqf>
</dd>


<dd class="notedate"></dd>
|x4= <sqf>skipTime ((_timeToSkipTo - dayTime + 24) % 24); // skip forward to a specific time, irrespective of the current mission time</sqf>
<dt class="note"></dt><dd class="note">To skip forward to a specific time, irrespective of the current mission time, use:
skipTime (_timeToSkipTo - [[daytime]] + 24 ) [[a % b|%]] 24
</dd>


<dd class="notedate"></dd>
|seealso= [[setDate]] [[accTime]] [[setTimeMultiplier]] [[timeMultiplier]] [[BIS_fnc_setDate]]
<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>
}}


<!-- Note Section END -->
{{Note
</dl>
|user= Ceeeb
|timestamp= 20070417040100
|text= 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.
}}


<h3 style="display:none">Bottom Section</h3>
{{Note
[[Category:Scripting Commands|SKIPTIME]]
|user= .kju
[[Category:Scripting Commands OFP 1.96|SKIPTIME]]
|timestamp= 20111102220600
[[Category:Scripting Commands OFP 1.46|SKIPTIME]]
|text= I cannot confirm this for OA 1.60 beta (85889):
[[Category:Scripting Commands ArmA|SKIPTIME]]
MP: Even though the immediate effect of skipTime is only local,
[[Category:Scripting Commands ArmA2|SKIPTIME]]
the new time will propagate through the network after 30 seconds or so.
[[Category:Command_Group:_Environment|{{uc:{{PAGENAME}}}}]]
Instead the [[date]], which includes time, is synced automatically for new JIP clients - NOT for present instances.
[[Category:Scripting Commands ArmA2|{{uc:{{PAGENAME}}}}]]
So one has to apply skipTime on all instances in MP (server + all present clients).
}}
 
{{Note
|user= Killzone_Kid
|timestamp= 20130825024500
|text= 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:
<sqf>
0 spawn {
for "_i" from 1 to 24 do {
_time = diag_tickTime;
skipTime _i;
diag_log  [_i, diag_tickTime - _time];
sleep 3;
};
};
</sqf>
One of the results (results will vary depending on weather conditions):<br>
<spoiler text="Show results">
<pre>[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</pre>
</spoiler>
}}

Latest revision as of 21:25, 2 September 2024

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:
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.
For other games' behaviour, see Multiplayer Scripting - Join In Progress.
Since Arma 3 logo black.png2.10 skipTime is limited to max +/- 1000 hours per skip for game stability. The command is intended for short time jumps. For large intervals, use setDate.
Groups:
TimeEnvironment

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.
Return Value:
Nothing

Examples

Example 1:
skipTime 5;
Example 2:
skipTime (5/60); // be sure to use parentheses, otherwise here (skipTime 5)/60 will happen
Example 3:
while {true} do { skipTime 0.00333; sleep 0.1; // smooth time transition };
Example 4:
skipTime ((_timeToSkipTo - dayTime + 24) % 24); // skip forward to a specific time, irrespective of the current mission time

Additional Information

See also:
setDate accTime setTimeMultiplier timeMultiplier BIS_fnc_setDate

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
Ceeeb - c
Posted on Apr 17, 2007 - 04:01 (UTC)
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 - c
Posted on Nov 02, 2011 - 22:06 (UTC)
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 - c
Posted on Aug 25, 2013 - 02:45 (UTC)
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:
0 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