Re: [nbos] [AS] Creating Routes
NBOS Support
Sat Feb 24th, 2007
>it creates the route just fine but instead of being unassigned it, I assume,
>is toggling it as "stringname". However it's not updating the program so I
>cannot filter via the routename or even delete the script created routes. I
>hope I was clear with that.

Tacking on 'Sector.AddRouteType' should do the trick. Here's a revised
sample, and an alternative example down below it:

Set Sector = GetCurrentSector()

Route = CreateRoute()
route.Name = "My Route Name"
route.RouteType = "Trade Route"
route.Red = 1 'route colors go from 0 to 1, not 0 to 255
route.blue = 1
route.green = 1
Route.LineWidth = 1
Route.LineStyle = 1

wp = CreateWaypoint()
wp.Body = body1
wp.ID = body1.IDString
wp.x = body1.x
wp.y = body1.y
wp.z = body1.z

Route.AddWaypoint wp

wp = CreateWaypoint()
wp.Body = body2
wp.ID = body2.IDString
wp.x = body2.x
wp.y = body2.y
wp.z = body2.z

Route.AddWaypoint wp

Sector.AddRoute Route
Sector.AddRouteType route.RouteType 'this adds it to the filter list


----
there's an alternative way to add a system to a route as well, to bypass
the manual creation of waypoints:

Route = CreateRoute()
route.Name = "My Route Name"
route.RouteType = "Route Type"
route.Red = 1 'route colors go from 0 to 1, not 0 to 255
route.blue = 1
route.green = 1
Route.LineWidth = 1
Route.LineStyle = 1

Route.AddSystem body1
Route.AddSystem body2

Sector.AddRoute Route
Sector.AddRouteType route.RouteType

_______________________________________________
Nbossoftware mailing list


Copyright © 2003-2007, NBOS Software. All rights reserved. 'Fractal Mapper', 'ScreenMonkey', 'Character Sketcher', 'Inspiration Pad', 'Fractal World Explorer', 'Goblin API', 'AstroSynthesis' are trademarks of NBOS Software. 'Dwarven Beserker' art by V. Shane.
Member contributed resources