OFPEC Forum
Editors Depot - Mission Editing and Scripting => OFP - Editing/Scripting General => Topic started by: Pr0ph3t on 15 Mar 2005, 04:48:15
-
Okay first part is easy, (I don't remember how but I kinda remember it being easy).
You arrive at night hide in a location, trigger takes over and accelerates whatever time it is to 8:30 in the morning. How do I do this?
Second, jeep with driver detects its 8:30 and comes to pick you up?
Thanks a bunch ppl
-
skipTime X makes the clock jump X number of hours. setAccTime Y makes the time go T times faster until you set it back to 1 again. Check these two commands out in the comref. There is also a daytime command (but I've forgotten it's name) that detects time of day within the game. Again, check the comref.
-
try something like
skiptime (8.5 - daytime) for 8:30 am
skiptime (20.5 - daytime) for 8:30pm
Not guaranteed but you get the idea.
If you always want the next 8:30 (ie you don't want time to skip backwards if it is later than 8:30 then try
skiptime ((20.5 +24 - daytime) % 24)
for 8:30 pm
Again, not guaranteed, Play around with it a bit.
EDIT: Well I thought I was going the be the first but it looks like I was beaten to it.
-
Um that might work but there are easier ways...
do you want time to actually speed up so you can see time moving faster than usual without having units move faster? If so this would work:
#loop
skiptime 0.02
~0.5
?(Daytime >= 8.5):Hint"Its 8:30 baby!";exit
goto"loop"
But sadly for this you'll need a fast system because skiptime is very CPU intense if you have alot of units around...
-
Um that might work but there are easier ways...
I think you will find that it does work (I was just being a bit modest), and what could be easier than that one line?
-
But sadly for this you'll need a fast system because skiptime is very CPU intense if you have alot of units around...
Setacctime is CPU intensive, but skiptime is not as it does not advance or speed the movement of units (only the time is affected by skiptime, not motion).
-
Basically, this is what I need. You get there at night kill a civy, and sleep on his bed. Screen blacks out (sleeping) time accels from whatever time it is ( VERY IMPORTANT to consider this) up to 08:30am
where screen fades in and jeep is outside waiting for you.
So I dunno.. How will I make it FForward from X time up to 8:30 ?
-
Ok. I know what I need now, I just don't know how to program it:
The time you complete your first objective at is X
so 8:30am - X = dT
so skiptime dT get it?
-
How about:
?daytime == 8.5 : exit
?daytime > 8.5 : skiptime ((24 - daytime) + 8.5)
?daytime < 8.5 : skiptime (8.5 - daytime)
At least I think that will work
Planck
-
You're my favorite planck
So we'll call the script time.sqs
Trigger Activation: unitname exec "time.sqs"
time.sqs
?daytime == 8.5 : exit
?daytime > 8.5 : skiptime ((24 - daytime) + 8.5)
?daytime < 8.5 : skiptime (8.5 - daytime)
right? I'll give it a try soon
-
I sometimes wonder why I bother.
skiptime ((8.5 +24 - daytime) % 24)
can be used instead of:
?daytime > 8.5 : skiptime ((24 - daytime) + 8.5)
?daytime < 8.5 : skiptime (8.5 - daytime)
Just read reply #2
Bye the way the line
?daytime == 8.5 : exit
Is not needed
-
I created a trigger and in the activation line I put:
skiptime ((8.5 +24 - daytime) % 24)
This fastforwarded the day instantly to 8:30am.