Jump to content
Sign in to follow this  
tophe

The variable when executing SQF

Recommended Posts

I have just made my very first SQF script.

The script will get a unit to patrol a small area.

To do that I will have to add

<table border="0" align="center" width="95%" cellpadding="0" cellspacing="0"><tr><td>Code Sample </td></tr><tr><td id="CODE">var = execVM "patrolscript.sqf"

To the initline of the patroling unit.

If I don't use a variable I will get an error (i.e. execVM "..."

So... what is it for? What can I do with that variable?

Why do I have to run it that way?

Share this post


Link to post
Share on other sites

If I'm not mistaken, you could use that var to call the script on other items.

For example: call compile var would exec the script.

If you have a variable to pass into the script, then I think you'd do like: [arguments] call compile var.

I've never used it this way, but I'm pretty sure that's what it's used for.

Share this post


Link to post
Share on other sites

Ben is correct.

That var is a return value of the execVM command which allows you to detect when it has finished executing.

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  

×