Jump to content
Sign in to follow this  
BEAKSBY

disableAI "AUTOTARGET"

Recommended Posts

Hi All,

The _uav disableAI "AUTOTARGET"; in my addAction below is not preventing the UAV from firing. I don't want it to AUTOTARGET, only when the player uses his laserdesignator. What am I doing wrong?

player addAction ["B_UAV_02_F", {_uav = createVehicle ["B_UAV_02_F",[1700,5600,150], [], 0, "FLY"]; _uav disableAI "AUTOTARGET"; createVehicleCrew _uav;},[],0,true,true, "","player hasWeapon ""Laserdesignator"""];

Share this post


Link to post
Share on other sites

Think of autotarget as target seek, when disabled a unit will not look for targets, if gunshots come from behind, ai wont turn and seek source of gunfire. If a target walks into it's field of view, it will still react. Also if it is in a group, it will react to group leaders target commands. If you disableAI "TARGET" it will react to threats, but will not engage. You can then use combination of doTarget, laserTarget, doFire commands

Edited by mcrow900

Share this post


Link to post
Share on other sites
Think of autotarget as t rget seek, when disabled a unit will not look for targets, if gunshots come from behind, ai wont turn and seek source of gunfire. If a target walks into it's field of view, it will still react. Also if it is in a group, it will react to group leaders target commands. If you disableAI "TARGET" it will react to threats, but will not engage. You can then use combination of doTarget, laserTarget, doFire commands

I'm wondering if I can use setAtonomous recently released https://community.bistudio.com/wiki/setAutonomous?

Share this post


Link to post
Share on other sites

what you do is since I believe that is the fixed-wing drone you want to do

(driver _uav) disableAI "AUTOTARGET"; (gunner _uav) disableAI "AUTOTARGET"

oh and make sure you do that after you create the crew

Share this post


Link to post
Share on other sites
what you do is since I believe that is the fixed-wing drone you want to do
(driver _uav) disableAI "AUTOTARGET"; (gunner _uav) disableAI "AUTOTARGET"

oh and make sure you do that after you create the crew

So it looks like this...

player addAction ["B_UAV_02_F", {_uav = createVehicle ["B_UAV_02_F",[1700,5600,150], [], 0, "FLY"]; createVehicleCrew _uav; (driver _uav) disableAI "AUTOTARGET"; (gunner _uav) disableAI "AUTOTARGET"  },[],0,true,true, "","player hasWeapon ""Laserdesignator"""];

AND...if I wanted to limit _uav's ammo for the "missiles_SCALPEL" from 6 to 2. I do this:

_uav setAmmo ["missiles_SCALPEL", 2] ?

So now the whole enchilada should look like this:

player addAction ["B_UAV_02_F", {_uav = createVehicle ["B_UAV_02_F",[1700,5600,150], [], 0, "FLY"]; createVehicleCrew _uav; (driver _uav) disableAI "AUTOTARGET"; (gunner _uav) disableAI "AUTOTARGET"; _uav setAmmo ["missiles_SCALPEL", 2]},[],0,true,true, "","player hasWeapon ""Laserdesignator"""];

Edited by BEAKSBY

Share this post


Link to post
Share on other sites
what you do is since I believe that is the fixed-wing drone you want to do
(driver _uav) disableAI "AUTOTARGET"; (gunner _uav) disableAI "AUTOTARGET"

oh and make sure you do that after you create the crew

I tested it and it does not work on the fixed-wing drone. It still fires on the enemy units.

Can I use setCombatMode on a drone?

_uav setAmmo ["missiles_SCALPEL", 2]

This does work.

Share this post


Link to post
Share on other sites
(group(driver _uav)) setCombatMode "BLUE"

Share this post


Link to post
Share on other sites
(group(driver _uav)) setCombatMode "BLUE"

Yup, I tried that one too, but it just flies away, even if you target the enemy with the laserdesignator.

I posted this:

The drones don't follow waypoints when the "autonomous" case isn't checked, they just stop where they are.

Also when not autonomous, you can't set or interact with waypoints.

This is intended behaviour. When you disable the "autonomous" checkbox, AI inside of the UAV is disabled.

When I script: _uav setAutonomous false; The uav still fires on the enemy? Is this intended?

here: http://forums.bistudio.com/showthread.php?168197-UAVs-Feedback-and-wishes/page18

Share this post


Link to post
Share on other sites

well the only thing is just go in game and go into the AV terminal and set the UAV a waypoint and set it's combat mode to never fire until you need it to.

Share this post


Link to post
Share on other sites

Does anyone have a script to solve and share on how to get the UAV drone to only fire only when laserTargetting a target?

I've tried this below, but it still just flies around.

waitUntil {sleep 0.1; (laserTarget player != objNull)};
_uav setAutonomous true; 
_uav doTarget (laserTarget player);
hint format ["targetVehicle: %1", (vehicles (laserTarget player)) select 0];

_uav fireAtTarget [(vehicles (laserTarget player)) select 0, "missiles_SCALPEL"] ;
},"",10]; 

Edited by BEAKSBY

Share this post


Link to post
Share on other sites

Please sign in to comment

You will be able to leave a comment after signing in



Sign In Now
Sign in to follow this  

×