skipTime: Difference between revisions

From Bohemia Interactive Community
Jump to navigation Jump to search
m (Better example syntax)
m (Better syntax of skiptime to given time)
Line 48: Line 48:


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 is:<br>
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 is:<br>
'''skipTime''' (_timeToSkipTo - [[daytime]] + 24) % 24<br>
'''skipTime''' (-[[daytime]] + _timeToSkipTo)<br />
''See [[a % b]]''





Revision as of 12:38, 31 July 2006


skipTime duration


Operand types:

duration: Number

Type of returned value:

Nothing

Description:

Skip time in duration of hours.

Daytime is adjusted, weather change is estimated, no changes in any units are made.

The tide is also adjusted.


Example:

skipTime 5


Comments

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!

Not to be confused with accTime.

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 is:
skipTime (-daytime + _timeToSkipTo)


MP Note:

This command only has local effect. So only use this command in scripts which are running on all clients.