pcc 14 Posted May 21, 2017 In the Server_BuyUnit.sqf, I'm using the following for random soldier types. _unit = Call Compile Format["[%1%2Units] Call BIS_WF_GetRandomElement",_sideText,_factoryName]; But, how do I exclude certain units like pilot and crew? I've tried _unit = Call Compile Format["[%1%2Units] Call BIS_WF_GetRandomElement",_sideText,_factoryName]; while{_unit == "%1CREW" || _unit == "%1PILOT"} do { _unit = Call Compile Format["[%1%2Units] Call BIS_WF_GetRandomElement",_sideText,_factoryName]; }; But pilot and crew still gets picked. Share this post Link to post Share on other sites
opusfmspol 273 Posted May 22, 2017 Crew and pilot have to be call-compile-formatted as well. They use side letters rather than side text. Not tested, but this should make a copy of the factory units list, remove the pilot and crew from the copied list, and do random selection from it. _units = +(Call Compile Format ["%1%2Units",_sideText,_factoryName]); _pilot = Call Compile Format ["%1PILOT",_side Call GetSideLetter]; _crew = Call Compile Format ["%1CREW",_side Call GetSideLetter]; _units = _units - [_pilot,_crew]; _unit = _units Call BIS_WF_GetRandomElement; If no good, try call-compile-format on crew and pilot. 1 Share this post Link to post Share on other sites