setCombatBehaviour: Difference between revisions

From Bohemia Interactive Community
Jump to navigation Jump to search
No edit summary
mNo edit summary
 
(21 intermediate revisions by 4 users not shown)
Line 1: Line 1:
{{RV|type=command
{{RV|type=command


| Arma3dev
|game1= arma3
 
|version1= 2.04
|2.03


|arg= local
|arg= local
Line 9: Line 8:
|eff= global
|eff= global


|gr1= Object Manipulation
|gr1= AI Behaviour
 
|gr2= Groups
|gr2= Groups


| Sets unit or group behaviour. To retrieve unit or group behaviour see [[combatBehaviour]]. The behaviour is one of:  
|descr= 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:  
* "CARELESS"
* "CARELESS"
* "SAFE"
* "SAFE"
Line 18: Line 18:
* "COMBAT"
* "COMBAT"
* "STEALTH"
* "STEALTH"
{{Feature | Informative | See [[AI Behaviour]] for details of the effect of this command on AI units. Group behaviour usually is "CARELESS" or "SAFE"}}
{{Feature|informative|See [[AI Behaviour]] for details of the effect of this command on AI units. Group behaviour usually is "CARELESS" or "SAFE"}}


| unit [[setCombatBehaviour]] behaviour
<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= unit [[setCombatBehaviour]] behaviour


|p1= unit: [[Object]] - AI unit
|p1= unit: [[Object]] - AI unit
Line 26: Line 42:
|p2= behaviour: [[String]] - see description
|p2= behaviour: [[String]] - see description


| [[Nothing]]
|r1= [[Nothing]]


|s2= group [[setCombatBehaviour]] behaviour
|s2= group [[setCombatBehaviour]] behaviour
Line 35: Line 51:


|r2= [[Nothing]]
|r2= [[Nothing]]
 
|x1= <code>unit1 [[setCombatBehaviour]] "SAFE";</code>
|x2= <code>group1 [[setCombatBehaviour]] "CARELESS";</code>


| [[AIBehaviour]], [[combatBehaviour]], [[behaviour]], [[setBehaviour]], [[setBehaviourStrong]], [[setWaypointBehaviour]], [[combatMode]], [[setCombatMode]], [[skill]], [[setSkill]]
|x1= <sqf>unit1 setCombatBehaviour "SAFE";</sqf>
}}


|x2= <sqf>group1 setCombatBehaviour "CARELESS";</sqf>


{{GameCategory|arma3|Scripting Commands}}
|seealso= [[AIBehaviour]] [[combatBehaviour]] [[behaviour]] [[setBehaviour]] [[setBehaviourStrong]] [[setWaypointBehaviour]] [[combatMode]] [[setCombatMode]] [[skill]] [[setSkill]]
}}

Latest revision as of 13:02, 22 May 2022

Hover & click on the images for description

Description

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:
  • "CARELESS"
  • "SAFE"
  • "AWARE"
  • "COMBAT"
  • "STEALTH"
See AI Behaviour for details of the effect of this command on AI units. Group behaviour usually is "CARELESS" or "SAFE"
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:
AI BehaviourGroups

Syntax

Syntax:
unit setCombatBehaviour behaviour
Parameters:
unit: Object - AI unit
behaviour: String - see description
Return Value:
Nothing

Alternative Syntax

Syntax:
group setCombatBehaviour behaviour
Parameters:
group: Group - AI group
behaviour: String - see description
Return Value:
Nothing

Examples

Example 1:
unit1 setCombatBehaviour "SAFE";
Example 2:
group1 setCombatBehaviour "CARELESS";

Additional Information

See also:
AIBehaviour combatBehaviour behaviour setBehaviour setBehaviourStrong setWaypointBehaviour combatMode setCombatMode skill setSkill

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