{"name":"setWaypointStatements","operator":null,"title":"setWaypointStatements","type":"command","url":"https://community.bistudio.com/wiki/setWaypointStatements","revid":377577,"updated":"2026-01-02T06:56:32Z","groups":["Waypoints"],"status":"ok","replaced_by":[],"games":[{"game":"ofpe","name":"Operation Flashpoint: Elite","version":"1.00"},{"game":"arma1","name":"Armed Assault","version":"1.00"},{"game":"arma2","name":"Arma 2","version":"1.00"},{"game":"arma2oa","name":"Arma 2: Operation Arrowhead","version":"1.50"},{"game":"tkoh","name":"Take On Helicopters","version":"1.00"},{"game":"arma3","name":"Arma 3","version":"0.50"}],"since":{"game":"ofpe","name":"Operation Flashpoint: Elite","version":"1.00"},"arma3_since":"0.50","branch":null,"locality":{"argument":null,"effect":null,"server_exec":false},"exec":null,"description":"The waypoint is done only when the condition is fulfilled. When the waypoint is done, the statement expression is executed.\n\nWithin the Condition & Statement code string:\n- this refers to the group leader\n- thisList refers to the group's units\n\n> [!IMPORTANT]\n> The **Condition** code is evaluated on the group owner's machine. When condition returns true, for some strange reason, the condition is evaluated one more time. The **OnActivation** code is executed **globally**, a.k.a on every client! See Waypoints.","syntaxes":[{"syntax":"waypoint setWaypointStatements [condition, statement]","since":null,"effect":null,"exec":null,"params":[{"name":"waypoint","type":"Waypoint","optional":false,"default":null,"description":null,"types":["Waypoint"],"since":null,"text":"waypoint: Waypoint"},{"name":"condition","type":"String","optional":false,"default":null,"description":null,"types":["String"],"since":null,"text":"condition: String"},{"name":"statement","type":"String","optional":false,"default":null,"description":null,"types":["String"],"since":null,"text":"statement: String"}],"returns":{"type":"Nothing","types":["Nothing"],"description":null,"text":"Nothing"},"form":"binary","operator":null,"left":{"text":"waypoint","types":["Waypoint"]},"right":{"text":"[condition, statement]","types":["Array"]}}],"examples":[{"text":"```sqf\n_waypoint setWaypointStatements [\"true\", \"hint 'hello'; hint 'goodbye'\"];\n```","code":["_waypoint setWaypointStatements [\"true\", \"hint 'hello'; hint 'goodbye'\"];"]},{"text":"```sqf\n_waypoint setWaypointStatements [\"true\", \"diag_log ['GroupLeader: ', this]; diag_log ['Units: ', thislist]\"];\n```","code":["_waypoint setWaypointStatements [\"true\", \"diag_log ['GroupLeader: ', this]; diag_log ['Units: ', thislist]\"];"]}],"multiplayer":null,"problems":null,"aliases":[],"see_also":["waypointStatements"],"notes":[{"user":"SilentSpike","date":"2016-05-21T16:19:00Z","text":"Within the completion statement currentWaypoint will give the index of the waypoint being completed (as opposed to the following one).\n\nThis is particularly useful if you need a self deleting waypoint:\n\n```sqf\n_waypoint setWaypointStatements [\"true\", \"deleteWaypoint [group this, currentWaypoint group this]\"]\n```"},{"user":"RHfront","date":"2017-05-09T16:35:00Z","text":"The condition block carries the same rules as functions which return a value.\nThe return value must be a Boolean.\nOne can bypass the use of triggers in this manner:\n\n```sqf\n_waypoint setWaypointStatements [\"code code code; _returnBool\", \"onActivation block;\"];\n```"}],"categories":["ArmA: Armed Assault: Scripting Commands","Arma 2: Operation Arrowhead: Scripting Commands","Arma 2: Scripting Commands","Arma 3: Scripting Commands","Command Group: Waypoints","Introduced with Operation Flashpoint: Elite version 1.00","Operation Flashpoint: Elite: New Scripting Commands","Operation Flashpoint: Elite: Scripting Commands","Scripting Commands","Take On Helicopters: Scripting Commands"]}