Hard Light Productions Forums

Modding, Mission Design, and Coding => The FRED Workshop => Topic started by: origin on May 18, 2010, 09:13:00 am

Title: Can an enemy ship flee a flight
Post by: origin on May 18, 2010, 09:13:00 am
Is there a way to have an enemy ship flee a fight?  I have tried several methods and none seem to work properly.

I am trying to have a trigger of something like: hits-left is <50 then run away.  I don't want the ship to warp out I want it to flee.  If I use evade the ship doesn't acutally leave.  If I use go to a waypoint it only goes if I stop shooting at it.

I am basically tying to get an enemy in the thick of battle to run away.

Any ideas?
Title: Re: Can an enemy ship flee a flight
Post by: Colonol Dekker on May 18, 2010, 09:19:55 am
Give it a triggered ai-waypoint order when it's health falls below whatever you want it to.
 
Title: Re: Can an enemy ship flee a flight
Post by: TopAce on May 18, 2010, 09:21:21 am
He tried that, but as he said, the enemy will follow his waypoints only if left alone.

I suggest trying No Dynamic Goals in the wing editor. It will likely make them easier targets, but there's no pain in trying.
Title: Re: Can an enemy ship flee a flight
Post by: Sushi on May 18, 2010, 09:44:29 am
He tried that, but as he said, the enemy will follow his waypoints only if left alone.

I suggest trying No Dynamic Goals in the wing editor. It will likely make them easier targets, but there's no pain in trying.

There isn't any way to toggle dynamic goals in FRED, is there?

Also, maybe instead of a waypoint, you could give them an invisible target a long way away to attack so that they use their afterburners? As far as I know, the AI never uses afterburners when doing waypoints. (BTW, would that be a generally useful feature to have (AI using afterburners for waypoints)? It should be easy to implement, the tougher questions are how to toggle/control that behavior since it probably isn't wanted all the time).
Title: Re: Can an enemy ship flee a flight
Post by: jr2 on May 18, 2010, 09:46:46 am
Could the AB use be tied to a new SEXP?
Title: Re: Can an enemy ship flee a flight
Post by: origin on May 18, 2010, 09:54:21 am
He tried that, but as he said, the enemy will follow his waypoints only if left alone.

I suggest trying No Dynamic Goals in the wing editor. It will likely make them easier targets, but there's no pain in trying.

There isn't any way to toggle dynamic goals in FRED, is there?

Also, maybe instead of a waypoint, you could give them an invisible target a long way away to attack so that they use their afterburners? As far as I know, the AI never uses afterburners when doing waypoints. (BTW, would that be a generally useful feature to have (AI using afterburners for waypoints)? It should be easy to implement, the tougher questions are how to toggle/control that behavior since it probably isn't wanted all the time).

Thats a good idea - didn't think of that one, Ill give it a try.
Title: Re: Can an enemy ship flee a flight
Post by: TopAce on May 18, 2010, 10:31:45 am
Quote
There isn't any way to toggle dynamic goals in FRED, is there?

Not to my knowledge. I once tried to find that, but not very recently, so the SCP may have implemented it since then.
Title: Re: Can an enemy ship flee a flight
Post by: origin on May 18, 2010, 10:33:14 am
Hot dam it works!  thanks sushi.

I put a fighter about 5000 clicks away and checked hidden from sensors

hits left < 50
Ai-chase

And off he goes even if I am chasing him shooting at him - he even does some dodging but stays on course fleeing. ;)
Title: Re: Can an enemy ship flee a flight
Post by: Colonol Dekker on May 18, 2010, 10:38:08 am
When I was on Tolwyns original wing commander mod team I managed to Fred the mission from wing commander 4 where an enemy thunderbolt flees back to its base ship. 
 
And I did it all with retail SEXPs.
Title: Re: Can an enemy ship flee a flight
Post by: FUBAR-BDHR on May 18, 2010, 03:44:29 pm
You could also try the waypoint thing with order priority over 100.   Should force the ship to ignore all other goals. 
Title: Re: Can an enemy ship flee a flight
Post by: Trivial Psychic on May 18, 2010, 07:03:52 pm
Problem is, ships don't use afterburners when following waypoints.  The distant attack method is probably your best bet for now, but you may want to have many of these in different directions, so all your fleeing ships don't all go in the same direction.  One additional possibility is to try to make the distant targets stealthy as well... otherwise they'll show up as the flashy blips on your radar... though a direct attack order may not work on stealthy ships.
Title: Re: Can an enemy ship flee a flight
Post by: Dragon on May 20, 2010, 11:54:01 am
It should work, stealth doesn't matter for AI.