tortuosit 486 Posted May 20, 2019 Hey guys... [] execvm "code1.sqf"; [] execvm "code2.sqf"; I start this from inside the debug console. Let's say code1.sqf is not an endless loop, ie. does terminate. How can I call the scripts in a way that code2.sqf starts AFTER code1.sqf has been finished? In a gosub/return kind of way? I'm not at my rig but I guess a preprocessor would not work in a debug console.. Thx. Share this post Link to post Share on other sites
jshock 513 Posted May 20, 2019 thing = [] spawn { scriptOneHandle = [] execvm "code1.sqf"; waitUntil {scriptDone scriptOneHandle}; scriptTwoHandle = [] execvm "code2.sqf"; }; 1 Share this post Link to post Share on other sites
Sgt. Dennenboom 98 Posted May 20, 2019 thing = [] spawn { [] call compile preprocessFileLineNumbers "code1.sqf"; [] call compile preprocessFileLineNumbers "code2.sqf"; }; Works too, as you can still "call" scripts if they contain sleeps in a scheduled environment. This will start code2 after code1 finished. 2 Share this post Link to post Share on other sites
tortuosit 486 Posted May 20, 2019 Thanks that clears things up perfectly. My old brain should have remembered waituntil/scriptdone, because I regularly use it 😄 2nd solution is quite beautiful. I wish I could use "#define ccp call compile preprocessFileLineNumbers" in a debug console or logic, for saving space inside the ArmA UI, but hey. Share this post Link to post Share on other sites
mrcurry 496 Posted May 20, 2019 Work with CfgFunctions instead, the extra overhead is worth the structure and ease of recompile. 2 Share this post Link to post Share on other sites
sarogahtyp 1108 Posted May 20, 2019 1 hour ago, mrcurry said: Work with CfgFunctions instead, the extra overhead is worth the structure and ease of recompile. Functions Library Share this post Link to post Share on other sites
tortuosit 486 Posted May 20, 2019 1 hour ago, mrcurry said: Work with CfgFunctions instead, the extra overhead is worth the structure and ease of recompile. I never did. So basically, is it about registering my own functions into ArmA for... easier... use? Share this post Link to post Share on other sites
sarogahtyp 1108 Posted May 20, 2019 16 minutes ago, tortuosit said: I never did. So basically, is it about registering my own functions into ArmA for... easier... use? mainly it preprocesses and precompiles your scripts into functions for faster execution on runtime. Also it enables the ability to call or spawn those functions to fit your needs. execVM e.g. preprocesses and compiles the script everytime you run it. functions are preprocessed/compiled (mostly) one time only. 1 Share this post Link to post Share on other sites
killzone_kid 1330 Posted May 20, 2019 BIS_fnc_spawnOrdered will spawn given function in order it was called. Coming to dev branch soon 1 Share this post Link to post Share on other sites