Mr H. 402 Posted April 8, 2019 ok let's say you have an array containing booleans in a configfile something like: class myCfg { class Test { myarray[]={true}; }; }; now the getArray command will return... a string inside the array instead of a boolean. getArray (missionConfigFile>>"myCfg">>"test">>"myArray) //Retuns ["true"] I was wondering if someone knows of an alternative function/command that will return arrays with "real" BOOL instead ? Share this post Link to post Share on other sites
POLPOX 778 Posted April 8, 2019 Use number (0 or 1) instead or convert "true" string to true boolean by using call compile. 1 Share this post Link to post Share on other sites
Mr H. 402 Posted April 8, 2019 2 minutes ago, POLPOX said: Use number (0 or 1) instead or convert "true" string to true boolean by using call compile. I'll do that eventually yes but it's a shame there's no engine solution for that issue. Share this post Link to post Share on other sites
killzone_kid 1331 Posted April 8, 2019 There is no getBool or getBoolean command either, because there is no boolean type in config, only strings, numbers and arrays of strings and numbers.https://community.bistudio.com/wiki/Boolean Share this post Link to post Share on other sites
Larrow 2822 Posted April 9, 2019 8 hours ago, POLPOX said: convert "true" string to true boolean by using call compile Just use apply, rather than compiling the string. Bools stored as numbers. TAG_fnc_getBoolArray = { params[ "_path" ]; getArray( _path ) apply{ _x > 0 }; } Bools stored as strings. TAG_fnc_getBoolArray = { params[ "_path" ]; getArray( _path ) apply{ _x == "true" }; } 2 Share this post Link to post Share on other sites
killzone_kid 1331 Posted April 9, 2019 You can write arr[]={quitetrue} and it will return ["quitetrue"] because for config parser `everything that is not a number must be string` 1 Share this post Link to post Share on other sites
Mr H. 402 Posted April 9, 2019 6 hours ago, Larrow said: Just use apply, rather than compiling the string. Bools stored as numbers. TAG_fnc_getBoolArray = { params[ "_path" ]; getArray( _path ) apply{ _x > 0 }; } Bools stored as strings. TAG_fnc_getBoolArray = { params[ "_path" ]; getArray( _path ) apply{ _x == "true" }; } Simple/ elegant / perfect! Share this post Link to post Share on other sites