allMissionObjects: Difference between revisions

From Bohemia Interactive Community
Jump to navigation Jump to search
No edit summary
m (Text replacement - "{{Feature|Important|" to "{{Feature|important|")
 
(53 intermediate revisions by 9 users not shown)
Line 1: Line 1:
{{Command|= Comments
{{RV|type=command
____________________________________________________________________________________________


| arma2oa |= Game name
|game1= arma2oa
|version1= 1.57


|1.57|= Game version
|game2= tkoh
____________________________________________________________________________________________
|version2= 1.00


| Returns all mission objects (created by or during a mission) with given type (or its subtype). In some cases [[allMissionObjects]] could be substituted with [[entities]], which would be much much faster alternative. Some of the unusual mission objects that can be detected with this command (as well as with [[nearestObject]]):
|game3= arma3
* <tt>"#slop"</tt> - blood drop
|version3= 0.50
* <tt>"#mark"</tt> - unit footprints
* <tt>"#track"</tt> - vehicle tracks
* <tt>"#crater"</tt> - explosion crater on the ground
* <tt>"#crateronvehicle"</tt> - bullet marks on vehicle
* <tt>"#explosion"</tt> - an explosion
* <tt>"#objectdestructed"</tt> - building, tree or bush destruction
* <tt>"#soundonvehicle"</tt> - sound created with [[say3D]] for example|= Description
____________________________________________________________________________________________


| '''allMissionObjects''' type |= Syntax
|gr1= Object Detection


|p1 = type: [[String]] |= Parameter 1
|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]]):
* {{hl|""}} - returns everything, e.g. agents, bees, mosquitoes, footprints, 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|"#slop"}} - blood drops
* {{hl|"#mark"}} - unit footprints
* {{hl|"#track"}} - vehicle tracks
* {{hl|"#crater"}} - explosion craters on the ground
* {{hl|"#crateronvehicle"}} - bullet marks on vehicles
* {{hl|"#explosion"}} - explosions
* {{hl|"#objectdestructed"}} - building, tree or bush destruction
* {{hl|"#soundonvehicle"}} - sounds created with [[say3D]] for example
* {{hl|"#dynamicsound"}} - sound sources created using [[createSoundSource]]
* {{hl|"EmptyDetector"}} - all [[Trigger]]s
* {{hl|"Logic"}} - all game logics
{{Feature|important|This command is quite performance heavy. Use with caution!}}


| [[Array]] of [[Object|Objects]]|= RETURNVALUE
|mp= {{Feature|arma3|This command is ~5 times faster on a dedicated server than on a client. Reason unknown.}}


|s1= [[allMissionObjects]] type


|x1= <code>_airObjects = [[allMissionObjects]] "Air";</code>|= EXAMPLE1
|p1= type: [[String]]


|x2= <code>{ [[deleteVehicle]] _x } [[forEach]] ([[allMissionObjects]] "");</code>|= EXAMPLE2
|r1= [[Array]] of [[Object]]s


|x3= <code>_allMObjects =[[ allMissionObjects]] "All";</code>|= EXAMPLE3
|x1= <sqf>_airObjects = allMissionObjects "Air";</sqf>


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


| [[allDead]], [[allGroups]], [[allUnits]], [[entities]], [[vehicles]], [[allMines]] |= SEEALSO
|x3= <sqf>_allMObjects = allMissionObjects "All";</sqf>


| |= MPBEHAVIOUR
|seealso= [[allObjects]] [[allDead]] [[allGroups]] [[allUnits]] [[entities]] [[vehicles]] [[allMines]] [[allSimpleObjects]]
____________________________________________________________________________________________
}}
}}
<h3 style='display:none'>Notes</h3>
<dl class='command_description'>
<!-- Note Section BEGIN -->
<dd class="notedate">Posted on June 22, 2012
<dt class="note">'''[[User:Rocket|Rocket]]'''
<dd class="note">Be VERY careful with the use of this command. It is very demanding as it must iterate through all mission created objects. Particular care should be taken exercising this often on dedicated servers.
<dd class="notedate">Posted on Decembere 15, 2013
<dt class="note">'''[[User:Killzone_Kid|Killzone_Kid]]'''
<dd class="note">For some reason in Arma 3 this command is up to 5 times faster on the dedicated server than on a connected client. In my experiments it took on average 5 ms for the command to complete on a client while under 1 ms on the server.
<!-- Note Section END -->
</dl>
<h3 style='display:none'>Bottom Section</h3>
[[Category:Scripting Commands|{{uc:{{PAGENAME}}}}]]
[[Category:Scripting Commands ArmA2|{{uc:{{PAGENAME}}}}]]
[[Category:Scripting Commands Arma 3|{{uc:{{PAGENAME}}}}]]
[[Category:Scripting_Commands_Take_On_Helicopters|{{uc:{{PAGENAME}}}}]]
[[Category:ArmA 2 OA: New Scripting Commands List|{{uc:{{PAGENAME}}}}]]

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