Jump to content

Recommended Posts

I'll keep this very brief;

 

I come from a background of c++ and I was shocked when I noticed that scripts were automatically run in concurrency. Could someone list (or give some reference to where this is explained) the different ways of calling functions and calling scripts from files, with a note whether the script will execute concurrently with the caller or the caller will wait before the function has completed.

Share this post


Link to post
Share on other sites

I'm no expert but this is where functions come in. For example, the following will wait for the function "fn_doLoop" to finish before executing the hint command.

fn_doLoop = {
    for "_i" from 0 to 1000 do {
        // Some loop code
    };
};

call fn_doLoop;

hint "fn_doLoop is finished";

Share this post


Link to post
Share on other sites

This thread is from A2/OA, but still relevant:

 

https://forums.bistudio.com/topic/115016-call-execvm-and-spawn-which-and-when/

 

Other links that may or may not be helpful/related, but will still have useful information anyways :p:

 

https://community.bistudio.com/wiki/Code_Optimisation

http://killzonekid.com/arma-scripting-tutorials-sqf-sqs-and-script-scheduler/

  • Like 1

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

×