{"name":"getUnitState","title":"getUnitState","type":"command","url":"https://community.bistudio.com/wiki/getUnitState","revid":369978,"updated":"2024-10-22T13:15:33Z","groups":["AI Behaviour"],"status":"ok","games":{"arma3":"2.18"},"since":"arma3 2.18","arma3_since":"2.18","locality":{"argument":"local"},"description":"Returns current state of the given AI unit, which could be one of the following:\n\n- \"WAIT\" - another plan is needed (current partial plan was done or is not present)\n- \"INIT\" - operative planing should start, endpoint is set\n- \"INITFAILED\" - init failed because data are not ready\n- \"BUSY\" - operative plan ready and valid\n- \"OK\" - completed whole strategic plan\n- \"DELAY\" - repeat search, usually when failed\n- \"CARGO\" - unit is in vehicle cargo, no planning needed\n- \"STOPPING\" - unit is stopping (usually because of getin/getout request/landing)\n- \"REPLAN\" - we have a plan, but we would like to search a new one\n- \"STOPPED\" - unit is stopped, no planning needed (also landed. Different from stop command)\n- \"PLANNING\" - operative planning pending","syntaxes":[{"syntax":"getUnitState unit","params":[{"name":"unit","type":"Object","type_expr":"Object"}],"returns":{"type":"String","type_expr":"String","description":"unit state (see description)"},"form":"unary","right":{"text":"unit"}}],"examples":[{"code":["_state = getUnitState bob; //\"WAIT\""]}],"see_also":["disableAI","enableAI","checkAIFeature","enableAIFeature","vehicleMoveInfo","expectedDestination"]}