Jump to content
  • 0

Noob question


dnk_paul

Question

5 answers to this question

Recommended Posts

  • 0

An other example:

 

If you would execute a script like this:

[player] execVM "scriptname.sqf";

then, the variable "player" will be ported into that executed script and you can use "specially" _this variable with using _someName = _this select 0;

 

The new variable "_someName" now is linked with the variable "player" from the first scriptfile.

 

cheers

Link to comment
Share on other sites

  • 0

With only one argument passed to the script, it's not necessary to use an array.
argument execVM "script.sqf";
Inside the Script, You can simply address the argument with "_this".

 

You can also pass a String instead of a variable or an array.
"some text" execVM "script.sqf"; //String
variable execVM "script.sqf"; //Variable
[element0, element1, element2] execVM "script.sqf"; //array


If execVM is used inside the init field of a unit/vehicle (inside the mission editor), use a handle (never use Null or Nil for this!) to make it work.

0 = this execVM "script.sqf"; //You can not use local variables here

 

You can also check if a Script is finished, using its handle.
Example that will wait until the script is executed completely:
_handle = execVM "script.sqf";
waitUntil{scriptDone _handle}; //Also possible to use isNull instead of scriptdone

Greez Kilo

Link to comment
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
  • Advertisement
  • Discord

×
×
  • Create New...