Home   Help Search Login Register  

Author Topic: Advancing Time Question...  (Read 585 times)

0 Members and 2 Guests are viewing this topic.

keou

  • Guest
Advancing Time Question...
« on: 13 Mar 2003, 03:30:12 »
i have heard about the SkipTime option for advancing the time, but i was curious if anyone knew of a way to jump ahead to a specific time in the game.

basically, i want to set up time advance via a trigger (like a simulating a safehouse) and then want to resume the mission at night.  if i use the skiptime, it will jump ahead x-number of hours.

however, lets say the first part of mission went very, very wrong and we were behind schedule, it would be cool to be able to go to a specific time rather than the x-number of hours ahead.

just curious if anyone had any ideas. 8)

Offline Artak

  • The old beanbag shaker
  • Former Staff
  • ****
  • You want to talk about it, yes?
    • OFP Team Finlanders
Re:Advancing Time Question...
« Reply #1 on: 13 Mar 2003, 08:24:25 »
It's possible and rather easy to do..

however I'm not at home right now, so incase no-one else comes along you'll get the snippet in 6 hours from now.  ;)
Not all is lost.

Iwesshome

  • Guest
Re:Advancing Time Question...
« Reply #2 on: 13 Mar 2003, 14:00:40 »
Keou,

Quote
skipTime duration

Operand types:
duration: Number
Type of returned value:
Nothing
Description:
Skip time. Daytime is adjusted, weather change is estimated, no changes in any units are done. Duration is in hours.

Example:
skipTime 2.5


So if want to use it in your mission and lets say mission starts at 8:00 and you want to jump to 12:00 after a point do this.

1. Create Trigger (can either be sync or activated by person)
In activation field: skipTime 4

Hope this helps,

IW

Offline Artak

  • The old beanbag shaker
  • Former Staff
  • ****
  • You want to talk about it, yes?
    • OFP Team Finlanders
Re:Advancing Time Question...
« Reply #3 on: 13 Mar 2003, 14:25:59 »
and here you have it.


Code: [Select]
;skiptime until certain time is reached by Artak

;_timelimit is a real number (ie time) which the time skip should stop
;for example 18

;skiptime 0.003 is about 10 seconds so therefore increasing about 20 seconds gametime in real time
;increase skiptime value to make the time go more fast, but note that the script will not be so accurate then.

;execute with [timeline] exec "skiptime.sqs"

_timelimit = _this select 0

;hint "time acceleration started"
#start

skiptime 0.003
~0.5
?daytime >= _timelimit: goto "exit"
goto "start"

#exit
;hint "time acceleration ended"
exit


So this allows you to stop the time skipping (acceleration) to a desired time.

If you start the skipping at 08.00 and put in a timeline of 12 the script will go on untill it's 12 O'clock. Amount of skipped time would be 4 hours. If you start the skipping at 10.00 with timeline 12, the amount of skipped time would be 2 hours. This you can not do by using just the skiptime command alone.
« Last Edit: 13 Mar 2003, 14:28:48 by Artak »
Not all is lost.

keou

  • Guest
Re:Advancing Time Question...
« Reply #4 on: 13 Mar 2003, 17:15:14 »
Thanks everyone for the help. ;D

i had used the skiptime before, but was always getting behind schedule on the mission due to a random placed sniper or two.

but the loop via artak worked beautifully.

thanks again!