{"name":"configClasses","operator":null,"title":"configClasses","type":"command","url":"https://community.bistudio.com/wiki/configClasses","revid":378371,"updated":"2026-04-03T16:49:12Z","groups":["Config"],"status":"ok","replaced_by":[],"games":[{"game":"arma3","name":"Arma 3","version":"1.24"}],"since":{"game":"arma3","name":"Arma 3","version":"1.24"},"arma3_since":"1.24","branch":null,"locality":{"argument":null,"effect":null,"server_exec":false},"exec":null,"description":"Returns an array of config entries which meet criteria in condition code. Command iterates through all available config sub classes of the given config class. Current looked at config is stored in _x variable (similar to alternative count command implementation). Condition has to return true in order for the looked at config to be added to the resulting array. Slightly faster than configProperties, but doesn't account for config properties or inherited entries.\n\n> [!IMPORTANT]\n> - The condition code passed to configClasses should only be used for **simple filter expressions** and nothing more\n> - Do not use `\"isClass _x\"` in the condition. The engine does this check already\n>\n> - Arma 3 v2.02 brought specific engine optimisations for the following conditions:\n>   - `\"true\"`\n>   - `\"getNumber (_x >> 'scope') > 0\"`","syntaxes":[{"syntax":"condition configClasses config","since":null,"effect":null,"exec":null,"params":[{"name":"condition","type":"String","optional":false,"default":null,"description":null,"types":["String"],"since":null,"text":"condition: String"},{"name":"config","type":"Config","optional":false,"default":null,"description":null,"types":["Config"],"since":null,"text":"config: Config"}],"returns":{"type":"Array of Configs","types":["Array","Config"],"description":null,"text":"Array of Configs"},"form":"binary","operator":null,"left":{"text":"condition","types":["String"]},"right":{"text":"config","types":["Config"]}},{"syntax":"configClasses [config, depth, includeInherited, allSubclasses, classNames]","since":"arma3 2.22","effect":null,"exec":null,"params":[{"name":"config","type":"Config","optional":false,"default":null,"description":"target config","types":["Config"],"since":null,"text":"config: Config - target config"},{"name":"depth","type":"Number","optional":false,"default":null,"description":"how many levels of subclasses to go deep","types":["Number"],"since":null,"text":"depth: Number - how many levels of subclasses to go deep"},{"name":"includeInherited","type":"Boolean","optional":false,"default":null,"description":"true to look through inherited classes","types":["Boolean"],"since":null,"text":"includeInherited: Boolean - true to look through inherited classes"},{"name":"allSubclasses","type":"Boolean","optional":false,"default":null,"description":"true to return all subclasses, false - to return only the last tier.","types":["Boolean"],"since":null,"text":"allSubclasses: Boolean - true to return all subclasses, false - to return only the last tier."},{"name":"classNames","type":"Boolean","optional":true,"default":"false","description":"when true class names Strings are returned, when false - Configs are returned.","types":["Boolean"],"since":null,"text":"classNames: Boolean - (Optional, default: false) when true class names Strings are returned, when false - Configs are returned."}],"returns":{"type":"Array of Configs or Strings, which represent class names.","types":["Array","Config","String"],"description":null,"text":"Array of Configs or Strings, which represent class names."},"form":"unary","operator":null,"left":null,"right":{"text":"[config, depth, includeInherited, allSubclasses, classNames]","types":["Array"]}}],"examples":[{"text":"collect all CfgVehicles configs:\n\n```sqf\n_configs = \"true\" configClasses (configFile >> \"CfgVehicles\");\n```","code":["_configs = \"true\" configClasses (configFile >> \"CfgVehicles\");"]},{"text":"Return all classes that can transport 10 and more soldiers:\n\n```sqf\n_transporters = \"getNumber (_x >> 'transportSoldier') >= 10\" configClasses (configFile >> \"CfgVehicles\");\n```","code":["_transporters = \"getNumber (_x >> 'transportSoldier') >= 10\" configClasses (configFile >> \"CfgVehicles\");"]},{"text":"Return all classes that inherit from 'RscText':\n\n```sqf\nhint str (\"inheritsFrom _x == (configFile >> 'RscText')\" configClasses configFile);\n```","code":["hint str (\"inheritsFrom _x == (configFile >> 'RscText')\" configClasses configFile);"]},{"text":"Return children:\n\n```sqf\nconfigClasses [configFile >> \"CfgGroups\", 0, true, true, true]\n//Returns [\"West\",\"East\",\"Indep\",\"Empty\"]\n```","code":["configClasses [configFile >> \"CfgGroups\", 0, true, true, true]\n//Returns [\"West\",\"East\",\"Indep\",\"Empty\"]"]}],"multiplayer":null,"problems":null,"aliases":[],"see_also":["Config","configFile","missionConfigFile","configProperties","configHierarchy","BIS_fnc_returnChildren"],"notes":[{"user":"Iceman77","date":"2014-10-19T12:24:00Z","text":"A fantastic way to filter stuff. eg:\n\n```sqf\n// create an array of west vehicles and spawn then in front of the player in rows of 5\n\nprivate [\"_cfgArray\", \"_xPos\", \"_yPos\", \"_veh\"];\n\n_cfgArray = \"( \n    (getNumber (_x >> 'scope') >= 2) && \n    {\n        getNumber (_x >> 'side') == 1 && \n        { getText (_x >> 'vehicleClass') in ['Armored', 'Car', 'Air'] }\n    }\n)\" configClasses (configFile >> \"CfgVehicles\");\n\n_xPos = 0;\n_yPos = 0;\n\n{\n    _yPos = _yPos + 20;\n    _veh = createVehicle [(configName _x), player modelToWorld [_xPos, _yPos, 0], [], 0, \"NONE\"];\n    if (_yPos >= 100) then\n    {\n        _yPos = 0;\n        _xPos = _xPos + 20;\n    };\n} forEach _cfgArray;\n```"},{"user":"Benargee","date":"2016-05-28T20:28:00Z","text":"configClasses does not account for inherited subclasses, use configProperties with isClass filter instead\n\n```sqf\nconfigProperties [_config, \"isClass _x\", true];\n```"},{"user":"Nelis75733126","date":"2017-05-28T09:18:00Z","text":"this will get a list of ALL locations on the currently loaded world\n\n```sqf\n( \"true\" configClasses (configFile >> \"CfgWorlds\" >> worldName >> \"names\" ) ) apply {\n    // change each config entry into a location\n    nearestLocation [\n        getArray ( _x >> \"position\" ),\n        getText ( _x >> \"type\" )\n    ]\n};\n```"}],"categories":["Arma 3: New Scripting Commands","Arma 3: Scripting Commands","Command Group: Config","Introduced with Arma 3 version 1.24","Scripting Commands"]}