Hard Light Productions Forums
Modding, Mission Design, and Coding => The Modding Workshop => Topic started by: Starman01 on September 13, 2004, 04:06:32 pm
-
Hello again,
I have a question how this could be done (It always pained me, even in the very old builds).
Let's say I have a destroyer facing an enemy ship and changes fire with it. After the enemy is destroyed, another enemy appears right behind the destroyer.
How can it be achived, that the destroyer simply rotates around the Y-Axis and face the new enemy eye in eye ??
I once managed it with attack and AI-Goals which I then deleted after a specific time, but it was rather complicated.
If I use waypoints, the stupid AI starts going on a world journey and makes moves and rotates around different axis which will cause half the crew to run to the toilet for spitting :doubt:
Anyone has a idea how to do this ? The "set-ship-facing-object" is not usable, because It changes the ships-facing instantly.
Is there maybe another SEXP which I'm missing ?
-
That unfortunately, would require a stroll through the AI code, which coders avoid with a vengance. My best suggestion is to open up the Inferno Mission M9, where the EA jumps throught he Sol Gate, which the GTVA recaptured in the previous mission. After engaging 2 EA cruisers, the GTVA destroyer has to re-orient iself to bring its flank cannons to bear. I'm guessing that they used waypoints to accomplish this (which you already brought up), so you can get a better picture of how to accomplish this turn with a minimum of AI weird stuff.
Later!
-
you could maybe give the ship a waypoint close enough so that it would appear to shift round but not travel too far. IIRC there was alot of fuss about doing this so that an Orion would broadside hostile ships.
-
The problem with that IIRC is that ships don't always turn like you'd expect them to, and so you'd wind up with an Orion showing it's belly rather than its side to an enemy. You might be able to use a waypoint with cap-waypoint-speed 0 to get a destroyer to face a point smoothly without actually moving.
-
Yep, that's the problem. You have no gurantee that the ship will rotate
around the Y-axis, which it should in this case.
I must take a look how I did this in the old mission once, but I fear it
worked there only because the distance was rather big and I had the
beams involved (which I have not available now).
While writing this, I think I got an idea. While creating the autopilot-missions I noticed, that the ships face the far distant waypoint pretty good, so maybe the trick is to set the waypoint very far away. I gotta try this
-
Nope, still not working. Don't know why it worked earlier. When I try it now, the cruiser is rotating at all 3 axis just to face the other ship.
This AI can really make you cry :( Kamikaze isn't working anymore either).