fawlty 27 Posted October 28, 2019 Making up some compositions and need this for a upcoming mission but can see more uses for it The question, is there a easier way to achieve this than c1 setCaptive false; c2 setCaptive false; c3 setCaptive false; c4 setCaptive false; c5 setCaptive false; c6 setCaptive false; c7 setCaptive false; C being individual civilians. I'm trying to group the c1,c2 etc. Share this post Link to post Share on other sites
killzone_kid 1326 Posted October 28, 2019 for "_i" from 1 to 7 do { (missionNamespace getVariable ["c" + str _i, objNull]) setCaptive false }; 2 1 Share this post Link to post Share on other sites
fawlty 27 Posted October 28, 2019 Thanks KK, that certainly worked but from my very limited script knowledge the original makes more sense to me. The key words here are 'limited knowledge' Thanks again Share this post Link to post Share on other sites
killzone_kid 1326 Posted October 28, 2019 Feel free to expand your knowledge by visiting https://community.bistudio.com/wiki/Main_Page You might want to look at forEach Share this post Link to post Share on other sites
wogz187 1085 Posted October 28, 2019 @fawlty, It's something like this, Quote for "_i" from 1 to 7 do { // count from c_ entities in your array (good thing you named them numerically) (missionNamespace getVariable ["c" + str _i, objNull]) // look for objects named "c+_i" in missionNameSpace setCaptive false }; //do this to each "c+_i" Quote the original makes more sense to me. Perhaps at this stage but if you had to add more script the original method would get complicated very quickly. Have fun! 1 Share this post Link to post Share on other sites