Jump to content

Recommended Posts

When using execVM (which I do almost never do) I use the following syntax:

someParam execVM "someScript.sqf";

Are there circumstances where you have to do the following with execVM:

null = someParam execVM "someScript.sqf";

I ask because today I found someone saying a script would not work without using the latter syntax: https://forums.bohemia.net/forums/topic/189445-exec-or-execvm-call-or-spawn/?do=findComment&comment=3001417

 

In the past I have played around with scripts that use the latter syntax and changed them to my syntax without any apparent issue.

 

I do appreciate that execVM does return a value (a script handle) that can be used with the scriptDone and terminate commands.

Share this post


Link to post
Share on other sites

He was using a trigger, and a trigger's expression code on activation has to return nothing at the end.

To satisfy the trigger, the execVM handle had to be captured in a variable so that nothing would be returned.

There might be some other instances where a return must be captured, I can't recall right now, but that's what I observe from the given post.

 

someParam execVM "someScript.sqf";  // Handle is returned.
null = someParam execVM "someScript.sqf";  // Nothing is returned, variable "null" holds the handle.

 

  • Like 2

Share this post


Link to post
Share on other sites
On 9/2/2021 at 8:48 PM, opusfmspol said:

He was using a trigger, and a trigger's expression code on activation has to return nothing at the end.

Is this still the case? I seem to remember this was going to be addressed

 

  • Thanks 2

Share this post


Link to post
Share on other sites

Seems not the case anymore and was addressed in A3.  The prior post given was dated 2016.  Ran a test, no problem encountered, no error.  Good to know, thanks KK.

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

×