fleeing: Difference between revisions

From Bohemia Interactive Community
Jump to navigation Jump to search
m (Text replacement - "\| *((\[\[[a-zA-Z0-9_ |()]+\]\],? ?)+) * \}\}" to "|seealso= $1 }}")
(formatting)
Line 1: Line 1:
{{RV|type=command
{{RV|type=command


| ofp
|game1= ofp


|1.00
|version1= 1.00
 
|game2= arma1
 
|version2= 1.00
 
|game3= arma2
 
|version3= 1.00
 
|game4= arma2oa
 
|version4= 1.51
 
|game5= tkoh
 
|version5= 1.00
 
|game6= arma3
 
|version6= 0.50


|arg= global
|arg= global
Line 9: Line 29:
|gr1= Object Manipulation
|gr1= Object Manipulation


| Checks if a unit is fleeing.
|descr= Checks if a unit is fleeing.
<br><br>
<br><br>
Notes:
Notes:
Line 24: Line 44:
* With [[allowFleeing]] one can make unit's flee earlier (or essentially never flee). Apply it, overrides the courage subskill influence.
* With [[allowFleeing]] one can make unit's flee earlier (or essentially never flee). Apply it, overrides the courage subskill influence.


| [[Boolean]] <nowiki>=</nowiki> '''fleeing''' unitName
|s1= '''fleeing''' unit


|p1= unitName: [[Object]]
|p1= unit: [[Object]]


| [[Boolean]] - Returns true if a unit is fleeing, false if not. Dead or empty units return false.
|r1 [[Boolean]] - Returns [[true]] if a unit is fleeing, [[false]] if not. '''Dead''' or '''empty''' units return [[false]].
   
   
|x1= <pre>? (fleeing _east_unit) : player sideChat "We have won!"</pre>
|x1= <code>[[if]] ([[fleeing]] soldier_1) then {[[player]] [[sideChat]] "We have won!"} else {[[player]] [[sideChat]] "Keep fighting!"};</code>


|seealso= [[allowFleeing]]
|seealso= [[allowFleeing]]
}}
}}
[[Category:Scripting Commands OFP 1.99|{{uc:{{PAGENAME}}}}]]
[[Category:Scripting Commands OFP 1.96|FLEEING]]
[[Category:Scripting Commands OFP 1.46|FLEEING]]
{{GameCategory|arma1|Scripting Commands}}
{{GameCategory|arma2|Scripting Commands}}
{{GameCategory|arma3|Scripting Commands}}
{{GameCategory|tkoh|Scripting Commands}}
<!-- CONTINUE Notes -->
<dl class="command_description">
</dl>
<!-- DISCONTINUE Notes -->

Revision as of 09:20, 8 March 2021

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:
Return value needed

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