Home   Help Search Login Register  

Author Topic: Time compression/acceleration  (Read 1185 times)

0 Members and 1 Guest are viewing this topic.

BLITZKRIEG_ROF

  • Guest
Time compression/acceleration
« on: 08 Aug 2004, 19:26:17 »
Here's my situation:

I'm making a MP mission that's supposed to be played in all of the day/night stages, but I don't know the best way to do this.

I'm looking for one of these two things:

A script that accelerates time to roughly 1:60 (one hour game-time for one minute real-time)

A script that will advance time one hour for each minute of game-time

If there's already a thread on this, just call me a dumb badger and gimmie the URL.

KoniaX

  • Guest
Re:Time compression/acceleration
« Reply #1 on: 08 Aug 2004, 19:31:27 »
Couldn't you just make a trigger that has a countdown timer of 60, put it on repeatedly, and then in the activation field "skiptime 1"?

Offline macguba

  • Former Staff
  • ****
    • macguba's operation flashpoint page
Re:Time compression/acceleration
« Reply #2 on: 08 Aug 2004, 20:15:00 »
Learn about the commands

skipTime
setAccTime
Plenty of reviewed ArmA missions for you to play

Offline THobson

  • OFPEC Patron
  • Former Staff
  • ****
Re:Time compression/acceleration
« Reply #3 on: 08 Aug 2004, 20:45:47 »
Have a look at the following script

Code: [Select]
_gametime = 9
_realtime = 9

_counter  = 200
_timeIncrements =  _realtime/_counter
_Pausetime = _gametime/_counter

#loop
skipTime _timeIncrements
~ _Pausetime
_counter = _counter - 1
? (_counter > 0): goto "loop"

Note that  _gametime is in seconds & _realtime is in hours. Note also that this accelerates time but not accurately.  The above script should advance time by 9 hours in 9 seconds.  In fact it advances time by 9 hours but it takes more than 9 seconds to do because of the time spent by the processor doing other things

Play with the variables a bit - it should get you started.

« Last Edit: 08 Aug 2004, 20:53:50 by THobson »

Offline THobson

  • OFPEC Patron
  • Former Staff
  • ****
Re:Time compression/acceleration
« Reply #4 on: 08 Aug 2004, 21:15:38 »
I have just tried this with

_gametime = 24*60
_realtime = 24

_counter  = 10000

It should accelerate time so that 24 hours pass (_realtime) in a bit over 24 minutes (_gametime in seconds)  and it works okay but with an otherwise empty mission.  You could probably drop _counter to 1000 or even lower and not notice much differentce so long as you don't watch the stars.  The higher the value of _counter the more porcessing is being done and that might cause lag in a real mission
« Last Edit: 09 Aug 2004, 11:48:49 by THobson »

BLITZKRIEG_ROF

  • Guest
Re:Time compression/acceleration
« Reply #5 on: 09 Aug 2004, 14:42:24 »
Thanks, I'll give 'em a shot.

Now, this may sound stupid, and I already know most of what you're going to say, but I have a nagging feeling i'm doing something wrong.

How does one impliment these scripts? How do I get it from what you gave me to making a difference in my mission?
« Last Edit: 09 Aug 2004, 14:59:55 by BLITZKRIEG_ROF »

Offline THobson

  • OFPEC Patron
  • Former Staff
  • ****
Re:Time compression/acceleration
« Reply #6 on: 09 Aug 2004, 15:27:51 »
It is always the getting started that is difficult.

Copy and paste the code in the post above into a text file.  Just open Notepad and copy the text in there.

Save the file into the folder where your mission.sqm file is located.  Give it a name such as  TimeAcc.sqs

In your mission set a trigger that will cause time acceleration to start.  If you want it to start straight away then set the condition to  'true'

in the activation field put

[] exec "TimeAcc.sqs"

I would encourage you to have a look at some scripts from the Editors Dept, they usually come with a sample mission showing how they run.  I found it a good way to learn.

Offline macguba

  • Former Staff
  • ****
    • macguba's operation flashpoint page
Re:Time compression/acceleration
« Reply #7 on: 09 Aug 2004, 15:40:18 »
Read snYpir's A Friendly Intro to Code Snippets and also Johan Gustafsson's Scripting Tutorial.     The Tutorial Mission has some very simple scripts which are a good way to see real, live scripting integrated into a working mission.
Plenty of reviewed ArmA missions for you to play

BLITZKRIEG_ROF

  • Guest
Re:Time compression/acceleration
« Reply #8 on: 09 Aug 2004, 16:07:58 »
Thank you, thank you, that solved the problem.