allMapMarkers: Difference between revisions

From Bohemia Interactive Community
Jump to navigation Jump to search
m (Some wiki formatting)
m (Text replacement - "\|x([0-9])= *<code>([^<]*)<\/code>" to "|x$1= <sqf>$2</sqf>")
(18 intermediate revisions by the same user not shown)
Line 7: Line 7:


|descr= Returns all markers in map including user placed markers (_USER_DEFINED #). <br><br>
|descr= Returns all markers in map including user placed markers (_USER_DEFINED #). <br><br>
Since Arma 3 v1.58 User defined markers have the following name format: <br><tt>_USER_DEFINED #<PlayerID>/<MarkerID>/<ChannelID></tt> where:
Since Arma 3 v1.58 User defined markers have the following name format: <br>{{hl|_USER_DEFINED #<PlayerID>/<MarkerID>/<ChannelID>}} where:
* <PlayerID> - unique network id of the player in [[String]] format, also available as [[String]] in the 6th param in [[Arma 3: Mission Event Handlers#PlayerConnected | "PlayerConnected"]] and [[Arma 3: Mission Event Handlers#PlayerDisconnected|"PlayerDisconnected"]] EHs  
* <PlayerID> - unique network id of the player in [[String]] format, also available as [[String]] in the 6th param in [[Arma 3: Mission Event Handlers#PlayerConnected | "PlayerConnected"]] and [[Arma 3: Mission Event Handlers#PlayerDisconnected|"PlayerDisconnected"]] EHs  
* <MarkerID> - a marker counter id
* <MarkerID> - a marker counter id
Line 17: Line 17:
|r1= [[Array]] of [[String]]s
|r1= [[Array]] of [[String]]s


|x1= <code>_markers = [[allMapMarkers]];</code>
|x1= <sqf>_markers = allMapMarkers;</sqf>


returns: ["marker1","_USER_DEFINED #2/0"]
returns: ["marker1","_USER_DEFINED #2/0"]


|x2= <code>{
|x2= <sqf>{
[[private]] "_a";
private "_a";
_a = [[toArray]] _x;
_a = toArray _x;
_a [[resize]] 15;
_a resize 15;
[[if]] ([[toString]] _a == "_USER_DEFINED #") [[then]]
if (toString _a == "_USER_DEFINED #") then
{
{
[[deleteMarker]] _x;
deleteMarker _x;
}
}
} [[forEach]] [[allMapMarkers]];</code>
} forEach allMapMarkers;</sqf>


|x3= <code>[[if]] (_someString [[in]] [[allMapMarkers]]) [[then]]
|x3= <sqf>if (_someString in allMapMarkers) then
{
{
[[hint]] (_someString [[valuea_plus_valueb|+]] " is a valid marker name");
hint (_someString + " is a valid marker name");
};
};</sqf>
</code>


|seealso= [[createMarker]], [[deleteMarker]], [[customWaypointPosition]]
|seealso= [[createMarker]] [[deleteMarker]] [[customWaypointPosition]]
}}
}}



Revision as of 11:21, 13 May 2022

Hover & click on the images for description

Description

Description:
Returns all markers in map including user placed markers (_USER_DEFINED #).

Since Arma 3 v1.58 User defined markers have the following name format:
_USER_DEFINED #<PlayerID>/<MarkerID>/<ChannelID> where: For custom waypoint position (LShift+LMB) see customWaypointPosition
Groups:
Markers

Syntax

Syntax:
allMapMarkers
Return Value:
Array of Strings

Examples

Example 1:
_markers = allMapMarkers;
returns: ["marker1","_USER_DEFINED #2/0"]
Example 2:
{ private "_a"; _a = toArray _x; _a resize 15; if (toString _a == "_USER_DEFINED #") then { deleteMarker _x; } } forEach allMapMarkers;
Example 3:
if (_someString in allMapMarkers) then { hint (_someString + " is a valid marker name"); };

Additional Information

See also:
createMarker deleteMarker customWaypointPosition

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


Waffle SS. - c
Posted on Mar 17, 2014 - 22:11 (UTC)
A3 1.12: Markers placed in editor will be in the array as a string of their name. Markers placed by the player will begin with "_USER_DEFINED #."
Killzone_Kid - c
Posted on Mar 17, 2014 - 23:12 (UTC)
To expand on the comment above. In Multiplayer, user created marker will appear in allMapMarkers as _USER_DEFINED #ID/Number, where ID is unique id related to _id param from onPlayerConnected and Number is sequential integer incremented by 1 with each marker placement by the IDed user.