getUnitState: Difference between revisions

From Bohemia Interactive Community
Jump to navigation Jump to search
(Created page with "{{RV|type=command |game1= arma3 |version1= 2.18 |arg= |eff= |gr1= AI Behaviour |descr= Returns current state of the AI unit, which could be one of the following: * 123 |s1= getUnitState unit |p1= unit: Object |r1= String - unit state (see description) |x1= <sqf>_soldierOne enableAI "Move";</sqf> |seealso= disableAI enableAI checkAIFeature enableAIFeature vehicleMoveInfo }}")
 
No edit summary
 
(5 intermediate revisions by the same user not shown)
Line 4: Line 4:
|version1= 2.18
|version1= 2.18


|arg=
|arg= local


|eff=  
|eff=  
Line 10: Line 10:
|gr1= AI Behaviour
|gr1= AI Behaviour


|descr= Returns current state of the AI unit, which could be one of the following:
|descr= Returns current state of the given AI unit, which could be one of the following:
* 123
* "WAIT" - another plan is needed (current partial plan was done or is not present)
 
* "INIT" - operative planing should start, endpoint is set
* "INITFAILED" - init failed because data are not ready
* "BUSY" - operative plan ready and valid
* "OK" - completed whole strategic plan
* "DELAY" - repeat search, usually when failed
* "CARGO" - unit is in vehicle cargo, no planning needed
* "STOPPING" - unit is stopping (usually because of getin/getout request/landing)
* "REPLAN" - we have a plan, but we would like to search a new one
* "STOPPED" - unit is stopped, no planning needed (also landed. Different from [[stop]] command)
* "PLANNING" - operative planning pending


|s1= [[getUnitState]] unit
|s1= [[getUnitState]] unit
Line 20: Line 29:
|r1= [[String]] - unit state (see description)
|r1= [[String]] - unit state (see description)


|x1= <sqf>_soldierOne enableAI "Move";</sqf>
|x1= <sqf>_state = getUnitState bob; //"WAIT"</sqf>


|seealso= [[disableAI]] [[enableAI]] [[checkAIFeature]] [[enableAIFeature]] [[vehicleMoveInfo]]
|seealso= [[disableAI]] [[enableAI]] [[checkAIFeature]] [[enableAIFeature]] [[vehicleMoveInfo]] [[expectedDestination]]
}}
}}

Latest revision as of 14:15, 22 October 2024

Hover & click on the images for description

Description

Description:
Returns current state of the given AI unit, which could be one of the following:
  • "WAIT" - another plan is needed (current partial plan was done or is not present)
  • "INIT" - operative planing should start, endpoint is set
  • "INITFAILED" - init failed because data are not ready
  • "BUSY" - operative plan ready and valid
  • "OK" - completed whole strategic plan
  • "DELAY" - repeat search, usually when failed
  • "CARGO" - unit is in vehicle cargo, no planning needed
  • "STOPPING" - unit is stopping (usually because of getin/getout request/landing)
  • "REPLAN" - we have a plan, but we would like to search a new one
  • "STOPPED" - unit is stopped, no planning needed (also landed. Different from stop command)
  • "PLANNING" - operative planning pending
Groups:
AI Behaviour

Syntax

Syntax:
getUnitState unit
Parameters:
unit: Object
Return Value:
String - unit state (see description)

Examples

Example 1:
_state = getUnitState bob; //"WAIT"

Additional Information

See also:
disableAI enableAI checkAIFeature enableAIFeature vehicleMoveInfo expectedDestination

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