getMissionLayerEntities: Difference between revisions

From Bohemia Interactive Community
Jump to navigation Jump to search
m (Text replacement - "\{\{GameCategory\|(arma[0123])\|New[ _]Scripting[ _]Commands[ _]List\}\}" to "{{GameCategory|$1|New Scripting Commands}}")
m (Fix)
 
(37 intermediate revisions by 3 users not shown)
Line 1: Line 1:
{{Command|Comments=
{{RV|type=command
____________________________________________________________________________________________


|arma3|Game name=
|game1= arma3
|version1= 1.56


|1.56|Game version=
|serverExec= server


|gr1= Eden Editor |GROUP1=
|gr1= Eden Editor


|gr2= Mission Information |GROUP2=
|gr2= Mission Information
____________________________________________________________________________________________


| Returns all entities within specific [[Eden Editor]] layer. To be used when the scenario is running, not in the editor workspace.
|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.}}


Useful for disabling / enabling whole parts of the scenario which you add to specific layer while editing.
|s1= [[getMissionLayerEntities]] layerName
{{Informative | Default layers are not returned.}} |DESCRIPTION=
____________________________________________________________________________________________


| [[getMissionLayerEntities]] layerName |SYNTAX=
|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


|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. |PARAMETER1=
|r1= [[Array]] in format [objects, markers, {{GVI|arma3|2.14|size= 0.75}} groups] (or empty array if the layer does not exist)


|r1= [[Array]] in format <code>[objects:Array, markers:Array]</code> |RETURNVALUE=
|x1= <sqf>private _base = getMissionLayerEntities "Base";</sqf>


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


|x3= <code>_layer1337Entities = [[getMissionLayerEntities]] 1337;</code> |EXAMPLE3=
|x3= <sqf>private _layer1337Entities = getMissionLayerEntities 1337;</sqf>


|s2= [[getMissionLayerEntities]] layerID |SYNTAX2=
|x4= <sqf>getMissionLayerEntities 42 params [["_objects", []], ["_markers", []], ["_groups", []]];</sqf>


|p21= layerID: [[Number]] - Layer ID in the editor.|PARAMETER21=
|seealso= [[get3DENLayerEntities]]
}}


|r2= [[Array]] in format <code>[objects:Array, markers:Array]</code> |RETURNVALUE2=
{{Note
____________________________________________________________________________________________
|user= R3vo
 
|timestamp= 20161026152700
| [[get3DENLayerEntities]] |SEEALSO=
|text= After an [[object]] was deleted from a layer, [[getMissionLayerEntities]] will return {{hl|&lt;NULL-object&gt;}} for the deleted [[object]].
 
|serverExec= server |SERVEREXEC=
}}
}}
<h3 style='display:none'>Notes</h3>
<dl class='command_description'>
<!-- Note Section BEGIN -->
<!-- Note Section END -->
</dl>
<!-- DISCONTINUE Notes -->
<h3 style='display:none'>Bottom Section</h3>
{{GameCategory|arma3|New Scripting Commands}}
{{GameCategory|arma3|Scripting Commands}}
[[Category:Scripting Commands|{{uc:{{PAGENAME}}}}]]
<!-- CONTINUE Notes -->
<dl class="command_description">
<dd class="notedate">Posted on October 26, 2016 - 15:27 (UTC)</dd>
<dt class="note">[[User:R3vo|R3vo]]</dt>
<dd class="note">
After an [[object]] was deleted from a layer, [[getMissionLayerEntities]] will return <NULL-object> for the deleted [[object]].
<br>
<br>
Version: 1.65<br>
Build: 139010<br>
</dd>
</dl>
<!-- DISCONTINUE Notes -->

Latest revision as of 11:45, 14 February 2024

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, Arma 3 logo black.png2.14 groups] (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;
Example 4:
getMissionLayerEntities 42 params [["_objects", []], ["_markers", []], ["_groups", []]];

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.