Difference between revisions of "skipTime"

From Bohemia Interactive Community
Jump to navigation Jump to search
m (Text replacement - "<!-- Note Section [A-Z]+ --> " to "")
(45 intermediate revisions by 8 users not shown)
Line 1: Line 1:
{{Command|= Comments
+
{{RV|type=command
____________________________________________________________________________________________
 
  
| ofp |= Game name
+
| ofp
  
|1.00|= Game version
+
|1.00
  
|eff= local |= Effects in MP
+
|serverExec= server
____________________________________________________________________________________________
 
  
| 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
+
|gr1= Time
____________________________________________________________________________________________
 
  
| '''skipTime''' duration |= Syntax
+
|gr2= Environment
  
|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
+
| 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.
  
| [[Nothing]] |= Return value
+
|mp= 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 [[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 {{HashLink|Multiplayer Scripting#Join In Progress}}.
 +
 
 +
| '''skipTime''' duration
 +
 
 +
|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)
 +
 
 +
| [[Nothing]]
 
   
 
   
|x1= <code>'''skipTime''' 5</code> |= Example 1
+
|x1= <code>[[skipTime]] 5;</code>
____________________________________________________________________________________________
 
  
| [[setDate]], [[accTime]] |= See also
+
|x2= <code>[[while]] {[[true]]} [[do]]  
 +
{
 +
  [[skipTime]] 0.00333;
 +
  [[sleep]] 0.1; {{cc|Smooth time transition}}
 +
};</code>
  
|mp= Even though the ''immediate'' effect of skipTime is only local, the new time will propagate through the network after 30 seconds or so.|=
+
|x3= <code>[[skipTime]] (_timeToSkipTo - [[daytime]] + 24 ) [[a % b|%]] 24; {{cc|Skip forward to a specific time, irrespective of the current mission time}}</code>
  
 +
|seealso= [[setDate]], [[accTime]], [[setTimeMultiplier]], [[timeMultiplier]]
 
}}
 
}}
  
<h3 style="display:none">Notes</h3>
 
 
<dl class="command_description">
 
<dl class="command_description">
<!-- Note Section BEGIN -->
+
<dt><dt>
 
<dd class="notedate">
 
<dd class="notedate">
<dt class="note"><dd class="note">
+
<dt class="note">[[User:Ceeeb|Ceeeb]]</dt>
To simulate a smooth time-lapse effect (e.g. in cut-scenes), you can use the following code:
+
<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.
while {true} do {skiptime 0.00333; sleep 0.1}
 
 
 
  
 +
<dt><dt>
 
<dd class="notedate">
 
<dd class="notedate">
<dt class="note"><dd class="note">To skip forward to a specific time, irrespective of the current mission time, use:
+
<dt class="note">[[User:Kju|kju]]</dt>
skipTime (_timeToSkipTo - [[daytime]] + 24 ) [[a % b|%]] 24
 
 
 
 
 
<dd class="notedate">
 
<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.
 
 
 
 
 
<dd class="notedate">
 
<dt class="note">'''[[User:Kju|kju]]'''
 
 
<dd class="note">I cannot confirm this for OA 1.60 beta (85889):
 
<dd class="note">I cannot confirm this for OA 1.60 beta (85889):
 
  MP: Even though the immediate effect of skipTime is only local,
 
  MP: Even though the immediate effect of skipTime is only local,
Line 54: Line 51:
 
So one has to apply skipTime on all instances in MP (server + all present clients).
 
So one has to apply skipTime on all instances in MP (server + all present clients).
  
 
+
<dt><dt>
 
<dd class="notedate">
 
<dd class="notedate">
<dt class="note">'''[[User:Killzone_Kid|Killzone_Kid]]'''
+
<dt class="note">[[User:Killzone_Kid|Killzone_Kid]]</dt>
 
<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:
 
<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]] {
 
<code>[] [[spawn]] {
Line 66: Line 63:
 
};
 
};
 
};</code>
 
};</code>
One of the results (results will vary depending on weather conditions):
+
One of the results (results will vary depending on weather conditions):<br>
<code>[1,1.44507]
+
<spoiler text="Show Results">
 +
<pre>[1,1.44507]
 
[2,1.46118]
 
[2,1.46118]
 
[3,1.33105]
 
[3,1.33105]
Line 90: Line 88:
 
[22,0.0490723]
 
[22,0.0490723]
 
[23,1.35205]
 
[23,1.35205]
[24,0.0151367] //this is always the lowest</code>
+
[24,0.0151367] // this is always the lowest</pre>
 
+
</spoiler>
<!-- Note Section END -->
 
 
</dl>
 
</dl>
  
<h3 style="display:none">Bottom Section</h3>
+
{{GameCategory|arma1|Scripting Commands}}
[[Category:Scripting Commands|SKIPTIME]]
+
{{GameCategory|arma2|Scripting Commands}}
[[Category:Scripting Commands OFP 1.96|SKIPTIME]]
+
{{GameCategory|arma3|Scripting Commands}}
[[Category:Scripting Commands OFP 1.46|SKIPTIME]]
+
{{GameCategory|tkoh|Scripting Commands}}
[[Category:Scripting Commands ArmA|SKIPTIME]]
 
[[Category:Scripting Commands ArmA2|SKIPTIME]]
 
[[Category:Command_Group:_Environment|{{uc:{{PAGENAME}}}}]]
 
[[Category:Scripting Commands ArmA2|{{uc:{{PAGENAME}}}}]]
 
[[Category:Scripting Commands Arma 3|{{uc:{{PAGENAME}}}}]]
 
[[Category:Scripting_Commands_Take_On_Helicopters|{{uc:{{PAGENAME}}}}]]
 

Revision as of 01:41, 6 April 2021

Hover & click on the images for description

Description

Description:
Description needed
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.
Groups:
TimeEnvironment

Syntax

Syntax:
Syntax needed
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:
Return value needed

Examples

Example 1:
skipTime 5;
Example 2:
while {true} do { skipTime 0.00333; sleep 0.1; // Smooth time transition };
Example 3:
skipTime (_timeToSkipTo - daytime + 24 ) % 24; // Skip forward to a specific time, irrespective of the current mission time

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
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):
Show Results