allObjects: Difference between revisions

From Bohemia Interactive Community
Jump to navigation Jump to search
No edit summary
m (Some wiki formatting)
Line 7: Line 7:
|gr1= Object Manipulation
|gr1= Object Manipulation


|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, 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.


|s1= objectType [[allObjects]] simulationKind
|s1= objectType [[allObjects]] simulationKind


|p1= objectType: [[Number]] - see description
|p1= objectType: [[Number]] - type can be a combination of types according to bit flag operation (identical to [[getObjectType]]):
|p2= simulationKind: [[Number]] - see description
* 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.}}
 
|p2= simulationKind: [[Number]] - simulation kind can be:
* 0 - Slow (and very slow) entities: 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


|r1= [[Array]] - array of [[Object]]s
|r1= [[Array]] - array of [[Object]]s


|x1= <code>_visitorBuildings = 1 [[allObjects]] 0;</code>
|x1= <sqf>_visitorBuildings = 1 allObjects 0;</sqf>
|x2= <code>_userPlacedBuildings = 8 [[allObjects]] 0;</code>
 
|x3= <code>[[onEachFrame]]
|x2= <sqf>_userPlacedBuildings = 8 allObjects 0;</sqf>
 
|x3= <sqf>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>


|seealso= [[getObjectFOV]] [[cursorObject]] [[cursorTarget]] [[createSimpleObject]] [[allMissionObjects]] [[setObjectViewDistance]] [[getObjectViewDistance]] [[objectParent]] [[object]] [[getObjectType]]
|seealso= [[getObjectFOV]] [[cursorObject]] [[cursorTarget]] [[createSimpleObject]] [[allMissionObjects]] [[setObjectViewDistance]] [[getObjectViewDistance]] [[objectParent]] [[object]] [[getObjectType]]
}}
}}

Revision as of 10:58, 3 May 2022

Hover & click on the images for description
Only available in Development branch(es) until its release with Arma 3 patch v2.10.

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.
Groups:
Object Manipulation

Syntax

Syntax:
objectType allObjects simulationKind
Parameters:
objectType: Number - type can be a combination of types according to bit flag operation (identical to getObjectType):
  • 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.
simulationKind: Number - simulation kind can be:
  • 0 - Slow (and very slow) entities: 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
Return Value:
Array - array of Objects

Examples

Example 1:
_visitorBuildings = 1 allObjects 0;
Example 2:
_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) ]; };

Additional Information

See also:
getObjectFOV cursorObject cursorTarget createSimpleObject allMissionObjects setObjectViewDistance getObjectViewDistance objectParent object getObjectType

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