PDA

View Full Version : OFP engine clock capability



Balschoiw
Jun 10 2005, 00:21
Just a quick question before I go off to sound looping and scripting:
How many numbers behind the comma does the OFP work on correctly.
Eg: sound file needs to be started on 3,65 after mission starts
Possible ? Or will it start from 3 or 3,7 ?
Just a question to get it precise in script for looping and sound fusion.

DBR_ONIX
Jun 10 2005, 00:56
Well, I just looked at a script that does this :
<table border="0" align="center" width="95%" cellpadding="0" cellspacing="0"><tr><td>Code Sample </td></tr><tr><td id="CODE">
#loop
~0.03125
skiptime 0.00390625
goto &#34;loop&#34;
[/QUOTE]

Oh, and a number after a comma is the same as the number with no comma..
Like 1,000 = 1000
But
1.000 = 1

Not sure the limit on how accurate the numbers can be for pauses etc. To 8 decimal places, it seems to be okay, so to 2, or 4 (Dont see why a sound needs to be any more accurate than that), it should be fine http://forums.bistudio.com/oldsmileys/smile_o.gif

- Ben

Blanco
Jun 10 2005, 06:21
Isn&#39;t there a reserved variable for that?

time

In a script, time returns the time elapsed since missionstart.
For the record, _time returns the time elapsed since the script starts running.
One downside, whenever a saved game is loaded, time resets back to zero. http://forums.bistudio.com/oldsmileys/ghostface.gif (I hate that)

So...

<table border="0" align="center" width="95%" cellpadding="0" cellspacing="0"><tr><td>Code Sample </td></tr><tr><td id="CODE">?time + 3.65 &#58; &#60;code to play your sound&#62;[/QUOTE]

Not sure about that, though

Balschoiw
Jun 10 2005, 08:19
Thx http://forums.bistudio.com/oldsmileys/smile_o.gif