{"name":"enableAI","operator":null,"title":"enableAI","type":"command","url":"https://community.bistudio.com/wiki/enableAI","revid":369964,"updated":"2024-10-22T12:39:51Z","groups":["AI Behaviour"],"status":"ok","replaced_by":[],"games":[{"game":"ofpe","name":"Operation Flashpoint: Elite","version":"1.00"},{"game":"arma1","name":"Armed Assault","version":"1.00"},{"game":"arma2","name":"Arma 2","version":"1.00"},{"game":"arma2oa","name":"Arma 2: Operation Arrowhead","version":"1.50"},{"game":"tkoh","name":"Take On Helicopters","version":"1.00"},{"game":"arma3","name":"Arma 3","version":"0.50"}],"since":{"game":"ofpe","name":"Operation Flashpoint: Elite","version":"1.00"},"arma3_since":"0.50","branch":null,"locality":{"argument":"local","effect":"global","server_exec":false},"exec":null,"description":"Enables parts of the AI behavior that was disabled by disableAI.\n\n> [!IMPORTANT]\n> When player switches and leaves behind AI unit, you need to enable \"TeamSwitch\" AI on it `_unit enableAI \"TeamSwitch\";` so that the unit continues with waypoints.\n\n> [!NOTE]\n> **Arma 3:** Since Arma 3 v1.96 it is possible to return the state of the given AI flag via checkAIFeature or set it using alias command enableAIFeature.","syntaxes":[{"syntax":"unit enableAI skilltype","since":null,"effect":null,"exec":null,"params":[{"name":"unit","type":"Object","optional":false,"default":null,"description":null,"types":["Object"],"since":null,"text":"unit: Object"},{"name":"skilltype","type":"String","optional":false,"default":null,"description":"see disableAI for possible values.","types":["String"],"since":null,"text":"skilltype: String - see disableAI for possible values."}],"returns":{"type":"Nothing","types":["Nothing"],"description":null,"text":"Nothing"},"form":"binary","operator":null,"left":{"text":"unit","types":["Object"]},"right":{"text":"skilltype","types":["String"]}}],"examples":[{"text":"```sqf\n_soldierOne enableAI \"Move\";\n```","code":["_soldierOne enableAI \"Move\";"]}],"multiplayer":null,"problems":null,"aliases":[],"see_also":["disableAI","checkAIFeature","enableAIFeature","vehicleMoveInfo","getUnitState"],"notes":[],"categories":["ArmA: Armed Assault: Scripting Commands","Arma 2: Operation Arrowhead: Scripting Commands","Arma 2: Scripting Commands","Arma 3: Scripting Commands","Command Group: AI Behaviour","Introduced with Operation Flashpoint: Elite version 1.00","Operation Flashpoint: Elite: New Scripting Commands","Operation Flashpoint: Elite: Scripting Commands","Scripting Commands","Scripting Commands: Global Effect","Take On Helicopters: Scripting Commands"]}