{"name":"setWaypointStatements","title":"setWaypointStatements","type":"command","url":"https://community.bistudio.com/wiki/setWaypointStatements","revid":377577,"updated":"2026-01-02T06:56:32Z","groups":["Waypoints"],"status":"ok","games":{"ofpe":"1.00","arma1":"1.00","arma2":"1.00","arma2oa":"1.50","tkoh":"1.00","arma3":"0.50"},"since":"ofpe 1.00","arma3_since":"0.50","description":"The waypoint is done only when the condition is fulfilled. When the waypoint is done, the statement expression is executed.\nWithin the Condition & Statement code string:\n\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]","params":[{"name":"waypoint","type":"Waypoint","type_expr":"Waypoint"},{"name":"condition","type":"String","type_expr":"String"},{"name":"statement","type":"String","type_expr":"String"}],"returns":{"type":"Nothing","type_expr":"Nothing"},"form":"binary","left":{"text":"waypoint"},"right":{"text":"[condition, statement]"}}],"examples":[{"code":["_waypoint setWaypointStatements [\"true\", \"hint 'hello'; hint 'goodbye'\"];"]},{"code":["_waypoint setWaypointStatements [\"true\", \"diag_log ['GroupLeader: ', this]; diag_log ['Units: ', thislist]\"];"]}],"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```"}]}