{"name":"allMissionObjects","operator":null,"title":"allMissionObjects","type":"command","url":"https://community.bistudio.com/wiki/allMissionObjects","revid":369567,"updated":"2024-09-24T07:52:15Z","groups":["Object Detection"],"status":"ok","replaced_by":[],"games":[{"game":"arma2oa","name":"Arma 2: Operation Arrowhead","version":"1.57"},{"game":"tkoh","name":"Take On Helicopters","version":"1.00"},{"game":"arma3","name":"Arma 3","version":"0.50"}],"since":{"game":"arma2oa","name":"Arma 2: Operation Arrowhead","version":"1.57"},"arma3_since":"0.50","branch":null,"locality":{"argument":null,"effect":null,"server_exec":false},"exec":null,"description":"Returns all objects of the given type that are currently present in the mission. In some cases, the entities and allObjects commands are much faster alternatives to this command.\n\nSome of the special types that can be detected with this command (and with nearestObject):\n- `\"\"` - returns everything, e.g. agents, bees, mosquitoes, footprints, armed mines, ...\n- `\"all\"` - more restrictive than `\"\"`: no ambient insects, only agents such as rabbits and snakes, no footprints, tracks, no armed mines\n- `\"#slop\"` - blood drops\n- `\"#mark\"` - unit footprints\n- `\"#track\"` - vehicle tracks\n- `\"#crater\"` - explosion craters on the ground\n- `\"#crateronvehicle\"` - bullet marks on vehicles\n- `\"#explosion\"` - explosions\n- `\"#objectdestructed\"` - building, tree or bush destruction\n- `\"#soundonvehicle\"` - sounds created with say3D for example\n- `\"#dynamicsound\"` - sound sources created using createSoundSource\n- `\"EmptyDetector\"` - all Triggers\n- `\"Logic\"` - all game logics\n\n> [!IMPORTANT]\n> This command is quite performance heavy. Use with caution!","syntaxes":[{"syntax":"allMissionObjects type","since":null,"effect":null,"exec":null,"params":[{"name":"type","type":"String","optional":false,"default":null,"description":null,"types":["String"],"since":null,"text":"type: String"}],"returns":{"type":"Array of Objects","types":["Array","Object"],"description":null,"text":"Array of Objects"},"form":"unary","operator":null,"left":null,"right":{"text":"type","types":["String"]}}],"examples":[{"text":"```sqf\n_airObjects = allMissionObjects \"Air\";\n```","code":["_airObjects = allMissionObjects \"Air\";"]},{"text":"```sqf\n{ deleteVehicle _x; } forEach (allMissionObjects \"\");\n```","code":["{ deleteVehicle _x; } forEach (allMissionObjects \"\");"]},{"text":"```sqf\n_allMObjects = allMissionObjects \"All\";\n```","code":["_allMObjects = allMissionObjects \"All\";"]}],"multiplayer":"> [!NOTE]\n> This command is ~5 times faster on a dedicated server than on a client. Reason unknown.","problems":null,"aliases":[],"see_also":["allObjects","allDead","allGroups","allUnits","entities","vehicles","allMines","allSimpleObjects"],"notes":[],"categories":["Arma 2: Operation Arrowhead: New Scripting Commands","Arma 2: Operation Arrowhead: Scripting Commands","Arma 3: Scripting Commands","Command Group: Object Detection","Introduced with Arma 2: Operation Arrowhead version 1.57","Scripting Commands","Take On Helicopters: Scripting Commands"]}