Author Topic: Dynamic waypoint paths for capships?  (Read 2855 times)

0 Members and 1 Guest are viewing this topic.

Offline Aginor

  • Spelljammer
  • 210
Dynamic waypoint paths for capships?
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. :(
Member of the Scooby Doo model Fanclub "verticies and splines are the medium and he is the artist."

 

Offline mjn.mixael

  • Cutscene Master
  • 212
  • Chopped liver
    • Steam
    • Twitter
Re: Dynamic waypoint paths for capships?
Moving waypoints around in-mission won't work. However, the code (not sure if it made it into WCS though) does support unlimited waypoints now.

You could add plenty of waypoints around the space where Ship A might be. The you could use a when-argument distance check to find the nearest waypoint and set Ship B to go to that one.
Cutscene Upgrade Project - Mainhall Remakes - Between the Ashes
Youtube Channel - P3D Model Box
Between the Ashes is looking for committed testers, PM me for details.
Freespace Upgrade Project See what's happening.

 
Re: Dynamic waypoint paths for capships?
Ahhh, dynamic waypoints.

It's up there with the other grails of the SCP, somewhere between shadows and geomod.

Well, shadows already sort of exist, do they still count as a grail?

 

Offline Sushi

  • Art Critic
  • 211
Re: Dynamic waypoint paths for capships?
Moving waypoints around in-mission won't work. However, the code (not sure if it made it into WCS though) does support unlimited waypoints now.

You could add plenty of waypoints around the space where Ship A might be. The you could use a when-argument distance check to find the nearest waypoint and set Ship B to go to that one.

I thought moving waypoints worked, but if a ship was already following a path it wouldn't ever reflect that update?

Also, have you tried using ai-chase?

 

Offline General Battuta

  • Poe's Law In Action
  • 214
  • i wonder when my postcount will exceed my iq
Re: Dynamic waypoint paths for capships?
Sushi is correct. I've always wanted that fixed, as it would enable some amazing ****.

 

Offline Aginor

  • Spelljammer
  • 210
Re: Dynamic waypoint paths for capships?
I *think* I tried ai-chase but it didn't do anything. But then the target was a fighter (the player) when I tried it, and maybe capships don't follow fighters at all...
Moving waypoints around in-mission won't work. However, the code (not sure if it made it into WCS though) does support unlimited waypoints now.

You could add plenty of waypoints around the space where Ship A might be. The you could use a when-argument distance check to find the nearest waypoint and set Ship B to go to that one.

I thought moving waypoints worked, but if a ship was already following a path it wouldn't ever reflect that update?

I think this is what happened. The ship seemed to ignore it.

@mjn.mixael:
Sounds good. I think I'll try that. I just thought moving a waypoint to the ship's position would be the more elegant way.

EDIT:
For fighters I use ghost ships when waypoints don't work, but that means back to square one since I couldn't make a capship follow another ship in the first place.
« Last Edit: May 29, 2012, 10:09:42 am by Aginor »
Member of the Scooby Doo model Fanclub "verticies and splines are the medium and he is the artist."

 

Offline Droid803

  • Trusted poster of legit stuff
  • 213
  • /人 ◕ ‿‿ ◕ 人\ Do you want to be a Magical Girl?
    • Skype
    • Steam
Re: Dynamic waypoint paths for capships?
You can definitely make capships ai-chase another capship.
Just be sure to cancel the order when they get too close or it will attempt to show you the dance of their people.
(´・ω・`)
=============================================================

 

Offline mjn.mixael

  • Cutscene Master
  • 212
  • Chopped liver
    • Steam
    • Twitter
Re: Dynamic waypoint paths for capships?
You can definitely make capships ai-chase another capship.
Just be sure to cancel the order when they get too close or it will attempt to show you the dance of their people.

 :lol:
Cutscene Upgrade Project - Mainhall Remakes - Between the Ashes
Youtube Channel - P3D Model Box
Between the Ashes is looking for committed testers, PM me for details.
Freespace Upgrade Project See what's happening.

 

Offline Aginor

  • Spelljammer
  • 210
Re: Dynamic waypoint paths for capships?
Ok, I'll test that in a minute.
Member of the Scooby Doo model Fanclub "verticies and splines are the medium and he is the artist."

 

Offline Aginor

  • Spelljammer
  • 210
Re: Dynamic waypoint paths for capships?
Hmmm... now it worked.
Is there any difference between setting initial orders to "attack ship A" and giving the orders via SEXP (ai-chase ship A)? I could swear I tried it that way and it didn't work...

Anyway, thanks for your answers, that was a lot easier than expected.
Member of the Scooby Doo model Fanclub "verticies and splines are the medium and he is the artist."

 

Offline Droid803

  • Trusted poster of legit stuff
  • 213
  • /人 ◕ ‿‿ ◕ 人\ Do you want to be a Magical Girl?
    • Skype
    • Steam
Re: Dynamic waypoint paths for capships?
There is no difference, both work the same way.
(´・ω・`)
=============================================================

 

Offline Aginor

  • Spelljammer
  • 210
Re: Dynamic waypoint paths for capships?
Ok, thanks. :)
Member of the Scooby Doo model Fanclub "verticies and splines are the medium and he is the artist."