Home   Help Search Login Register  

Author Topic: Set time?  (Read 618 times)

0 Members and 1 Guest are viewing this topic.

Offline Wildebeest

  • Contributing Member
  • **
  • The time the wildebeest ruled the Earth.
Set time?
« 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
Weeee...

Offline THobson

  • OFPEC Patron
  • Former Staff
  • ****
Re:Set time?
« Reply #1 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.

« Last Edit: 27 Nov 2005, 20:44:23 by THobson »

Offline Wildebeest

  • Contributing Member
  • **
  • The time the wildebeest ruled the Earth.
Re:Set time?
« Reply #2 on: 29 Nov 2005, 14:30:00 »
OK, thanks! That worked just fine :)
Weeee...