Hi there!
I'm working on the sixth and seventh missions of my Kilrathi mod for Saga at the moment, and there is a scene where a enemy capship is supposed to hunt a friendly one.
The problem is: I am doing something wrong. Neither ai-stay-near-ship nor ai-chase seems to have the desired effect.
Here's the situation:
- The friendly ship (ship A) is on a circle path around a jump point, guarding it. Waves of enemies jump in and are defeated by the player and his wingmen and ship A
- suddenly a bigger (too big) enemy capship (ship B) jumps in. Ship A has to flee. This event is triggered depending on various factors like how good the player is. So I don't know where ship A is when ship B jumps in.
So what I did is set a waypoint far away and as soon as B has jumped in I tell A to clear-goals and add-goal waypoint-once to the far away point. Roughly I know where that one should be. It is not a perfect escape route but it points away from the jump point at least. Looks cool so far.
The problem is that ship B out of the jump point does not point in the right direction, and when I tell it to fly towards the same waypoint as ship A it takes some sort of parallel course where it doesn't come near enough to ship A to be dramatic.
So I wondered if the following works:
- I create a waypoint somewhere (doesn't matter where), I call it "chaseWP"
- as soon as ship B has arrived I set-position of chaseWP to getX, getY, getZ of ship A. The same event tells ship B to ai-waypoint-once chase WP. So regardless of where ship A flies, ship B will head directly in its direction as soon as it arrives. When it reaches the waypoint it turns for the escape WP ship A flies to. It moves faster so it doesn't really matter that this is not the ideal intercept course. It is more of a lag pursuit.
Also I could use a moving waypoint to keep capships in formation maybe. Capships in wings have some strange side effects it seems...
would that work? I tried something similar before but something didn't work.
Or did I just do something wrong with the normal way of giving the ships orders? I tried ai-chase (or was it ai-stay-near-ship?) with capships before and nothing happened.
