{"name":"setCombatBehaviour","operator":null,"title":"setCombatBehaviour","type":"command","url":"https://community.bistudio.com/wiki/setCombatBehaviour","revid":321904,"updated":"2022-05-22T11:02:37Z","groups":["AI Behaviour","Groups"],"status":"ok","replaced_by":[],"games":[{"game":"arma3","name":"Arma 3","version":"2.04"}],"since":{"game":"arma3","name":"Arma 3","version":"2.04"},"arma3_since":"2.04","branch":null,"locality":{"argument":"local","effect":"global","server_exec":false},"exec":null,"description":"Sets an individual unit entity behaviour (main syntax) or a group entity behaviour (alternative syntax). The group in this case is a Group entity and not a simple collection of units. To retrieve unit or group behaviour see combatBehaviour. The behaviour is one of:\n- \"CARELESS\"\n- \"SAFE\"\n- \"AWARE\"\n- \"COMBAT\"\n- \"STEALTH\"\n\n> [!NOTE]\n> See AI Behaviour for details of the effect of this command on AI units. Group behaviour usually is \"CARELESS\" or \"SAFE\"\n\n| Command | Applies To |\n|---|---|\n| setBehaviour | **Every unit** in the group, but **not the group** itself |\n| setBehaviourStrong | **Every unit** in the group, and the **group** itself |\n| setCombatBehaviour | If argument is Object, only that **unit**, and if argument is Group, the **group** itself (not its units) |","syntaxes":[{"syntax":"unit setCombatBehaviour behaviour","since":null,"effect":null,"exec":null,"params":[{"name":"unit","type":"Object","optional":false,"default":null,"description":"AI unit","types":["Object"],"since":null,"text":"unit: Object - AI unit"},{"name":"behaviour","type":"String","optional":false,"default":null,"description":"see description","types":["String"],"since":null,"text":"behaviour: String - see description"}],"returns":{"type":"Nothing","types":["Nothing"],"description":null,"text":"Nothing"},"form":"binary","operator":null,"left":{"text":"unit","types":["Object"]},"right":{"text":"behaviour","types":["String"]}},{"syntax":"group setCombatBehaviour behaviour","since":null,"effect":null,"exec":null,"params":[{"name":"group","type":"Group","optional":false,"default":null,"description":"AI group","types":["Group"],"since":null,"text":"group: Group - AI group"},{"name":"behaviour","type":"String","optional":false,"default":null,"description":"see description","types":["String"],"since":null,"text":"behaviour: String - see description"}],"returns":{"type":"Nothing","types":["Nothing"],"description":null,"text":"Nothing"},"form":"binary","operator":null,"left":{"text":"group","types":["Group"]},"right":{"text":"behaviour","types":["String"]}}],"examples":[{"text":"```sqf\nunit1 setCombatBehaviour \"SAFE\";\n```","code":["unit1 setCombatBehaviour \"SAFE\";"]},{"text":"```sqf\ngroup1 setCombatBehaviour \"CARELESS\";\n```","code":["group1 setCombatBehaviour \"CARELESS\";"]}],"multiplayer":null,"problems":null,"aliases":[],"see_also":["AIBehaviour","combatBehaviour","behaviour","setBehaviour","setBehaviourStrong","setWaypointBehaviour","combatMode","setCombatMode","skill","setSkill"],"notes":[],"categories":["Arma 3: New Scripting Commands","Arma 3: Scripting Commands","Command Group: AI Behaviour","Command Group: Groups","Introduced with Arma 3 version 2.04","Scripting Commands","Scripting Commands: Global Effect"]}