fleeing: Difference between revisions

From Bohemia Interactive Community
Jump to navigation Jump to search
m (Text replacement - "[[Category:Scripting Commands ArmA|" to "[[Category:Scripting Commands Armed Assault|")
m (Text replacement - "(\|[pr][0-9]+ *= *[^- ]*) *- *R([a-z ])" to "$1 - r$2")
 
(35 intermediate revisions by 3 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 |Multiplayer Arguments=
|game3= arma1
____________________________________________________________________________________________
|version3= 1.00


| Checks if a unit is fleeing. |DESCRIPTION=
|game4= arma2
____________________________________________________________________________________________
|version4= 1.00


| [[Boolean]] <nowiki>=</nowiki> '''fleeing''' unitName |SYNTAX=
|game5= arma2oa
|version5= 1.50


|p1= unitName: [[Object]] |PARAMETER1=
|game6= tkoh
|version6= 1.00


| [[Boolean]] - 
|game7= arma3
Returns true if a unit is fleeing, false if not. Dead or empty units return false. |RETURNVALUE=
|version7= 0.50
____________________________________________________________________________________________
 
|x1= <pre>? (fleeing _east_unit) : player sideChat "We have won!"</pre> |EXAMPLE1=
____________________________________________________________________________________________


|[[allowFleeing]]|SEEALSO=
|arg= global


}}
|gr1= Object Manipulation
 
|descr= Checks if a unit is fleeing.
<br><br>
Notes:
* Fleeing only affects AI led groups.
* Only the group as a whole can flee (or not).
* The courage of the AI group is based on the group's leader [[Arma_3_AI_Skill#Sub-Skills|courage subskill]].
* Each group has a max strength (summed "armor" of all infantry units - plus armor when inside vehicles).
* If the group losses by injury/damage or death/destruction are higher than the max strength, multiplied by leader's courage or [[allowFleeing]] level , then the group will start fleeing.
* As result primarily the AI flees to a nearby "supply point" (some friendly units - preferably with medic or engineer, or a vehicle with repair/ammo/fuel cargo). Alternatively it will try to find a safe position within a 600m radius from the initial waypoint (danger, distance, amount of cover positions are taken into account).
* After the fleeing has been finished the group's initial strength is reset.
* Fleeing units in [[combatMode]] red, will be set to yellow when fleeing to avoid engaging enemies while doing so.
* While fleeing, the group leader will be set to green, to avoid giving engage or fire orders, unless in [[combatMode]] blue already. Also [[speedMode]] is set to full.
* When reaching their flee point/destination, they will change to [[combatMode]] yellow and [[speedMode]] normal.
* With [[allowFleeing]] one can make unit's flee earlier (or essentially never flee). Apply it, overrides the courage subskill influence.
 
|s1= [[fleeing]]  unit
 
|p1= unit: [[Object]]


<h3 style="display:none">Notes</h3>
|r1= [[Boolean]] - returns [[true]] if a unit is fleeing, [[false]] if not. '''Dead''' or '''empty''' units return [[false]].
<dl class="command_description">
<!-- Note Section BEGIN -->
<!-- Note Section END -->
</dl>


<h3 style="display:none">Bottom Section</h3>
|x1= <sqf>if (fleeing soldier_1) then {player sideChat "We have won!"} else {player sideChat "Keep fighting!"};</sqf>
[[Category:Scripting Commands|FLEEING]]
[[Category:Scripting Commands OFP 1.99|{{uc:{{PAGENAME}}}}]]
[[Category:Scripting Commands OFP 1.96|FLEEING]]
[[Category:Scripting Commands OFP 1.46|FLEEING]]
[[Category:Scripting Commands Armed Assault|FLEEING]]
[[Category:Command_Group:_Object_Information|{{uc:{{PAGENAME}}}}]]
[[Category:Scripting Commands Arma 2|{{uc:{{PAGENAME}}}}]]
[[Category:Scripting Commands Arma 3|{{uc:{{PAGENAME}}}}]]
[[Category:Scripting Commands Take On Helicopters|{{uc:{{PAGENAME}}}}]]


<!-- CONTINUE Notes -->
|seealso= [[allowFleeing]]
<dl class="command_description">
}}
<dd class="notedate">Posted on December 31, 2019 - 08:56 (UTC)</dd>
<dt class="note">[[User:.kju|.kju]]</dt>
<dd class="note">
Fleeing units in [[combatMode]] red, will be set to yellow when fleeing to avoid engaging enemies while doing so.
The group leader will be set to green, to avoid giving engage or fire orders, unless in [[combatMode]] blue already.
Finally [[speedMode]] is set to full.
<br><br>
When reaching their flee point/destination, they will change to [[combatMode]] yellow and [[speedMode]] normal.
</dd>
</dl>
<!-- DISCONTINUE Notes -->

Latest revision as of 15:47, 8 November 2023

Hover & click on the images for description

Description

Description:
Checks if a unit is fleeing.

Notes:
  • Fleeing only affects AI led groups.
  • Only the group as a whole can flee (or not).
  • The courage of the AI group is based on the group's leader courage subskill.
  • Each group has a max strength (summed "armor" of all infantry units - plus armor when inside vehicles).
  • If the group losses by injury/damage or death/destruction are higher than the max strength, multiplied by leader's courage or allowFleeing level , then the group will start fleeing.
  • As result primarily the AI flees to a nearby "supply point" (some friendly units - preferably with medic or engineer, or a vehicle with repair/ammo/fuel cargo). Alternatively it will try to find a safe position within a 600m radius from the initial waypoint (danger, distance, amount of cover positions are taken into account).
  • After the fleeing has been finished the group's initial strength is reset.
  • Fleeing units in combatMode red, will be set to yellow when fleeing to avoid engaging enemies while doing so.
  • While fleeing, the group leader will be set to green, to avoid giving engage or fire orders, unless in combatMode blue already. Also speedMode is set to full.
  • When reaching their flee point/destination, they will change to combatMode yellow and speedMode normal.
  • With allowFleeing one can make unit's flee earlier (or essentially never flee). Apply it, overrides the courage subskill influence.
Groups:
Object Manipulation

Syntax

Syntax:
fleeing unit
Parameters:
unit: Object
Return Value:
Boolean - returns true if a unit is fleeing, false if not. Dead or empty units return false.

Examples

Example 1:
if (fleeing soldier_1) then {player sideChat "We have won!"} else {player sideChat "Keep fighting!"};

Additional Information

See also:
allowFleeing

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