System Index on Route

I'm currently working on a Plug-in that calculates travel time and plots the course using the roots. Mimicking the idea of star wars, I have planets connected to certain planets through hyperplanes marked by routes and I also have different route types that have different speed modifiers for travel time. I know I can find if a body is on a route but I want to see where that body is on the route in comparison to others. My understanding is that each body has an index on the route created from the order they were selected when making the route. How can I find the index of the body on the route?

Comments

  • I believe you can use the GetWaypoint() and GetWaypointCount() methods for this. I've never tried it exactly this way though. You would iterate the waypoints. Each waypoint object has a property called Body which would represent the body connected to that point.

    basically something like (my VBS is rusty)

    dim i, n
    n = myroute.GetWaypointCount()
    for i = 1 to n
       wp = myroute.GetWaypoint(i-1)
       if wp.Body = someplanet then...
    

Leave a Comment