OFPEC Forum

Editors Depot - Mission Editing and Scripting => OFP - Editing/Scripting General => Topic started by: Wildebeest on 27 Nov 2005, 20:30:02

Title: Set time?
Post by: Wildebeest on 27 Nov 2005, 20:30:02
Hi!

How do you set the time in OFP? By this I mean deciding the exact time of day rather than accelerating the time back or forth with the "setacctime" command. Do you use something like "settime 11.5" which will be 11:30 am?

Thanks
Title: Re:Set time?
Post by: THobson on 27 Nov 2005, 20:36:48
To set the time to the next 11:30 after the current time use:

skipTime ((24 + 11.5 - daytime) % 24)

More generally:

_time to SkipTo = 11.5
skipTime ((24 + _time to SkipTo - daytime) % 24)

So if it is midday this will move you to 11:30 the next day

If you don't mind the time being skipped backwards if you are already past the time you want to go to use:

skipTime (_time to SkipTo - daytime)

In this case if it is midday then you will skip back to 11:30 of the same day.

Title: Re:Set time?
Post by: Wildebeest on 29 Nov 2005, 14:30:00
OK, thanks! That worked just fine :)