SRBuckey5266 3 Posted July 22, 2014 Is it supposed to be a replacement for "_this select 0"? Are there any differences in speed? Share this post Link to post Share on other sites
Sniperwolf572 759 Posted July 22, 2014 (edited) _this select 0 will always be faster due to the fact it's not doing anything else besides getting the 0 indexed element from _this. However BIS_fnc_param has advantages to make your life easier: Default values - Value to be used if a parameter is not defined. Useful for certain defaults and optional parameters. Type checking - Requiring a parameter to be of a certain type(s). In case you need an object but someone passes in an int or a string, an error is shown. Array length checking - If the parameter can take an array, check that it has a required amount of elements. This way, you don't need to write code for these things yourself. More info here and here. Edited July 22, 2014 by Sniperwolf572 Share this post Link to post Share on other sites
Grumpy Old Man 3550 Posted July 22, 2014 Like sniperwolf573 said, it's to make your life easier. A good quote the wiki says "If you need to write it twice put it in a function". Share this post Link to post Share on other sites
moricky 211 Posted July 22, 2014 More info can be found on Community Wiki: BIS_fnc_param Functions Library EDIT: Nevermind, just noticed that Sniperwolf572 mentioned them already :) Share this post Link to post Share on other sites
fight9 14 Posted July 22, 2014 I find the functions makes setting default values for optional arguments easier. _param0 = if (count _this > 0) then {_this select 0} else {false}; // is the same as _param0 = [_this,0,false] call BIS_fnc_param; Share this post Link to post Share on other sites