allObjects: Difference between revisions

From Bohemia Interactive Community
Jump to navigation Jump to search
(Created page with "{{RV|type=command |game1= arma3 |version1= 2.10 |branch= dev |gr1= Object Manipulation |descr= Returns array of requested objects as fast as the engine allows it. The objec...")
 
m (Fix)
 
(27 intermediate revisions by 6 users not shown)
Line 3: Line 3:
|game1= arma3
|game1= arma3
|version1= 2.10
|version1= 2.10
|branch= dev


|gr1= Object Manipulation
|gr1= Object Detection


|descr= Returns array of requested objects as fast as the engine allows it. The objects can be requested by object type and simulation kind. For object types see [[getObjectType]]. The type could be a combination of types according to bit flag operation. For example if required objects are both Visitor placed ('''1''') and dynamically placed ('''8''') the combine type will be '''9'''. Use '''63''' to return objects of all types. The simulation kind could be:
|descr= Returns array of requested objects as fast as the engine allows it. The objects can be requested by object type and simulation kind.
* 0 - Slow (and very slow) entities: houses, rubles, street lamps, churches, etc.
{{Feature|informative|Some terrain placed objects are not part of slow vehicles collection, use [[nearestTerrainObjects]] command to return these objects}}
* 1 - Normal entities: vehicles etc.
 
|s1= objectType [[allObjects]] objectCollection
 
|p1= objectType: [[Number]] - type can be a combination of types according to bit flag operation (see [[getObjectType]]):
* -1 - {{GVI|arma3|2.12|size= 0.75}} All types incl. nulls (nulls exist with 'objectCollection' 7 and 8)
* 1 - Primary - normal object placed in Terrain Builder, part of landscape
* 2 - Network - road placed in Terrain Builder, part of landscape
* 4 - Temporary - temporary object (like vehicle tracks)
* 8 - TypeVehicle - entity added by game
* 16 - TypeTempVehicle - temporary entity
* 32 - LandDecal - land decal
For example if required objects are both TerrainBuilder-placed ('''1''') and dynamically placed ('''8''') the combination type will be 8 + 1 = '''9'''
{{Feature|informative|Use '''63''' (1 + 2 + 4 + 8 + 16 + 32) to return objects of all types (excl. nulls).}}
 
|p2= objectCollection: [[Number]] - supported values:
* 0 - Slow (and very slow) entities: some houses, rubbles, street lamps, churches, etc
* 1 - Normal entities: vehicles etc
* 2 - Fast entities: shots and other high precision entities
* 2 - Fast entities: shots and other high precision entities
* 3 - Cloudlets: smokes, dust, etc.
* 3 - Cloudlets: smokes, dust, etc
* 4 - Out vehicles: objects that are not listed anywhere else, holders, etc.
* 4 - Out vehicles: objects that are not listed anywhere else, holders, etc
* 5 - Animals: animals, birds, insects, etc.
* 5 - Animals: animals, birds, insects, etc
* 6 - Mines: mines.
* 6 - Mines: mines
* 7 - {{GVI|arma3|2.12|size= 0.75}} Sensor map: ordered triggers. When trigger is created it is added to this collection in the order of creation. When deleted it becomes null. Use 'objectType' -1 to include nulls
* 8 - {{GVI|arma3|2.12|size= 0.75}} Vehicle map: ordered vehicles. When vehicle is created it is added to this collection in the order of creation. When deleted it becomes null. Use 'objectType' -1 to include nulls
* 9 - {{GVI|arma3|2.18|size= 0.75}} Vehicles and [[crew]]: normal entities as in 1 as well as crew if an entity is a vehcile with crew.


|s1= objectType [[allObjects]] simulationKind
|r1= [[Array]] - array of [[Object]]s


|p1= objectType: [[Number]] - see description
|s2= objectType [[allObjects]] objectCollection
|p2= simulationKind: [[Number]] - see description
|s2since= arma3 2.12
|p21= objectType: [[String]] - type of the objects (will exact match return of [[typeOf]])
|p22= objectCollection: [[Number]] - see main syntax above


|r1= [[Array]] - array of [[Object]]s
|r2= [[Array]] - array of [[Object]]s
 
|x1= <sqf>private _visitorBuildings = 1 allObjects 0;</sqf>
 
|x2= <sqf>private _userPlacedBuildings = 8 allObjects 0;</sqf>


|x1= <code>_visitorBuildings = 1 [[allObjects]] 0;</code>
|x3= <sqf>
|x2= <code>_userPlacedBuildings = 8 [[allObjects]] 0;</code>
onEachFrame
|x3= <code>[[onEachFrame]]
{
  {
hintSilent str
[[hintSilent]] [[str]]
[
[
[[count]] (63 [[allObjects]]] 0),
count (63 allObjects 0),
[[count]] (63 [[allObjects]] 1),
count (63 allObjects 1),
[[count]] (63 [[allObjects]] 2),
count (63 allObjects 2),
[[count]] (63 [[allObjects]] 3),
count (63 allObjects 3),
[[count]] (63 [[allObjects]] 4),
count (63 allObjects 4),
[[count]] (63 [[allObjects]] 5),
count (63 allObjects 5),
[[count]] (63 [[allObjects]] 6)
count (63 allObjects 6)
];
];
  };</code>
};
</sqf>
 
|x4= <sqf>
private _allGroundWeaponHolders = "GroundWeaponHolder" allObjects 0;
private _allSimulatedWeaponHolders = "WeaponHolderSimulated" allObjects 1;
</sqf>
 
|seealso= [[getObjectFOV]] [[cursorObject]] [[cursorTarget]] [[createSimpleObject]] [[allMissionObjects]] [[setObjectViewDistance]] [[getObjectViewDistance]] [[objectParent]] [[object]] [[getObjectType]] [[allPlayers]] [[allGroups]] [[allDead]] [[playableUnits]] [[switchableUnits]] [[units]] [[vehicles]] [[allUnitsUAV]] [[allCurators]] [[playersNumber]]
}}


|seealso= [[getObjectFOV]] [[cursorObject]] [[cursorTarget]] [[createSimpleObject]] [[allMissionObjects]] [[setObjectViewDistance]] [[getObjectViewDistance]] [[objectParent]] [[object]] [[getObjectType]]
{{Note
|user= PierreMGI
|timestamp= 20221130173209
|text= This command (<sqf inline>63 allObjects 0</sqf>) will return lamps or poles but not houses. Use [[nearestTerrainObjects]] instead.
}}
}}

Latest revision as of 19:17, 26 March 2024

Hover & click on the images for description

Description

Description:
Returns array of requested objects as fast as the engine allows it. The objects can be requested by object type and simulation kind.
Some terrain placed objects are not part of slow vehicles collection, use nearestTerrainObjects command to return these objects
Groups:
Object Detection

Syntax

Syntax:
objectType allObjects objectCollection
Parameters:
objectType: Number - type can be a combination of types according to bit flag operation (see getObjectType):
  • -1 - Arma 3 logo black.png2.12 All types incl. nulls (nulls exist with 'objectCollection' 7 and 8)
  • 1 - Primary - normal object placed in Terrain Builder, part of landscape
  • 2 - Network - road placed in Terrain Builder, part of landscape
  • 4 - Temporary - temporary object (like vehicle tracks)
  • 8 - TypeVehicle - entity added by game
  • 16 - TypeTempVehicle - temporary entity
  • 32 - LandDecal - land decal
For example if required objects are both TerrainBuilder-placed (1) and dynamically placed (8) the combination type will be 8 + 1 = 9
Use 63 (1 + 2 + 4 + 8 + 16 + 32) to return objects of all types (excl. nulls).
objectCollection: Number - supported values:
  • 0 - Slow (and very slow) entities: some houses, rubbles, street lamps, churches, etc
  • 1 - Normal entities: vehicles etc
  • 2 - Fast entities: shots and other high precision entities
  • 3 - Cloudlets: smokes, dust, etc
  • 4 - Out vehicles: objects that are not listed anywhere else, holders, etc
  • 5 - Animals: animals, birds, insects, etc
  • 6 - Mines: mines
  • 7 - Arma 3 logo black.png2.12 Sensor map: ordered triggers. When trigger is created it is added to this collection in the order of creation. When deleted it becomes null. Use 'objectType' -1 to include nulls
  • 8 - Arma 3 logo black.png2.12 Vehicle map: ordered vehicles. When vehicle is created it is added to this collection in the order of creation. When deleted it becomes null. Use 'objectType' -1 to include nulls
  • 9 - Arma 3 logo black.png2.18 Vehicles and crew: normal entities as in 1 as well as crew if an entity is a vehcile with crew.
Return Value:
Array - array of Objects

Alternative Syntax

Syntax:
objectType allObjects objectCollection
Parameters:
objectType: String - type of the objects (will exact match return of typeOf)
objectCollection: Number - see main syntax above
Return Value:
Array - array of Objects

Examples

Example 1:
private _visitorBuildings = 1 allObjects 0;
Example 2:
private _userPlacedBuildings = 8 allObjects 0;
Example 3:
onEachFrame { hintSilent str [ count (63 allObjects 0), count (63 allObjects 1), count (63 allObjects 2), count (63 allObjects 3), count (63 allObjects 4), count (63 allObjects 5), count (63 allObjects 6) ]; };
Example 4:
private _allGroundWeaponHolders = "GroundWeaponHolder" allObjects 0; private _allSimulatedWeaponHolders = "WeaponHolderSimulated" allObjects 1;

Additional Information

See also:
getObjectFOV cursorObject cursorTarget createSimpleObject allMissionObjects setObjectViewDistance getObjectViewDistance objectParent object getObjectType allPlayers allGroups allDead playableUnits switchableUnits units vehicles allUnitsUAV allCurators playersNumber

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
PierreMGI - c
Posted on Nov 30, 2022 - 17:32 (UTC)
This command (63 allObjects 0) will return lamps or poles but not houses. Use nearestTerrainObjects instead.