setCombatMode: Difference between revisions

From Bohemia Interactive Community
Jump to navigation Jump to search
mNo edit summary
m (Text replacement - "(\|[pr][0-9]+ *= *[^- ]*) *- *S([a-z ])" to "$1 - s$2")
(76 intermediate revisions by 11 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 combat mode (engagement rules).
|game3= arma1
Mode may be one of:
|version3= 1.00
* '''"[[ArmA:_AI_Combat_Modes#Engagement_rules|BLUE]]"''' (Never fire)
* '''"[[ArmA:_AI_Combat_Modes#Engagement_rules|GREEN]]"''' (Hold fire - defend only)
* '''"[[ArmA:_AI_Combat_Modes#Engagement_rules|WHITE]]"''' (Hold fire, engage at will)
* '''"[[ArmA:_AI_Combat_Modes#Engagement_rules|YELLOW]]"''' (Fire at will)
* '''"[[ArmA:_AI_Combat_Modes#Engagement_rules|RED]]"''' (Fire at will, engage at will)
|= Description
____________________________________________________________________________________________


| groupName '''setCombatMode''' mode |= Syntax
|game4= arma2
|version4= 1.00


|p1= groupName: [[Object]] or [[Group]] |= Parameter 1
|game5= arma2oa
|version5= 1.50


|p2= mode: [[String]] |= Parameter 2
|game6= tkoh
|version6= 1.00


| [[Nothing]] |= Return value
|game7= arma3
____________________________________________________________________________________________
|version7= 0.50
 
|x1= <pre>_group1 setCombatMode "BLUE"</pre> |= Example 1
____________________________________________________________________________________________


| [[Mission_Editor:_Waypoints#Combat_Mode|combat mode description]], [[ArmA:_AI_Combat_Modes|AI Combat Modes]], [[combatMode]], [[behaviour]], [[setBehaviour]], [[skill]], [[setSkill array]], [[CfgAISkill]] |= See also
|arg= local
|eff= global


|gr1= Groups
|gr2= AI Behaviour
|descr= Sets AI [[Group | group]] combat mode (engagement rules). For individual unit's combat mode see [[setUnitCombatMode]]. Mode may be one of the following:
* {{hl|"BLUE"}} : Never fire, keep formation
* {{hl|"GREEN"}} : Hold fire, keep formation
* {{hl|"WHITE"}} : Hold fire, engage at will/loose formation
* {{hl|"YELLOW"}} : Fire at will, keep formation
* {{hl|"RED"}} : Fire at will, engage at will/loose formation
See [[Combat Modes]] for more information on combat modes.
|s1= group [[setCombatMode]] mode
|p1= group: [[Group]] or [[Object]] - if the argument is unit [[Object]], unit's current group is used.
|p2= mode: [[String]] - see description
|r1= [[Nothing]]
|x1= <sqf>_group1 setCombatMode "BLUE";</sqf>
|seealso= [[Combat Modes]] [[Mission_Editor:_Waypoints#Combat_Mode|Use in Waypoints]] [[combatMode]] [[behaviour]] [[setBehaviour]] [[skill]] [[setSkill]] [[Arma 3 AI Skill]] [[setUnitCombatMode]] [[unitCombatMode]] [[setCombatBehaviour]] [[combatBehaviour]]
}}
}}


<h3 style="display:none">Notes</h3>
 
<dl class="command_description">
<dl class="command_description">
<!-- Note Section BEGIN -->
 
<!-- Note Section END -->
<dt></dt>
<dd class="notedate">Posted on 2020-01-01 - 07:35 (UTC)</dd>
<dt class="note">[[User:.kju|.kju]]</dt>
<dd class="note">
* Combat mode can only be changed via scripting/waypoints - not by player radio commands for an AI group.
<br>
* "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.
<br>
* "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.
<br>
* Applying combat mode blue, clears the attack target commands from AI subgroups. Might be useful in combination with [[doFollow]]/[[commandFollow]]. Note: It will not effect [[assignedTarget]]s.
</dd>
 
</dl>
</dl>
<h3 style="display:none">Bottom Section</h3>
[[Category:Scripting Commands|SETCOMBATMODE]]
[[Category:Scripting Commands OFP 1.96|SETCOMBATMODE]]
[[Category:Scripting Commands OFP 1.46|SETCOMBATMODE]]
[[Category:Scripting Commands ArmA|SETCOMBATMODE]]
[[Category:Scripting Commands ArmA2|{{uc:{{PAGENAME}}}}]]
[[Category:Scripting_Commands_Take_On_Helicopters|{{uc:{{PAGENAME}}}}]]

Revision as of 16:49, 8 November 2023

Hover & click on the images for description

Description

Description:
Sets AI group combat mode (engagement rules). For individual unit's combat mode see setUnitCombatMode. 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.
Groups:
GroupsAI Behaviour

Syntax

Syntax:
group setCombatMode mode
Parameters:
group: Group or Object - if the argument is unit Object, unit's current group is used.
mode: String - see description
Return Value:
Nothing

Examples

Example 1:
_group1 setCombatMode "BLUE";

Additional Information

See also:
Combat Modes Use in Waypoints combatMode behaviour setBehaviour skill setSkill Arma 3 AI Skill setUnitCombatMode unitCombatMode setCombatBehaviour combatBehaviour

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


Posted on 2020-01-01 - 07:35 (UTC)
.kju
  • 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/commandFollow. Note: It will not effect assignedTargets.