allMissionObjects: Difference between revisions

From Bohemia Interactive Community
Jump to navigation Jump to search
(Add non-simple objects info (credits to Greger on Discord))
(Undo revision 341353 by Lou Montana (talk))
Tag: Undo
Line 12: Line 12:
|gr1= Object Detection
|gr1= Object Detection


|descr= Returns all objects (not [[Arma 3: Simple Objects|simple objects]]) of the given type that are currently present in the mission. In some cases, the [[entities]] command is a much faster alternative to this command.<br>
|descr= Returns all objects of the given type that are currently present in the mission. In some cases, the [[entities]] command is a much faster alternative to this command.<br>
Some of the special types that can be detected with this command (and with [[nearestObject]]):
Some of the special types that can be detected with this command (and with [[nearestObject]]):
* {{hl|""}} - returns everything, e.g. agents, bees, mosquitoes, footprints, armed mines, ...
* {{hl|""}} - returns everything, e.g. agents, bees, mosquitoes, footprints, armed mines, ...
Line 39: Line 39:
|x1= <sqf>_airObjects = allMissionObjects "Air";</sqf>
|x1= <sqf>_airObjects = allMissionObjects "Air";</sqf>


|x2= <sqf>{ deleteVehicle _x } forEach allMissionObjects "";</sqf>
|x2= <sqf>{ deleteVehicle _x; } forEach (allMissionObjects "");</sqf>


|x3= <sqf>_allMObjects = allMissionObjects "All";</sqf>
|x3= <sqf>_allMObjects = allMissionObjects "All";</sqf>

Revision as of 18:20, 23 May 2023

Hover & click on the images for description

Description

Description:
Returns all objects of the given type that are currently present in the mission. In some cases, the entities command is a much faster alternative to this command.
Some of the special types that can be detected with this command (and with nearestObject):
  • "" - returns everything, e.g. agents, bees, mosquitoes, footprints, armed mines, ...
  • "all" - more restrictive than "": no ambient insects, only agents such as rabbits and snakes, no footprints, tracks, no armed mines
  • "#slop" - blood drops
  • "#mark" - unit footprints
  • "#track" - vehicle tracks
  • "#crater" - explosion craters on the ground
  • "#crateronvehicle" - bullet marks on vehicles
  • "#explosion" - explosions
  • "#objectdestructed" - building, tree or bush destruction
  • "#soundonvehicle" - sounds created with say3D for example
  • "#dynamicsound" - sound sources created using createSoundSource
  • "EmptyDetector" - all Triggers
  • "Logic" - all game logics
This command is quite performance heavy. Use with caution!
Multiplayer:
Arma 3
This command is ~5 times faster on a dedicated server than on a client. Reason unknown.
Groups:
Object Detection

Syntax

Syntax:
allMissionObjects type
Parameters:
type: String
Return Value:
Array of Objects

Examples

Example 1:
_airObjects = allMissionObjects "Air";
Example 2:
{ deleteVehicle _x; } forEach (allMissionObjects "");
Example 3:
_allMObjects = allMissionObjects "All";

Additional Information

See also:
allObjects allDead allGroups allUnits entities vehicles allMines allSimpleObjects

Notes

Report bugs on the Feedback Tracker and/or discuss them on the Arma Discord or on the Forums.
Only post proven facts here! Add Note