getMissionLayerEntities: Difference between revisions

From Bohemia Interactive Community
Jump to navigation Jump to search
m (Text replacement - "<tt>([^= ]+)<\/tt>" to "{{hl|$1}}")
m (Some wiki formatting)
Line 8: Line 8:
|gr2= Mission Information
|gr2= Mission Information


|descr= Returns all entities within specific [[Eden Editor: Layer|Eden Editor layer]] and sub-layers. To be used when the scenario is running, not in the editor workspace. Useful for disabling / enabling whole parts of the scenario which you add to specific layer while editing.
|descr= Returns all entities within the specific [[Eden Editor: Layer|Eden Editor layer]] and its sub-layers. To be used when the scenario is running, not in the editor workspace. Useful to disable/enable whole parts of the scenario if layers are used during mission design.
{{Feature | Informative | Default layers are not returned.}}
{{Feature|informative|Default layers are not returned.}}


|s1= [[getMissionLayerEntities]] layerName
|s1= [[getMissionLayerEntities]] layerName


|p1= layerName: [[String]] - Layer name in the editor. If multiple layers with the same name are present in the scenario, the first found one is used
|p1= layerName: can be one of:
* [[String]] - case-insensitive; layer name in the editor. If multiple layers with the same name are present in the scenario, the first found one is used
* [[Number]] - layer ID in the editor


|r1= [[Array]] in format {{hl|[<nowiki/>[objects], [markers]]}}
|r1= [[Array]] in format {{hl|[<nowiki/>[objects], [markers]]}} or empty array if the layer does not exist


|x1= <code>_base = [[getMissionLayerEntities]] "Base";</code>
|x1= <code>[[private ]]_base = [[getMissionLayerEntities]] "Base";</code>


|x2= <code>[[waitUntil]] {([[player]] [[distance]] _someObject) > 800};
|x2= delete all objects within that layer after the player is over 800m away from _someObject:
<code>[[waitUntil]] { [[sleep]] 1; ([[player]] [[distance]] _someObject) > 800 };
[[private]] _simpleObjects = ([[getMissionLayerEntities]] "Simple Objects") [[select]] 0;
{
{
[[deleteVehicle]] [[Magic Variables#x|_x]];
[[deleteVehicle]] [[Magic Variables#x|_x]];
} [[forEach]] (([[getMissionLayerEntities]] "Simple Objects") [[select]] 0); {{cc|Deletes all objects within that layer after the player is over 800m away from _someObject}}</code>
} [[forEach]] _simpleObjects;</code>


|x3= <code>_layer1337Entities = [[getMissionLayerEntities]] 1337;</code>
|x3= <code>[[private]] _layer1337Entities = [[getMissionLayerEntities]] 1337;</code>
 
|s2= [[getMissionLayerEntities]] layerID
 
|p21= layerID: [[Number]] - Layer ID in the editor
 
|r2= [[Array]] in format {{hl|<nowiki>[</nowiki>[objects], [markers]]}}


|seealso= [[get3DENLayerEntities]]
|seealso= [[get3DENLayerEntities]]
Line 37: Line 35:
}}
}}


<dl class="command_description">
{{Note
 
|user= R3vo
<dt></dt>
|timestamp= 20161026152700
<dd class="notedate">Posted on October 26, 2016 - 15:27 (UTC)</dd>
|text= After an [[object]] was deleted from a layer, [[getMissionLayerEntities]] will return {{hl|&lt;NULL-object&gt;}} for the deleted [[object]].
<dt class="note">[[User:R3vo|R3vo]]</dt>
}}
<dd class="note">
After an [[object]] was deleted from a layer, [[getMissionLayerEntities]] will return {{hl|&lt;NULL-object&gt;}} for the deleted [[object]].
</dd>
<dd class="notedate">Posted on November 10, 2021 - 23:05 (UTC)</dd>
<dt class="note">[[User:nomisum|nomisum]]</dt>
<dd class="note">
[[getMissionLayerEntities]] will also return objects in sublayers.
</dd>
</dl>

Revision as of 14:09, 29 December 2021

Hover & click on the images for description

Description

Description:
Returns all entities within the specific Eden Editor layer and its sub-layers. To be used when the scenario is running, not in the editor workspace. Useful to disable/enable whole parts of the scenario if layers are used during mission design.
Default layers are not returned.
Groups:
Eden EditorMission Information

Syntax

Syntax:
getMissionLayerEntities layerName
Parameters:
layerName: can be one of:
  • String - case-insensitive; layer name in the editor. If multiple layers with the same name are present in the scenario, the first found one is used
  • Number - layer ID in the editor
Return Value:
Array in format [[objects], [markers]] or empty array if the layer does not exist

Examples

Example 1:
private _base = getMissionLayerEntities "Base";
Example 2:
delete all objects within that layer after the player is over 800m away from _someObject: waitUntil { sleep 1; (player distance _someObject) > 800 }; private _simpleObjects = (getMissionLayerEntities "Simple Objects") select 0; { deleteVehicle _x; } forEach _simpleObjects;
Example 3:
private _layer1337Entities = getMissionLayerEntities 1337;

Additional Information

See also:
get3DENLayerEntities

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
R3vo - c
Posted on Oct 26, 2016 - 15:27 (UTC)
After an object was deleted from a layer, getMissionLayerEntities will return <NULL-object> for the deleted object.