combatMode: Difference between revisions

From Bohemia Interactive Community
Jump to navigation Jump to search
No edit summary
m (Text replacement - "[[Arma 3 " to "[[Arma 3: ")
 
(98 intermediate revisions by 21 users not shown)
Line 1: Line 1:
back to [[Scripting_Reference#C|COMREF]]
{{RV|type=command


<h2 style="color:#000066"> '''combatMode ''grp'''''</h2>
|game1= ofp
|version1= 1.00


|game2= ofpe
|version2= 1.00


'''Operand types:'''
|game3= arma1
|version3= 1.00


'''grp:''' [[Object or Group]]
|game4= arma2
|version4= 1.00


'''Type of returned value:'''
|game5= arma2oa
|version5= 1.50


[[String]]
|game6= tkoh
|version6= 1.00


'''Description:'''
|game7= arma3
|version7= 0.50


Combat mode of given unit or group:
|arg= global


* '''"BLUE"'''
|gr1= Groups
* '''"GREEN"'''
* '''"YELLOW"'''
* '''"RED"'''


|gr2= AI Behaviour


'''Example:'''
|descr= Returns the combat mode of the given AI [[Group | group]]. See [[setCombatMode]] for more information about combat modes.


_cMode = '''combatMode''' [[group]] [[player]]
|s1= [[combatMode]] group


|p1= group: [[Group]] or [[Object]] - if the argument is unit [[Object]], unit's current group is used.


'''Comments:'''
|r1= [[String]] - one of:
* "BLUE"
* "GREEN"
* "WHITE"
* "YELLOW"
* "RED"
* "ERROR"


Use [[setCombatMode]]  to set the combat mode.
|x1= <sqf>if (combatMode _grp1 == "BLUE") then {_grp1 setCombatMode "GREEN"};</sqf>


The definitions of the colours are given under that command.
|seealso= [[Combat Modes]] [[setCombatMode]] [[behaviour]] [[setBehaviour]] [[skill]] [[setSkill]] [[Arma 3: AI Skill]] [[setUnitCombatMode]] [[unitCombatMode]] [[setCombatBehaviour]] [[combatBehaviour]]
}}
 
<dl class="command_description">
 
<dt><dt>
<dd class="notedate">
<dt class="note">[[User:Ceeeb|Ceeeb]]</dt>
<dd class="note">
In '''OFP v1.96''', combatMode return value does not change when unit's combat mode is set with radio commands, i.e troops under the player's command.
 
</dl>

Latest revision as of 11:38, 6 May 2024

Hover & click on the images for description

Description

Description:
Returns the combat mode of the given AI group. See setCombatMode for more information about combat modes.
Groups:
GroupsAI Behaviour

Syntax

Syntax:
combatMode group
Parameters:
group: Group or Object - if the argument is unit Object, unit's current group is used.
Return Value:
String - one of:
  • "BLUE"
  • "GREEN"
  • "WHITE"
  • "YELLOW"
  • "RED"
  • "ERROR"

Examples

Example 1:
if (combatMode _grp1 == "BLUE") then {_grp1 setCombatMode "GREEN"};

Additional Information

See also:
Combat Modes setCombatMode 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
Ceeeb
In OFP v1.96, combatMode return value does not change when unit's combat mode is set with radio commands, i.e troops under the player's command.