setBehaviour: Difference between revisions

From Bohemia Interactive Community
Jump to navigation Jump to search
mNo edit summary
m (Text replacement - "{{Feature | Important | " to "{{Feature|important|")
 
(88 intermediate revisions by 20 users not shown)
Line 1: Line 1:
{{Command|= Comments
{{RV|type=command
____________________________________________________________________________________________


| ofp |= Game name
|game1= ofp
|version1= 1.00


|1.00|= Game version
|game2= ofpe
____________________________________________________________________________________________
|version2= 1.00


| Set group/unit behaviour mode. Behaviour is one of:
|game3= arma1
|version3= 1.00


*"CARELESS"
|game4= arma2
*"SAFE"
|version4= 1.00
*"AWARE"
*"COMBAT"
*"STEALTH".
|= Description
____________________________________________________________________________________________


| UnitOrGroup '''setBehaviour''' "behaviour" |= Syntax
|game5= arma2oa
|version5= 1.50


|p1= UnitOrGroup : [[Object#Unit|Unit]] or [[Group]] |= Parameter 1
|game6= tkoh
|version6= 1.00


|p2= behaviour: [[String]] |= Parameter 2
|game7= arma3
|version7= 0.50


| [[Nothing]] |= Return value
|arg= local
____________________________________________________________________________________________
 
|x1= <pre>_group1 setBehaviour "safe"</pre> |= Example 1
____________________________________________________________________________________________


| |= See also
|eff= global


|gr1= Groups
|gr2= AI Behaviour
|descr= Sets individual unit behaviour '''on every unit in a group'''.
{{Feature|important|This command doesn't set AI [[Group]] behaviour, see [[setCombatBehaviour]] or [[setBehaviourStrong]] for this.}}
{{Feature|informative|See [[AI Behaviour]] for details of the effect of this command on AI units.}}
<spoiler text="Comparison of Behaviour commands">
{| class="wikitable" style="text-align: center"
! Command
! Applies To
|-
| [[setBehaviour]]
| '''Every unit''' in the group, but '''not the group''' itself
|-
| [[setBehaviourStrong]]
| '''Every unit''' in the group, and the '''group''' itself
|-
| [[setCombatBehaviour]]
| If argument is [[Object]], only that '''unit''', and if argument is [[Group]], the '''group''' itself (not its units)
|}
</spoiler>
|s1= groupOrUnit [[setBehaviour]] behaviour
|p1= groupOrUnit : [[Group]] or [[Object]] - unit or a [[group]]
|p2= behaviour: [[String]] - can be one of:
* "CARELESS"
* "SAFE"
* "AWARE"
* "COMBAT"
* "STEALTH"
|r1= [[Nothing]]
|x1= <sqf>_group1 setBehaviour "SAFE";</sqf>
|seealso= [[setCombatBehaviour]] [[combatBehaviour]] [[AIBehaviour]] [[behaviour]] [[setBehaviourStrong]] [[setWaypointBehaviour]] [[combatMode]] [[setCombatMode]] [[skill]] [[setSkill]] [[Arma 3: AI Skill]]
}}
}}


<h3 style="display:none">Notes</h3>
{{Note
<dl class="command_description">
|user= SNKMAN
<!-- Note Section BEGIN -->
|timestamp= 20090103155700
|text= Warning! Since {{arma1}} v.1.14 the command setBehaviour "COMBAT" does not work correctly any longer.
Units ( Groups ) which are using this behaviour and then get a move order will not move to the given position.
}}


<!-- Note Section END -->
{{Note
</dl>
|user= MadRussian
|timestamp= 20100214081900
|text=  Although setBehaviour can be called on an individual unit, the entire group will be affected.
}}


<h3 style="display:none">Bottom Section</h3>
{{Note
[[Category:Scripting Commands|SETBEHAVIOUR]]
|user= MulleDK13
[[Category:Scripting Commands OFP 1.96|SETBEHAVIOUR]]
|timestamp= 20101122191800
[[Category:Scripting Commands OFP 1.46|SETBEHAVIOUR]]
|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.
[[Category:Scripting Commands ArmA|SETBEHAVIOUR]]
}}

Latest revision as of 21:46, 16 May 2024

Hover & click on the images for description

Description

Description:
Sets individual unit behaviour on every unit in a group.
This command doesn't set AI Group behaviour, see setCombatBehaviour or setBehaviourStrong for this.
See AI Behaviour for details of the effect of this command on AI units.
Command Applies To
setBehaviour Every unit in the group, but not the group itself
setBehaviourStrong Every unit in the group, and the group itself
setCombatBehaviour If argument is Object, only that unit, and if argument is Group, the group itself (not its units)
Groups:
GroupsAI Behaviour

Syntax

Syntax:
groupOrUnit setBehaviour behaviour
Parameters:
groupOrUnit : Group or Object - unit or a group
behaviour: String - can be one of:
  • "CARELESS"
  • "SAFE"
  • "AWARE"
  • "COMBAT"
  • "STEALTH"
Return Value:
Nothing

Examples

Example 1:
_group1 setBehaviour "SAFE";

Additional Information

See also:
setCombatBehaviour combatBehaviour AIBehaviour behaviour setBehaviourStrong setWaypointBehaviour combatMode setCombatMode skill setSkill Arma 3: AI Skill

Notes

Report bugs on the Feedback Tracker and/or discuss them on the Arma Discord or on the Forums.
Only post proven facts here! Add Note
SNKMAN - c
Posted on Jan 03, 2009 - 15:57 (UTC)
Warning! Since Armed Assault v.1.14 the command setBehaviour "COMBAT" does not work correctly any longer. Units ( Groups ) which are using this behaviour and then get a move order will not move to the given position.
MadRussian - c
Posted on Feb 14, 2010 - 08:19 (UTC)
Although setBehaviour can be called on an individual unit, the entire group will be affected.
MulleDK13 - c
Posted on Nov 22, 2010 - 19:18 (UTC)
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.