combatMode: Difference between revisions

From Bohemia Interactive Community
Jump to navigation Jump to search
No edit summary
mNo edit summary
 
(98 intermediate revisions by 21 users not shown)
Line 1: Line 1:
[[Category:Scripting Commands]]
{{RV|type=command
[[Category:Scripting Commands OFP 1.97]]
[[Category:Scripting Commands OFP 1.46]]
[[Category:Scripting Commands ArmA]]


back to [[Scripting_Reference#C|COMREF]]
|game1= ofp
|version1= 1.00


<h2 style="color:#000066"> '''combatMode ''grp'''''</h2>
|game2= ofpe
|version2= 1.00


|game3= arma1
|version3= 1.00


'''Operand types:'''
|game4= arma2
|version4= 1.00


'''grp:''' [[Object or Group]]
|game5= arma2oa
|version5= 1.50


'''Type of returned value:'''
|game6= tkoh
|version6= 1.00


[[String]]
|game7= arma3
|version7= 0.50


'''Description:'''
|arg= global


Combat mode of given unit or group:
|gr1= Groups


* '''"BLUE"'''
|gr2= AI Behaviour
* '''"GREEN"'''
* '''"YELLOW"'''
* '''"RED"'''


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


'''Example:'''
|s1= [[combatMode]] group


_cMode = '''combatMode''' [[group]] [[player]]
|p1= group: One of
* [[Group]]
* [[Object]] of type [[Object|Unit]] - if the argument is unit [[Object]], unit's current group is used.


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


'''Comments:'''
|x1= <sqf>if (combatMode _grp1 == "BLUE") then {_grp1 setCombatMode "GREEN"};</sqf>


Use [[setCombatMode]] to set the combat mode.
|seealso= [[Combat Modes]] [[setCombatMode]] [[behaviour]] [[setBehaviour]] [[skill]] [[setSkill]] [[Arma 3: AI Skill]] [[setUnitCombatMode]] [[unitCombatMode]] [[setCombatBehaviour]] [[combatBehaviour]]
}}


The definitions of the colours are given under that command.
<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 09:46, 16 June 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: One of
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.