Jump to content
Sign in to follow this  
frag

Basic question: Calling script in a script ... hot it react!?

Recommended Posts

Hi guys I am wondering ...

I am curently investigating a bug I have ...

If in script script1.sqs I have at some point a call to a second script

[] exec "scripts\Script2.sqs"

What will happen

1. The script Script2.sqs will be executed (synchronously), then the Script1.sqs will continue after the execution of Script2 is completed.

2. The Script2.sqs will be executed (Asynchronously) and the Script1.sqs will continue right away without waiting for Script2 to be executed.

3. Script2.sqs will be executed, Script1.sqs execution will stop.

Seems like a basic question but I can't find the answer :(

I tested it but it seems I have a bug some some sort, the Script1.sqs seems to stop ...does not make sense to me.

Thanks in advance guys!

Share this post


Link to post
Share on other sites

I know someone knows this guys ...

Share this post


Link to post
Share on other sites

i believe you should be using execVM, if I read the docs correctly exec is deprecated.

for asyn...

_handle = player execVM "test.sqf"; waitUntil {scriptDone _Handle};

(sqf functions launched with execVM will run asynchronously from its caller script/function. )

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  

×