PDA

View Full Version : script timing help


Livingdeadjedi
06-08-2003, 04:42 PM
heres the script i wrote
//Generated by BehavEd

rem ( "comment" );

loop ( -1 )
{
wait ( 5000.000 );

task ( "gassy" )
{
use ( "gas1" );
}

dowait ( "gassy" );
wait ( 1000.000 );

task ( "wait1" )
{
wait ( 5000.000 );
}

do ( "wait1" );

task ( "gassy2" )
{
use ( "gas2" );
}

dowait ( "gassy2" );
wait ( 1000.000 );
}



now im trying to get the wait time to work right


it should...
1.. FIRE STEAM for a second

2.. Then wait 5 seconds

3.. Then Fire second set of STEAM

4.. Then wait 10 seconds



BUT instead it does this

fires Steam waits 5 seconds fires second steam waits 10 seconds before turning steam off then another 5 before turning other steam off ??????? HEEEEEELPPPP
the steam is staying on far to long

its as though the last WAIT COMMAND somehow tells the steam how long to stay on for as well ?

lassev
06-09-2003, 04:34 AM
Well, let's consider some details in your script. First of all, you can make it a lot more clear by removing the tasks. You don't need to put use command in a task, because you are obviously just turning on a fx_runner, not some time consuming scripted function. Secondly, there's no need to put wait inside a task. When the script encounters a wait command, it will halt until the time is consumed. Besides, running the wait with a DO command has absolutely no effect, as the DO does not wait for anything, but everything that comes after it just proceeds at the same time (even in this situation, I imagine).

So what your script does now? The loop first waits 5000 ms, turns on gas1, waits 1000 milliseconds then turn on gas2, then 1000 ms plus again the 5000 ms at the beginning of the loop, and turns off gas1. One second to turn off gas2 etc...

loop
use("gas1") //to turn on the gas1
wait(1000)
use("gas1") //to turn off the gas1
wait(5000)
use("gas2")
wait(1000)
use("gas2")
wait(10000)
end loop

If you have read the ICARUS manual, you might remember that tasks should be located before the loop. Just to remind you, as you don't exactly need 'em here.

Have merry time scripting!

Livingdeadjedi
06-09-2003, 01:43 PM
yeah i did it without the tasks to begin with...

I never thought of doing the gas1 again to turn it off ROFL what a dummy i am :D


thanks m8

tFighterPilot
06-09-2003, 02:21 PM
I see a lot of -1 in scripts.

What does it do? Does it make in infinite?

Livingdeadjedi
06-09-2003, 03:43 PM
yes it does oh clever one :D

tFighterPilot
06-09-2003, 03:45 PM
thx