skipTime: Difference between revisions
Jump to navigation
Jump to search
Lou Montana (talk | contribs) m (Text replacement - " <dl class="command_description"> <dt><dt>" to " <dl class="command_description"> <dt><dt>") |
Lou Montana (talk | contribs) m (Some wiki formatting) |
||
Line 1: | Line 1: | ||
{{RV|type=command | {{RV|type=command | ||
| ofp | |game1= ofp | ||
|version1= 1.00 | |||
|1.00 | |game2= ofpe | ||
|version2= 1.00 | |||
|game3= arma1 | |||
|version3= 1.00 | |||
|game4= arma2 | |||
|version4= 1.00 | |||
|game5= arma2oa | |||
|version5= 1.50 | |||
|game6= tkoh | |||
|version6= 1.00 | |||
|game7= arma3 | |||
|version7= 0.50 | |||
|serverExec= server | |serverExec= server | ||
Line 11: | Line 28: | ||
|gr2= Environment | |gr2= Environment | ||
| 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. | |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 | |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 {{HashLink|Multiplayer Scripting#Join In Progress}}. | For other games' behaviour, see {{HashLink|Multiplayer Scripting#Join In Progress}}. | ||
| | |s1= [[skipTime]] duration | ||
|p1= duration: [[Number]] - Hours to skip. | |p1= duration: [[Number]] - Hours to skip. A positive value will create a forward time jump, a negative value will jump backwards. | ||
|r1=[[Nothing]] | |r1= [[Nothing]] | ||
|x1= <code>[[skipTime]] 5;</code> | |x1= <code>[[skipTime]] 5;</code> | ||
|x2= <code>[[while]] {[[true]]} [[do]] | |x2= <code>[[skipTime]] (5/60); {{cc|be sure to use parentheses, otherwise here ([[skipTime]] 5)/60 will happen}}</code> | ||
|x3= <code>[[while]] {[[true]]} [[do]] | |||
{ | { | ||
[[skipTime]] 0.00333; | |||
[[sleep]] 0.1; {{cc|smooth time transition}} | |||
};</code> | };</code> | ||
| | |x4= <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]] | |seealso= [[setDate]], [[accTime]], [[setTimeMultiplier]], [[timeMultiplier]] | ||
Line 41: | Line 59: | ||
<dd class="notedate"> | <dd class="notedate"> | ||
<dt class="note">[[User:Ceeeb|Ceeeb]]</dt> | <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 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> | |||
<dt><dt> | <dt><dt> | ||
Line 47: | Line 67: | ||
<dt class="note">[[User:Kju|kju]]</dt> | <dt class="note">[[User:Kju|kju]]</dt> | ||
<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, | |||
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. | 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). | So one has to apply skipTime on all instances in MP (server + all present clients). | ||
</dd> | |||
<dt><dt> | <dt><dt> | ||
Line 65: | Line 86: | ||
};</code> | };</code> | ||
One of the results (results will vary depending on weather conditions):<br> | One of the results (results will vary depending on weather conditions):<br> | ||
<spoiler text="Show | <spoiler text="Show results"> | ||
<pre>[1,1.44507] | <pre>[1,1.44507] | ||
[2,1.46118] | [2,1.46118] | ||
Line 91: | Line 112: | ||
[24,0.0151367] // this is always the lowest</pre> | [24,0.0151367] // this is always the lowest</pre> | ||
</spoiler> | </spoiler> | ||
</dd> | |||
</dl> | </dl> | ||
Revision as of 18:54, 12 June 2021
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. - 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
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):
[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
Categories:
- Scripting Commands
- Introduced with Operation Flashpoint version 1.00
- Operation Flashpoint: New Scripting Commands
- Operation Flashpoint: Scripting Commands
- Operation Flashpoint: Elite: Scripting Commands
- ArmA: Armed Assault: Scripting Commands
- Arma 2: Scripting Commands
- Arma 2: Operation Arrowhead: Scripting Commands
- Take On Helicopters: Scripting Commands
- Arma 3: Scripting Commands
- Command Group: Time
- Command Group: Environment
- Scripting Commands: Server Execution