dnk_paul Posted June 25, 2015 Report Share Posted June 25, 2015 Hi All, Bit of a n00b question... When you're referencing files in the init.sqf, what's the difference between using [] execVM and just using execVM (without the [])? Paul Link to comment Share on other sites More sharing options...
0 Brian Soanes Posted June 25, 2015 Report Share Posted June 25, 2015 https://community.bistudio.com/wiki/execVM tl;dr - it's not needed Link to comment Share on other sites More sharing options...
0 W4lly Posted June 25, 2015 Report Share Posted June 25, 2015 passing variables like array .. [myVar1,myVar2] .. sintax is [arguments] execVm "file.sqf"; arguments are optional can use execVm without [] Link to comment Share on other sites More sharing options...
0 dnk_paul Posted June 25, 2015 Author Report Share Posted June 25, 2015 Thanks :) Link to comment Share on other sites More sharing options...
0 Sp4rkY Posted June 25, 2015 Report Share Posted June 25, 2015 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 IT07 1 Link to comment Share on other sites More sharing options...
0 KiloSwiss Posted June 26, 2015 Report Share Posted June 26, 2015 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 Sp4rkY 1 Link to comment Share on other sites More sharing options...
Question
dnk_paul
Hi All,
Bit of a n00b question...
When you're referencing files in the init.sqf, what's the difference between using [] execVM and just using execVM (without the [])?
Paul
Link to comment
Share on other sites
5 answers to this question
Recommended Posts
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 accountSign in
Already have an account? Sign in here.
Sign In Now