---
name: "setCombatMode"
type: command
status: ok
groups: ["Groups", "AI Behaviour"]
arma3_since: "0.50"
locality: {"argument": "local", "effect": "global", "server_exec": false}
source: https://community.bistudio.com/wiki/setCombatMode
revid: 364240
updated: 2024-05-06T09:38:16Z
---

# setCombatMode

*Command · Groups, AI Behaviour · Arma 3 v0.50 · introduced in Operation Flashpoint v1.00*

Locality: arguments **local** · effect **global**

## Description

Sets AI [group](../topics/Group.md) combat mode (engagement rules). For individual unit's combat mode see [setUnitCombatMode](../commands/setUnitCombatMode.md). Mode may be one of the following:
- `"BLUE"` : Never fire, keep formation
- `"GREEN"` : Hold fire, keep formation
- `"WHITE"` : Hold fire, engage at will/loose formation
- `"YELLOW"` : Fire at will, keep formation
- `"RED"` : Fire at will, engage at will/loose formation
See Combat Modes for more information on combat modes.

## Syntax

```sqf
group setCombatMode mode
```

**Parameters:**

- `group`: [Group](../topics/Group.md) or [Object](../topics/Object.md) - if the argument is unit [Object](../topics/Object.md), unit's current group is used.
- `mode`: [String](../topics/String.md) - see description

**Returns:** [Nothing](../topics/Nothing.md)

## Examples

### Example 1

```sqf
_group1 setCombatMode "BLUE";
```

## See also

Combat Modes · Mission Editor: Waypoints · [combatMode](../commands/combatMode.md) · [behaviour](../commands/behaviour.md) · [setBehaviour](../commands/setBehaviour.md) · [skill](../commands/skill.md) · [setSkill](../commands/setSkill.md) · Arma 3: AI Skill · [setUnitCombatMode](../commands/setUnitCombatMode.md) · [unitCombatMode](../commands/unitCombatMode.md) · [setCombatBehaviour](../commands/setCombatBehaviour.md) · [combatBehaviour](../commands/combatBehaviour.md)

## Community notes

**.kju** — 2020-01-01

- Combat mode can only be changed via scripting/waypoints - not by player radio commands for an AI group.

- "Engage at will" means AI can form subgroups and break off to engage known or assigned enemies. These AI will then act largely on their own.
- As player one can use the "engage at will" radio command to achieve the same/similar behavior. However this will not change the unit's combat mode. Yet one can override the "keep/loose formation" status of combat mode with radio commands.

- "Never fire" means AI will actually never fire. Whereas under "Hold fire", AI will shoot back if getting fired upon, hostiles get too close, or they get a target explicitly assigned by the (sub)group leader.
- As player, one can override the fire status with radio commands ("Hold fire", "Open fire", "Fire"). However this will not change the unit's combat mode.
- "Never fire"/combat mode blue cannot be overridden by group leader target assignment. One needs to command "Open fire" or switch to a different combat mode (with "Hold fire") to be able to do so.

- Applying combat mode blue, clears the attack target commands from AI subgroups. Might be useful in combination with [doFollow](../commands/doFollow.md)/[commandFollow](../commands/commandFollow.md). Note: It will not affect [assignedTarget](../commands/assignedTarget.md)s.

<sub>Source: [BI Community Wiki — setCombatMode](https://community.bistudio.com/wiki/setCombatMode) (revision 364240).</sub>
