Jump to content
WurschtBanane

Make jet attack laser designated targets only

Recommended Posts

Hi. I want to have the A10 jet from RHS circle around an area and only attack targets that a unit laser designates for him. I want him to use the GAU8 gatling gun on lasers too, how do i make that happen? Because if i just let him fly around he will attack tanks and vehicles by himself...

Share this post


Link to post
Share on other sites

You can explain it to me with any vanilla jet like the wipeout too, i will find out the classnames by myself...

Share this post


Link to post
Share on other sites

Cant you just remove all ammo from the GAU8 and rockets etc, leaving only the LGB ?

  • Like 1

Share this post


Link to post
Share on other sites

Cant you just remove all ammo from the GAU8 and rockets etc, leaving only the LGB ?

Did that.

2 Problems:

- He uses the bombs on his own.

- I want him to use his gun on lasers too.

Share this post


Link to post
Share on other sites

I think command "laserTarget" might help on this. So basically airplane should not attack anyone and look for only objects which returns from this command. A while loop with sleep around laser check is required I guess. I am not sure if there is an event for lased targets

  • Like 1

Share this post


Link to post
Share on other sites

I think command "laserTarget" might help on this. So basically airplane should not attack anyone and look for only objects which returns from this command. A while loop with sleep around laser check is required I guess. I am not sure if there is an event for lased targets

I would love it if you put in an example of it!

  • Like 1

Share this post


Link to post
Share on other sites

I'd say you should start by doing this (which will effectively stop your jet from selecting targets on his own):

yourJet disableAI "AUTOTARGET";

then run a loop with something like this to find all lasertargets in a certain range:

_nearbyLasers = (getPosATL yourJet) nearEntities ["LaserTarget", 3000];

then find the closest of those lasertargets

_dist = 3000;
_nearestLaser = objNull;
{
  _check = _x distance yourJet;
  if (_check < _dist) then {
    _dist = _check;
    _nearestLaser = _x;
  };
  true
} count _nearbyLasers;

and then just tell your jet to target and engage _nearestLaser

https://community.bistudio.com/wiki/doTarget

 

You could also set a waypoint or a move order. Whatever works best...

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

×