{"name":"setMarkerPolyline","operator":null,"title":"setMarkerPolyline","type":"command","url":"https://community.bistudio.com/wiki/setMarkerPolyline","revid":370043,"updated":"2024-10-28T20:28:37Z","groups":["Markers"],"status":"ok","replaced_by":[],"games":[{"game":"arma3","name":"Arma 3","version":"2.02"}],"since":{"game":"arma3","name":"Arma 3","version":"2.02"},"arma3_since":"2.02","branch":null,"locality":{"argument":null,"effect":"global","server_exec":false},"exec":null,"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","since":null,"effect":null,"exec":null,"params":[{"name":"marker","type":"String","optional":false,"default":null,"description":null,"types":["String"],"since":null,"text":"marker: String"},{"name":"path","type":"Array of pairs Number, Number","optional":false,"default":null,"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> ```","types":["Array","Number"],"since":null,"text":"path: Array of pairs Number, Number - `[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> ```"}],"returns":{"type":"Nothing","types":["Nothing"],"description":null,"text":"Nothing"},"form":"binary","operator":null,"left":{"text":"marker","types":["String"]},"right":{"text":"path","types":["Array","Number"]}}],"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;"]}],"multiplayer":null,"problems":null,"aliases":[],"see_also":["markerPolyline","setMarkerPolylineLocal"],"notes":[],"categories":["Arma 3: New Scripting Commands","Arma 3: Scripting Commands","Command Group: Markers","Introduced with Arma 3 version 2.02","Scripting Commands","Scripting Commands: Global Effect"]}