combatMode: Difference between revisions

From Bohemia Interactive Community
Jump to navigation Jump to search
mNo edit summary
m (Text replacement - "(\|[pr][0-9]+ *= *[^- ]*) *- *I([a-z ])" to "$1 - i$2")
 
(86 intermediate revisions by 18 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


|arg= global |= Arguments in MP
|game3= arma1
____________________________________________________________________________________________
|version3= 1.00


| Returns the combat mode of the given unit. See [[setCombatMode]] for more information about combat modes. |= Description
|game4= arma2
____________________________________________________________________________________________
|version4= 1.00


| '''combatMode''' group |= Syntax
|game5= arma2oa
|version5= 1.50


|p1= group: [[Object]] or [[Group]] |= Parameter 1
|game6= tkoh
|version6= 1.00


| [[String]] - 
|game7= arma3
One of "BLUE", "GREEN", "WHITE, "YELLOW" and "RED" |= Return value
|version7= 0.50
____________________________________________________________________________________________
 
|x1= <pre>?((combatMode grp1)=="BLUE") : grp1 setCombatMode "GREEN"</pre> |= Example 1
____________________________________________________________________________________________


| [[setCombatMode]] |= See also
|arg= global


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


<h3 style="display:none">Notes</h3>
|s1= [[combatMode]] group
<dl class="command_description">
<!-- Note Section BEGIN -->


<dd class="notedate">Posted on August 3, 2006 - 14:25</dd>
|p1= group: [[Group]] or [[Object]] - if the argument is unit [[Object]], unit's current group is used.
<dt class="note">'''[[User:Hardrock|hardrock]]'''</dt><dd class="note">''Notes from before the conversion:''


Use [[setCombatMode]] to set the combat mode. The definitions of the colours are given under that command.
|r1= [[String]] - one of:
</dd>
* "BLUE"
<dd class="notedate"></dd>
* "GREEN"
<dt class="note">'''[[User:Ceeeb|Ceeeb]]'''</dt>
* "WHITE"
<dd class="note">
* "YELLOW"
In '''OFP v1.96''', combatMode return value does not change when unit's combat mode is set with radio commands, ie troops under the player's command.
* "RED"
</dd>
* "ERROR"
<!-- Note Section END -->
</dl>


<h3 style="display:none">Bottom Section</h3>
|x1= <sqf>if (combatMode _grp1 == "BLUE") then {_grp1 setCombatMode "GREEN"};</sqf>


|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.


[[Category:Scripting Commands|COMBATMODE]]
</dl>
[[Category:Scripting Commands OFP 1.96|COMBATMODE]]
[[Category:Scripting Commands OFP 1.46|COMBATMODE]]
[[Category:Scripting Commands ArmA|COMBATMODE]]

Latest revision as of 16:33, 8 November 2023

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.