o5_ 7 Posted May 8, 2018 So as the title states I'm curious what you all think about efficiency/optimizations when it comes to writing a lengthy script/mod for a mission. My current scripted mod is AC-C4I (Air Craft Command, Contol, Computers, Communications, & Intelligence). It has to do with sensors and targeting. The scripts have a lot of "waitUntil" commands for locking the targeting camera to screenToWorld amongst other functions. What would be the most efficient way to write this/integrate it into a mission. I can write the whole thing in one file and "call compile preprocessFileLineNumbers" on init. I can create a CfgFunctions.hpp and add it to the description.ext, or I could make it an FSM. I'd love to hear from you guys. Thanks. Share this post Link to post Share on other sites
goko-- 147 Posted May 17, 2018 avoiding loops any means possible and/or putting sleep in them (1 second maybe) would take less to process for sure. If you can't put long sleep in waitUntil , decreasing the calculation for certain condition(s) would be ideal but from what you describe (targeting mod) that probably won't serve well. I don't know how your script runs, but calling it different ways (preprocess etc) won't change much. I'd go back to EH's and try figuring out an EH instead of loop with massive waituntils. even UI EH (a key bind) would take the strain off, script would only run if a key pressed and check if conditions are met once instead of whole time. If your script is related to locking onto an enemy aircraft - vehicle, you can add IncomingMissile EH to enemy side vehicles for triggering your script. https://community.bistudio.com/wiki/Arma_3:_Event_Handlers#IncomingMissile Or you can add fired EH to your vehicle, if you want it to trigger after you fire something. With EH you can spawn your script, edit the loop to run once, it will check the conditions once, keep executing if conditions met or it will be destroyed if conditions dont met. Share this post Link to post Share on other sites
o5_ 7 Posted June 21, 2018 Thanks for the reply. I'll certainly consider your recommendations and see what I can do. Sent from my SM-G930F using Tapatalk Share this post Link to post Share on other sites