Jump to content
Sign in to follow this  
falconx1

ExecVM 2 loops from 1 script

Recommended Posts

from init.sqf loads server.sqf

the server.sqf loads the scripts below

ExecVM "loop1.sqf";

is code below loop1.sqf going to be executed?

ExecVM "loop2.sqf";


//---example of what loop1 and 2 might look like 
while {waves_east < AIWaveCount} do {

   waitUntil {({(side _x) == east} count allUnits) == 0};

};

maybe a dumb question lol , but i do think personally both loop1.sqf and loop2.sqf will be executed

but i want to ask you guys first.

Share this post


Link to post
Share on other sites

Why have two scripts that do the same thing?

Both scripts would run as written there.

Share this post


Link to post
Share on other sites

im actually gonna change loop 2 was just using it hypothetically. so they will both execute then huh?

Share this post


Link to post
Share on other sites

execVM and spawn run their code PARALLEL.

execVM runs an sqf file, spawn runs code. You can freely use sleeps and waituntils.

call runs its code in the SAME THREAD. So the end of a celled code is always waited.

call runs code. Sleeps and waituntils are risky business!

So execVMing two files with two endless loops will run both your loops, yes.

Share this post


Link to post
Share on other sites

Please sign in to comment

You will be able to leave a comment after signing in



Sign In Now
Sign in to follow this  

×