{"name":"setBehaviour","operator":null,"title":"setBehaviour","type":"command","url":"https://community.bistudio.com/wiki/setBehaviour","revid":364537,"updated":"2024-05-16T20:46:45Z","groups":["Groups","AI Behaviour"],"status":"ok","replaced_by":[],"games":[{"game":"ofp","name":"Operation Flashpoint","version":"1.00"},{"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":"ofp","name":"Operation Flashpoint","version":"1.00"},"arma3_since":"0.50","branch":null,"locality":{"argument":"local","effect":"global","server_exec":false},"exec":null,"description":"Sets individual unit behaviour **on every unit in a group**.\n\n> [!IMPORTANT]\n> This command doesn't set AI Group behaviour, see setCombatBehaviour or setBehaviourStrong for this.\n\n> [!NOTE]\n> See AI Behaviour for details of the effect of this command on AI units.\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":"groupOrUnit setBehaviour behaviour","since":null,"effect":null,"exec":null,"params":[{"name":"groupOrUnit","type":"Group or Object","optional":false,"default":null,"description":"unit or a group","types":["Group","Object"],"since":null,"text":"groupOrUnit : Group or Object - unit or a group"},{"name":"behaviour","type":"String","optional":false,"default":null,"description":"can be one of:\n- \"CARELESS\"\n- \"SAFE\"\n- \"AWARE\"\n- \"COMBAT\"\n- \"STEALTH\"","types":["String"],"since":null,"text":"behaviour: String - can be one of:\n- \"CARELESS\"\n- \"SAFE\"\n- \"AWARE\"\n- \"COMBAT\"\n- \"STEALTH\""}],"returns":{"type":"Nothing","types":["Nothing"],"description":null,"text":"Nothing"},"form":"binary","operator":null,"left":{"text":"groupOrUnit","types":["Group","Object"]},"right":{"text":"behaviour","types":["String"]}}],"examples":[{"text":"```sqf\n_group1 setBehaviour \"SAFE\";\n```","code":["_group1 setBehaviour \"SAFE\";"]}],"multiplayer":null,"problems":null,"aliases":[],"see_also":["setCombatBehaviour","combatBehaviour","AIBehaviour","behaviour","setBehaviourStrong","setWaypointBehaviour","combatMode","setCombatMode","skill","setSkill","Arma 3: AI Skill"],"notes":[{"user":"SNKMAN","date":"2009-01-03T15:57:00Z","text":"Warning! Since Armed Assault v.1.14 the command setBehaviour \"COMBAT\" does not work correctly any longer.\nUnits ( Groups ) which are using this behaviour and then get a move order will not move to the given position."},{"user":"MadRussian","date":"2010-02-14T08:19:00Z","text":"Although setBehaviour can be called on an individual unit, the entire group will be affected."},{"user":"MulleDK13","date":"2010-11-22T19:18:00Z","text":"If setting a behaviour on an individual unit is required, it can be achieved by creating a temporary group, use joinSilent to make the individual unit belong to that group, then change his behaviour, use joinSilent into the original group, then delete the temporary group."}],"categories":["ArmA: Armed Assault: Scripting Commands","Arma 2: Operation Arrowhead: Scripting Commands","Arma 2: Scripting Commands","Arma 3: Scripting Commands","Command Group: AI Behaviour","Command Group: Groups","Introduced with Operation Flashpoint version 1.00","Operation Flashpoint: Elite: Scripting Commands","Operation Flashpoint: New Scripting Commands","Operation Flashpoint: Scripting Commands","Scripting Commands","Scripting Commands: Global Effect","Take On Helicopters: Scripting Commands"]}