{"name":"setMarkerPolyline","title":"setMarkerPolyline","type":"command","url":"https://community.bistudio.com/wiki/setMarkerPolyline","revid":370043,"updated":"2024-10-28T20:28:37Z","groups":["Markers"],"status":"ok","games":{"arma3":"2.02"},"since":"arma3 2.02","arma3_since":"2.02","locality":{"effect":"global"},"description":"Sets a polyline marker's path.\n\n> [!NOTE]\n> **Multiplayer optimisation:** Global marker commands always broadcast the *entire* marker state over the network.\n> As such, the number of network messages exchanged when creating or editing a marker can be reduced by performing all but the last operation using local marker commands, then using a global marker command for the last change (and subsequent global broadcast of all changes applied to the marker).","syntaxes":[{"syntax":"marker setMarkerPolyline path","params":[{"name":"marker","type":"String","type_expr":"String"},{"name":"path","type":"Array of pairs Number, Number","description":"`[x1, y1, x2, y2, ... xn, yn]`\n\n> [!IMPORTANT]\n> Be aware that this command expects an array with a minimum array size of 4 and that the array count always needs to be dividable by 2 and return a whole number. Code:\n>\n> ```sqf\n> count path >= 4 && count path mod 2 == 0; // true → valid path\n> ```","type_expr":"Array"}],"returns":{"type":"Nothing","type_expr":"Nothing"},"form":"binary","left":{"text":"marker"},"right":{"text":"path"}}],"examples":[{"text":"Changes `\"marker_1\"` into a polyline and draws a sine curve on player's position:\n\n```sqf\n// createMarker [\"marker_1\", [0,0,0]];\n\"marker_1\" setMarkerShape \"polyline\";\nprivate _return = [] ;\n\nfor \"_i\" from 0 to 100 step 0.1 do\n{\n    _return pushBack (_i + getPosASL player # 0);\n    _return pushBack ((sin (_i * 10)) * 10 + getPosASL player # 1);\n} ;\n\n\"marker_1\" setMarkerPolyline _return;\n```","code":["// createMarker [\"marker_1\", [0,0,0]];\n\"marker_1\" setMarkerShape \"polyline\";\nprivate _return = [] ;\n\nfor \"_i\" from 0 to 100 step 0.1 do\n{\n\t_return pushBack (_i + getPosASL player # 0);\n\t_return pushBack ((sin (_i * 10)) * 10 + getPosASL player # 1);\n} ;\n\n\"marker_1\" setMarkerPolyline _return;"]}],"see_also":["markerPolyline","setMarkerPolylineLocal"]}