Jump to content
Mojo_Dog

Make enemy AI not shoot at aircraft unless it is close?

Recommended Posts

I make missions for my small group of friends. We have this one guy who really likes flying helos, so I made a mission where he can fly around and give us CAS, then refuel/restock ammo and stuff.

 

The thing is..

Every single enemy on the whole map turn their gun upward and fire at the helo, making it impossible to stay in the air for more than a couple of minutes. And it also lags the shit out of the server.

 

So I was thinking..

Is it possible to make the enemy AI stop firing at the helo but not take away all the realism?

Like, they only fire at the helo if it is, say 50 meter away?

Or worst case, just fire at the pilot if he exits the helo?

 

Anyone care to help? Im no scripting expert, I mostly just use pretty basic scripting.

Share this post


Link to post
Share on other sites

You can do it in the editor with just triggers:

  1. Give your pilot a name in the editor eg mrPilot
  2. Give your helicopter a name in the editor eg myHelo
  3. Create a trigger, set to Repeatedly. Condition: (position myHelo select 2) > 50. On Act: mrPilot setCaptive true. On Dea: mrPilot setCaptive false
  4. Repeat for any other helicopters and pilots in the mission

Share this post


Link to post
Share on other sites

I heard setCaptive was bad to use that way.

Some people say AI that has already seen something as "setCaptive true" will keep seeing it that way, even after "setCaptive false".

Like, it only work properly for AI that hasn't seen you.

 

But I will try it and see what happens.  :)

Share this post


Link to post
Share on other sites

I heard setCaptive was bad to use that way.

Some people say AI that has already seen something as "setCaptive true" will keep seeing it that way, even after "setCaptive false".

Like, it only work properly for AI that hasn't seen you.

 

But I will try it and see what happens.  :)

It might be a bit more complicated in multiplayer, but I flew around an enemy AI in the editor. Every time I dipped below 50 altitude, he fired at me. Every time I was over 50 he ignored me.....

Share this post


Link to post
Share on other sites

There is a noticeable delay in target acquisition after toggling setCaptive but not too much if your AI isn't lagging already.

Slightly odd, talks to pixels

Share this post


Link to post
Share on other sites

Someone please make a module with a slider where we could just dial in what we want for this mission... It`s actually much needed.It`s a pain in the a**!

 

Maybe even a "Zone" where we must survive ,maybe with a aiming error for Ai,of 20% or so.Dissable lock-on for missiles in-game.

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

×