allMissionObjects: Difference between revisions

From Bohemia Interactive Community
Jump to navigation Jump to search
m (Text replacement - "<tt>([a-zA-Z0-9\. _"']+)<\/tt>" to "{{hl|$1}}")
m (Text replacement - "{{Feature|Important|" to "{{Feature|important|")
 
(9 intermediate revisions by 4 users not shown)
Line 12: Line 12:
|gr1= Object Detection
|gr1= Object Detection


|descr= Returns all mission objects which were created by and during the mission with given type or its subtype. In some cases [[allMissionObjects]]. Sometimes [[allMissionObjects]] could be replaced by the much faster [[entities]] command.
|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>
<br><br>
Some of the special types that can be detected with this command (and with [[nearestObject]]):
Some of the unusual mission objects that can be detected with this command as well as with [[nearestObject]]:
* {{hl|""}} - returns everything, e.g. agents, bees, mosquitoes, footprints, armed mines, ...
* {{hl|""}} - returns everything like agents, bees, mosquitoes, foot prints (footstep), armed mines...
* {{hl|"all"}} - more restrictive than {{hl|""}}: no ambient insects, only agents such as rabbits and snakes, no footprints, tracks, no armed mines
* {{hl|"all"}} - more restrictive than {{hl|""}}: no ambient insects, just agents like rabbits and snakes, no foot prints, tracks, no armed mines
* {{hl|"#slop"}} - blood drops
* <tt>"#slop"</tt> - blood drop
* {{hl|"#mark"}} - unit footprints
* <tt>"#mark"</tt> - unit footprints
* {{hl|"#track"}} - vehicle tracks
* <tt>"#track"</tt> - vehicle tracks
* {{hl|"#crater"}} - explosion craters on the ground
* <tt>"#crater"</tt> - explosion crater on the ground
* {{hl|"#crateronvehicle"}} - bullet marks on vehicles
* <tt>"#crateronvehicle"</tt> - bullet marks on vehicle
* {{hl|"#explosion"}} - explosions
* <tt>"#explosion"</tt> - an explosion
* {{hl|"#objectdestructed"}} - building, tree or bush destruction
* <tt>"#objectdestructed"</tt> - building, tree or bush destruction
* {{hl|"#soundonvehicle"}} - sounds created with [[say3D]] for example
* <tt>"#soundonvehicle"</tt> - sound created with [[say3D]] for example
* {{hl|"#dynamicsound"}} - sound sources created using [[createSoundSource]]
* <tt>"#dynamicsound"</tt> - sound source created using [[createSoundSource]]
* {{hl|"EmptyDetector"}} - all [[Trigger]]s
* {{hl|"EmptyDetector"}} - All [[trigger]]s
* {{hl|"Logic"}} - all game logics
* {{hl|"Logic"}} - All game logics
{{Feature|important|This command is quite performance heavy. Use with caution!}}
{{Feature|Important|This command is quite performance heavy. Use with caution!}}


|mp= {{Feature|arma3|This command is ~5 times faster on a dedicated server than on a client. Reason unknown.}}
|mp= {{Feature|arma3|This command is ~5 times faster on a dedicated server than on a client. Reason unknown.}}


|s1= [[allMissionObjects]] type
|s1= [[allMissionObjects]] type


|p1= type: [[String]]
|p1= type: [[String]]


|r1= [[Array]] of [[Object|Objects]]
|r1= [[Array]] of [[Object]]s


|x1= <code>_airObjects = [[allMissionObjects]] "Air";</code>
|x1= <sqf>_airObjects = allMissionObjects "Air";</sqf>


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


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


|seealso= [[allDead]], [[allGroups]], [[allUnits]], [[entities]], [[vehicles]], [[allMines]], [[allSimpleObjects]]
|seealso= [[allObjects]] [[allDead]] [[allGroups]] [[allUnits]] [[entities]] [[vehicles]] [[allMines]] [[allSimpleObjects]]
}}
}}

Latest revision as of 01:23, 2 February 2024

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