disableAI: Difference between revisions

From Bohemia Interactive Community
Jump to navigation Jump to search
m (Text replacement - " " to " ")
m (Fix)
(21 intermediate revisions by 6 users not shown)
Line 22: Line 22:
|version7= 0.50
|version7= 0.50


|arg= local
|arg= global


|eff= global
|eff= local


|gr1= Object Manipulation
|gr1= AI Behaviour


|descr= Disables parts of the AI behaviour to get a better control over the actions of a unit. If unit changes locality, it might need to be executed again at the new locality to maintain effect.
|descr= Disables parts of the AI behaviour to get a better control over the actions of a unit. If the unit changes locality, this command might need to be executed again at the new locality to maintain effect.
{{Feature|arma3|Since Arma 3 v1.96 it is possible to return the state of the given AI flag via [[checkAIFeature]] command or set it using alias command [[enableAIFeature]].}}
{{Feature|Warning|This command might cause unexpected behaviour, when used on a [[player]] controlled unit.}}


|s1= unitName '''disableAI''' section
{{Feature|warning|This command might cause unexpected behaviour when used on a player-controlled unit.}}


|p1= unitName: [[Object]] - AI unit
|mp= {{Feature|important|
The locality of this command is peculiar: the disabling will be stored ''locally'' and will apply '''if''' the AI is local or becomes local (e.g taking the lead, driving, etc).
If the AI changes locality again, that machine's AI setup will prevail.
}}
 
|s1= unit [[disableAI]] feature
 
|p1= unit: [[Object]] - AI unit


|p2= section: [[String]] - Possible values are:
|p2= feature: [[String]] - possible values are:
{{Columns|4|
* {{GVI|arma3|1.66|size= 0.75}}  "ALL"
* "AUTOTARGET"
* "MOVE"
* "TARGET"
* "TEAMSWITCH"
* "WEAPONAIM"
* {{GVI|ofp|1.99|size= 0.75}} "ANIM"
* {{GVI|arma2oa|1.60|size= 0.75}} "FSM"
* {{GVI|arma3|1.42|size= 0.75}}  "AIMINGERROR"
* {{GVI|arma3|1.42|size= 0.75}}  "SUPPRESSION"
* {{GVI|arma3|1.54|size= 0.75}}  "CHECKVISIBLE"
* {{GVI|arma3|1.56|size= 0.75}}  "AUTOCOMBAT"
* {{GVI|arma3|1.56|size= 0.75}}  "COVER"
* {{GVI|arma3|1.62|size= 0.75}}  "PATH"
* {{GVI|arma3|1.76|size= 0.75}}  "MINEDETECTION"
* {{GVI|arma3|1.92|size= 0.75}}  "LIGHTS"
* {{GVI|arma3|1.92|size= 0.75}}  "NVG"
* {{GVI|arma3|1.96|size= 0.75}}  "RADIOPROTOCOL"
* {{GVI|arma3|2.18|size= 0.75}}  "FIREWEAPON"
}}




<spoiler text="Show feature details">
{{{!}} class="wikitable"
{{{!}} class="wikitable"
{{!}}-
{{!}}-
! Section !! Description !! Since
! Feature !! Description !! Since
{{!}}-
{{!}}-
{{!}} "TARGET" {{!}}{{!}} Will prevent units from engaging the target. Units still move around for cover, but will not hunt down enemies. Works in groups as well. Excellent for keeping units inside bases or other areas without having them flank or engage anyone. They will still seek good cover if something is close by. {{!}}{{!}} -
{{!}} "ALL" {{!}}{{!}} Disables all features. {{!}}{{!}} {{GVI|arma3|1.66}}
{{!}}-
{{!}}-
{{!}} "AUTOTARGET" {{!}}{{!}} Essentially makes single units without a group, "deaf". The unit still goes prone and combat ready if it hears gunfire. They will not turn around when gunfire comes from the behind, but if an enemy walks in front of it it will target the enemy and fire as normal. '''Does not work for grouped units. The leader will assign targets to the units and effectively enables the AI back on.''' {{!}}{{!}} -
{{!}} "AIMINGERROR" {{!}}{{!}} Prevents AI's aiming from being distracted by its shooting, moving, turning, reloading, hit, injury, fatigue, suppression or concealed / lost target. {{!}}{{!}} {{GVI|arma3|1.42}}
{{!}}-
{{!}}-
{{!}} "MOVE" {{!}}{{!}} This will stop units from turning and moving, including vehicles. Units will still change stance and fire at the enemy if the enemy happens to walk right in front of the barrel. Unit will watch enemies that are in their line of sight, but will not turn their bodies to face the enemy, only their head. Works for grouped units as well. Good for staging units and holding them completely still. Movement can't be controlled by a script either, you have to re-enable movement for that. Unit will still be able to aim within his cone of fire/ do not move. {{!}}{{!}} -
{{!}} "ANIM" {{!}}{{!}} Disables all animations of the unit. Completely freezes the unit, including breathing and blinking. No move command works until the unit is unfrozen. {{!}}{{!}} {{GVI|ofp|1.99}}
{{!}}-
{{!}}-
{{!}} "WEAPONAIM" {{!}}{{!}} Disabled weapon aiming. {{!}}{{!}} -
{{!}} "AUTOCOMBAT" {{!}}{{!}} Disables autonomous switching to "COMBAT" [[AI Behaviour]] when in [[Arma_2:_FSM_Danger_Causes|danger]]. {{!}}{{!}} {{GVI|arma3|1.56}}
{{!}}-
{{!}}-
{{!}} "TEAMSWITCH" {{!}}{{!}} This will disable AI unit when teamswitching {{!}}{{!}} -
{{!}} "AUTOTARGET" {{!}}{{!}} Essentially makes single units without a group "deaf". The unit still goes prone and combat ready if it hears gunfire. It will not turn around when gunfire comes from behind, but if an enemy walks in front of it it will target the enemy and fire as normal. '''Does not work for grouped units as the leader will assign targets to the units, effectively reenabling this feature.''' {{!}}{{!}} -
{{!}}-
{{!}}-
{{!}} "ANIM" {{!}}{{!}} Disables all animations of the unit. Completely freezes the unit, including breathing. Won't even blink. No move command works until the unit is unfrozen. {{!}}{{!}} {{GVI|ofp|1.99}}
{{!}} "CHECKVISIBLE" {{!}}{{!}} Disables visibility raycasts. Useful in PvP missions where these raycasts are not needed. {{!}}{{!}} {{GVI|arma3|1.54}}
{{!}}-
{{!}}-
{{!}} "FSM" {{!}}{{!}} Example {{!}} Disables the attached FSM scripts which are responsible for the AI behaviour. Enemies react slower to enemy fire and the enemy stops using hand signals. Disabling FSM, can give the impression of untrained units as they react slower and are more disorganized than when FSM is enabled. Good for rebel fighters and when enabled better for professional armies {{!}}{{!}}{{!}} {{GVI|arma2oa|1.60}}
{{!}} "COVER" {{!}}{{!}} Disables usage of cover positions by the AI. {{!}}{{!}} {{GVI|arma3|1.56}}
{{!}}-
{{!}}-
{{!}} "AIMINGERROR" {{!}}{{!}} Prevents AI's aiming from being distracted by its shooting, moving, turning, reloading, hit, injury, fatigue, suppression or concealed/lost target. {{!}}{{!}} {{GVI|arma3|1.42}}
{{!}} "FSM" {{!}}{{!}} Example {{!}} Disables the attached FSM scripts which are responsible for the AI behaviour. Enemies react slower to enemy fire and the enemy stops using hand signals. Disabling FSM can give the impression of untrained units as they react slower and are more disorganized compared to when FSM is enabled. {{!}}{{!}}{{!}} {{GVI|arma2oa|1.60}}
{{!}}-
{{!}}-
{{!}} "SUPPRESSION" {{!}}{{!}} Prevents AI from being suppressed. See [[Arma 3: Suppression]]. {{!}}{{!}} {{GVI|arma3|1.42}}
{{!}} "LIGHTS" {{!}}{{!}} Stops AI from operating vehicle headlights and collision lights. {{!}}{{!}} {{GVI|arma3|1.92}}
{{!}}-
{{!}} "MINEDETECTION" {{!}}{{!}} Disable AI's mine detection. {{!}}{{!}} {{GVI|arma3|1.76}}
{{!}}-
{{!}}-
{{!}} "CHECKVISIBLE" {{!}}{{!}} Disables visibility raycasts. Useful in PvP missions where these raycasts are not needed. {{!}}{{!}} {{GVI|arma3|1.54}}
{{!}} "MOVE" {{!}}{{!}} This will stop units from turning and moving, including vehicles. Units will still change stance and fire at the enemy if the enemy happens to walk right in front of the barrel. Units will watch enemies that are in their line of sight, but will not turn their bodies to face the enemy, only their head. Works for grouped units as well. Good for staging units and holding them completely still. Movement can not be controlled via script either, this feature has to be reenabled for that. The unit will still be able to aim within its cone of fire. {{!}}{{!}} -
{{!}}-
{{!}}-
{{!}} "COVER" {{!}}{{!}} Disables usage of cover positions by the AI. {{!}}{{!}} {{GVI|arma3|1.56}}
{{!}} "NVG" {{!}}{{!}} Stops AI from putting on NVGs (but not from taking them off). {{!}}{{!}} {{GVI|arma3|1.92}}
{{!}}-
{{!}}-
{{!}} "AUTOCOMBAT" {{!}}{{!}} Disables autonomous switching to [[2D_Editor:_Waypoints#Behaviour|COMBAT]] when in [[Arma_2:_FSM_Danger_Causes|danger]] {{!}}{{!}} {{GVI|arma3|1.56}}
{{!}} "PATH" {{!}}{{!}} Stops the AI's movement but not the target alignment. {{!}}{{!}} {{GVI|arma3|1.62}}
{{!}}-
{{!}}-
{{!}} "PATH" {{!}}{{!}} Stops the AI’s movement but not the target alignment. {{!}}{{!}} {{GVI|arma3|1.62}}
{{!}} "RADIOPROTOCOL" {{!}}{{!}} Stops AI from talking and texting while still being able to issue orders. {{!}}{{!}} {{GVI|arma3|1.96}}
{{!}}-
{{!}}-
{{!}} "MINEDETECTION" {{!}}{{!}} Disable AI's mine detection. {{!}}{{!}} {{GVI|arma3|1.76}}
{{!}} "SUPPRESSION" {{!}}{{!}} Prevents AI from being suppressed. See [[Arma 3: Suppression]]. {{!}}{{!}} {{GVI|arma3|1.42}}
{{!}}-
{{!}}-
{{!}} "NVG" {{!}}{{!}} Stops AI from putting NVGs on but not taking them off. {{!}}{{!}} {{GVI|arma3|1.92}}
{{!}} "TARGET" {{!}}{{!}} Prevents units from engaging targets. Units still move around for cover, but will not hunt down enemies. Works in groups as well. Excellent for keeping units inside bases or other areas without having them flank or engage anyone. They will still seek good cover if something is close by. {{!}}{{!}} -
{{!}}-
{{!}}-
{{!}} "LIGHTS" {{!}}{{!}} Stops AI from operating vehicle headlights as well as collision lights. {{!}}{{!}} {{GVI|arma3|1.92}}
{{!}} "TEAMSWITCH" {{!}}{{!}} This will disable AI unit when teamswitching. When used on vehicles they might no longer follow waypoints and appear stuck. {{!}}{{!}} -
{{!}}-
{{!}}-
{{!}} "RADIOPROTOCOL" {{!}}{{!}} Stops AI from talking and texting while still being able to issue orders. {{!}}{{!}} {{GVI|arma3|1.96}}
{{!}} "WEAPONAIM" {{!}}{{!}} Disables weapon aiming. {{!}}{{!}} -
{{!}}-
{{!}}-
{{!}} "all" {{!}}{{!}} Disables all the above sections. {{!}}{{!}} {{GVI|arma3|1.66}}
{{!}} "FIREWEAPON" {{!}}{{!}} Disables weapon firing. {{!}}{{!}} {{GVI|arma3|2.18}}
{{!}}}
{{!}}}
</spoiler><br><br>


|r1= [[Nothing]]
|r1= [[Nothing]]


|x1= <code>_soldier1 [[disableAI]] "AUTOTARGET";</code>
|x1= <sqf>MyUnit disableAI "AUTOTARGET";</sqf>


|seealso= [[enableAI]], [[checkAIFeature]], [[enableAIFeature]], [[disableRemoteSensors]], [[vehicleMoveInfo]]
|seealso= [[enableAI]] [[checkAIFeature]] [[enableAIFeature]] [[disableRemoteSensors]] [[vehicleMoveInfo]]
}}
}}


<dl class="command_description">
{{Note
<dt></dt>
|user= Hardrock
<dd class="notedate">Posted on August 3, 2006 - 14:31</dd>
|timestamp= 20060803143100
<dt class="note">[[User:Hardrock|hardrock]]<dd class="note">''Notes from before the conversion:''
|text= ''Notes from before the conversion:''


The "TARGET" section of the AI is likely different than what you would think. Normally, when an AI group is standing still and sees an enemy, the group will break formation and start moving towards the enemy. If you disable the "TARGET" AI, then the AI units will stay where they are at. Even if you disable the "MOVE" AI, the units will still move out to attack the enemy, unless you disable the "TARGET" AI. Disabling both these AI sections is useful when placing units in defensive positions. This way, you can have them stay behind their cover, and not run out into the open.  
The "TARGET" section of the AI is likely different than what you would think. Normally, when an AI group is standing still and sees an enemy, the group will break formation and start moving towards the enemy. If you disable the "TARGET" AI, then the AI units will stay where they are at. Even if you disable the "MOVE" AI, the units will still move out to attack the enemy, unless you disable the "TARGET" AI. Disabling both these AI sections is useful when placing units in defensive positions. This way, you can have them stay behind their cover, and not run out into the open.  


This command has also a bug: after mission save or load the effect will be no longer active and you must set it again. It's also good way to detect number of saves and loads (loads can be recognized using [[time]] command).
This command has also a bug: after mission save or load the effect will be no longer active and you must set it again. It's also good way to detect number of saves and loads (loads can be recognized using [[time]] command).
<dt><dt>
}}
<dd class="notedate">Posted on Feb 7, 2009 - 14:31</dd>
 
<dt class="note">[[User:GeneralCarver|GeneralCarver]]<dd class="note">''Multiplayer Use as of ArmA v1.14:''
{{Note
|user= GeneralCarver
|timestamp= 20090207143100
|text= ''Multiplayer Use as of ArmA v1.14:''
Contrary to the post above, using this command WILL disable A.I. movement ability if used with the "MOVE" parameter. Works even when the A.I. is grouped with other units. I use this command to set up stationary targets at objectives all the time. Works on a dedicated server.
Contrary to the post above, using this command WILL disable A.I. movement ability if used with the "MOVE" parameter. Works even when the A.I. is grouped with other units. I use this command to set up stationary targets at objectives all the time. Works on a dedicated server.
</dl>
}}
 
{{Note
|user= Kenoxite
|timestamp= 20150919090000
|text= Beware that disabling "TARGET" AI to units in the player's group will disable the ability to execute engage orders issued by the player.
}}


<dl class="command_description">
{{Note
<dt></dt>
|user= James
<dd class="notedate">Posted on September 19, 2015 - 09:00 (UTC)</dd>
|timestamp= 20160926193400
<dt class="note">[[User:Kenoxite|Kenoxite]]</dt>
|text= Command is buggy in version 1.64.138497 as it disables the ability to drive vehicles for players. Tested with <sqf inline>player disableAI "move"</sqf>. Entering a vehicle is possible, but not starting the engine. <sqf inline>player enableAI "move"</sqf> enables the player to drive again.
<dd class="note">
Beware that disabling "TARGET" AI to units in the player's group will disable the ability to execute engage orders issued by the player.
</dd>
<dt><dt>
<dd class="notedate">Posted on September 26, 2016 - 19:34 (UTC)</dd>
<dt class="note">[[User:James|James]]</dt>
<dd class="note">
Command is buggy in version 1.64.138497 as it disables the ability to drive vehicles for players. Tested with {{ic|[[player]] [[disableAI]] "move"}}. Entering a vehicle is possible, but not starting the engine. {{ic|[[player]] [[enableAI]] "move"}} enables the player to drive again.
Feedback Tracker ticket: https://feedback.bistudio.com/T120346
Feedback Tracker ticket: https://feedback.bistudio.com/T120346
</dd>
}}
<dt><dt>
 
<dd class="notedate">Posted on June 5, 2018 - 19:29 (UTC)</dd>
{{Note
<dt class="note">[[User:zwobot|zwobot]]</dt>
|user= zwobot
<dd class="note">
|timestamp= 20180605192900
In '''{{ofp}}/Cold War Assault''', the disabled units are reset after a [[saveGame]] is executed or the user manually saves the mission, i. e. the units will behave as if the [[disableAI]] command was never applied to them. Also in {{ofp}} there is no way to undo this command.
|text= In '''{{ofp}}/Cold War Assault''', the disabled units are reset after a [[saveGame]] is executed or the user manually saves the mission, i. e. the units will behave as if the [[disableAI]] command was never applied to them. Also in {{ofp}} there is no way to undo this command.
</dd>
}}
</dl>
 
{{Note
|user= Samatra
|timestamp= 20230430101256
|text= Disabled or enabled AI features have no synchronization over the network what so ever, you have to do everything yourself on each client, including JIP. This also applies to [[setAutonomous]] which is pretty much multi-call disableAI command for specific set of features.
}}

Revision as of 19:24, 1 April 2024

Hover & click on the images for description

Description

Description:
Disables parts of the AI behaviour to get a better control over the actions of a unit. If the unit changes locality, this command might need to be executed again at the new locality to maintain effect.
This command might cause unexpected behaviour when used on a player-controlled unit.
Multiplayer:
The locality of this command is peculiar: the disabling will be stored locally and will apply if the AI is local or becomes local (e.g taking the lead, driving, etc). If the AI changes locality again, that machine's AI setup will prevail.
Groups:
AI Behaviour

Syntax

Syntax:
unit disableAI feature
Parameters:
unit: Object - AI unit
feature: String - possible values are:


Feature Description Since
"ALL" Disables all features. Arma 3 logo black.png1.66
"AIMINGERROR" Prevents AI's aiming from being distracted by its shooting, moving, turning, reloading, hit, injury, fatigue, suppression or concealed / lost target. Arma 3 logo black.png1.42
"ANIM" Disables all animations of the unit. Completely freezes the unit, including breathing and blinking. No move command works until the unit is unfrozen. Logo A0.png1.99
"AUTOCOMBAT" Disables autonomous switching to "COMBAT" AI Behaviour when in danger. Arma 3 logo black.png1.56
"AUTOTARGET" Essentially makes single units without a group "deaf". The unit still goes prone and combat ready if it hears gunfire. It will not turn around when gunfire comes from behind, but if an enemy walks in front of it it will target the enemy and fire as normal. Does not work for grouped units as the leader will assign targets to the units, effectively reenabling this feature. -
"CHECKVISIBLE" Disables visibility raycasts. Useful in PvP missions where these raycasts are not needed. Arma 3 logo black.png1.54
"COVER" Disables usage of cover positions by the AI. Arma 3 logo black.png1.56
"FSM" Disables the attached FSM scripts which are responsible for the AI behaviour. Enemies react slower to enemy fire and the enemy stops using hand signals. Disabling FSM can give the impression of untrained units as they react slower and are more disorganized compared to when FSM is enabled. A2 OA Logo.png1.60
"LIGHTS" Stops AI from operating vehicle headlights and collision lights. Arma 3 logo black.png1.92
"MINEDETECTION" Disable AI's mine detection. Arma 3 logo black.png1.76
"MOVE" This will stop units from turning and moving, including vehicles. Units will still change stance and fire at the enemy if the enemy happens to walk right in front of the barrel. Units will watch enemies that are in their line of sight, but will not turn their bodies to face the enemy, only their head. Works for grouped units as well. Good for staging units and holding them completely still. Movement can not be controlled via script either, this feature has to be reenabled for that. The unit will still be able to aim within its cone of fire. -
"NVG" Stops AI from putting on NVGs (but not from taking them off). Arma 3 logo black.png1.92
"PATH" Stops the AI's movement but not the target alignment. Arma 3 logo black.png1.62
"RADIOPROTOCOL" Stops AI from talking and texting while still being able to issue orders. Arma 3 logo black.png1.96
"SUPPRESSION" Prevents AI from being suppressed. See Arma 3: Suppression. Arma 3 logo black.png1.42
"TARGET" Prevents units from engaging targets. Units still move around for cover, but will not hunt down enemies. Works in groups as well. Excellent for keeping units inside bases or other areas without having them flank or engage anyone. They will still seek good cover if something is close by. -
"TEAMSWITCH" This will disable AI unit when teamswitching. When used on vehicles they might no longer follow waypoints and appear stuck. -
"WEAPONAIM" Disables weapon aiming. -
"FIREWEAPON" Disables weapon firing. Arma 3 logo black.png2.18
↑ Back to spoiler's top


Return Value:
Nothing

Examples

Example 1:
MyUnit disableAI "AUTOTARGET";

Additional Information

See also:
enableAI checkAIFeature enableAIFeature disableRemoteSensors vehicleMoveInfo

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
Hardrock - c
Posted on Aug 03, 2006 - 14:31 (UTC)
Notes from before the conversion: The "TARGET" section of the AI is likely different than what you would think. Normally, when an AI group is standing still and sees an enemy, the group will break formation and start moving towards the enemy. If you disable the "TARGET" AI, then the AI units will stay where they are at. Even if you disable the "MOVE" AI, the units will still move out to attack the enemy, unless you disable the "TARGET" AI. Disabling both these AI sections is useful when placing units in defensive positions. This way, you can have them stay behind their cover, and not run out into the open. This command has also a bug: after mission save or load the effect will be no longer active and you must set it again. It's also good way to detect number of saves and loads (loads can be recognized using time command).
GeneralCarver - c
Posted on Feb 07, 2009 - 14:31 (UTC)
Multiplayer Use as of ArmA v1.14: Contrary to the post above, using this command WILL disable A.I. movement ability if used with the "MOVE" parameter. Works even when the A.I. is grouped with other units. I use this command to set up stationary targets at objectives all the time. Works on a dedicated server.
Kenoxite - c
Posted on Sep 19, 2015 - 09:00 (UTC)
Beware that disabling "TARGET" AI to units in the player's group will disable the ability to execute engage orders issued by the player.
James - c
Posted on Sep 26, 2016 - 19:34 (UTC)
Command is buggy in version 1.64.138497 as it disables the ability to drive vehicles for players. Tested with player disableAI "move". Entering a vehicle is possible, but not starting the engine. player enableAI "move" enables the player to drive again. Feedback Tracker ticket: https://feedback.bistudio.com/T120346
zwobot - c
Posted on Jun 05, 2018 - 19:29 (UTC)
In Operation Flashpoint/Cold War Assault, the disabled units are reset after a saveGame is executed or the user manually saves the mission, i. e. the units will behave as if the disableAI command was never applied to them. Also in Operation Flashpoint there is no way to undo this command.
Samatra - c
Posted on Apr 30, 2023 - 10:12 (UTC)
Disabled or enabled AI features have no synchronization over the network what so ever, you have to do everything yourself on each client, including JIP. This also applies to setAutonomous which is pretty much multi-call disableAI command for specific set of features.