{"name":"getUnitState","operator":null,"title":"getUnitState","type":"command","url":"https://community.bistudio.com/wiki/getUnitState","revid":369978,"updated":"2024-10-22T13:15:33Z","groups":["AI Behaviour"],"status":"ok","replaced_by":[],"games":[{"game":"arma3","name":"Arma 3","version":"2.18"}],"since":{"game":"arma3","name":"Arma 3","version":"2.18"},"arma3_since":"2.18","branch":null,"locality":{"argument":"local","effect":null,"server_exec":false},"exec":null,"description":"Returns current state of the given AI unit, which could be one of the following:\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","since":null,"effect":null,"exec":null,"params":[{"name":"unit","type":"Object","optional":false,"default":null,"description":null,"types":["Object"],"since":null,"text":"unit: Object"}],"returns":{"type":"String","types":["String"],"description":"unit state (see description)","text":"String - unit state (see description)"},"form":"unary","operator":null,"left":null,"right":{"text":"unit","types":["Object"]}}],"examples":[{"text":"```sqf\n_state = getUnitState bob; //\"WAIT\"\n```","code":["_state = getUnitState bob; //\"WAIT\""]}],"multiplayer":null,"problems":null,"aliases":[],"see_also":["disableAI","enableAI","checkAIFeature","enableAIFeature","vehicleMoveInfo","expectedDestination"],"notes":[],"categories":["Arma 3: New Scripting Commands","Arma 3: Scripting Commands","Command Group: AI Behaviour","Introduced with Arma 3 version 2.18","Scripting Commands"]}