Page 1 of 1

Pathing with Waypoints

Posted: Sat Mar 29, 2008 8:06 am
by n3cr0m33p5
Just had another idea come to me after playing a few more levels. Under the AI commands, there is a variable to activate random way-points, and your entire creation then wanders about. Well what if we were to add another variable Waypoints.

I would format it along these lines ...

waypoints, part#, speed, wp#, wp#, ...

part# - the part that will be doing the moving ( and end up centered on the WPs )
speed - speed of motion
wp# - other parts that act as waypoints (visible or otherwise), which [part#] would move to in order

When the creation hits the last wp, it would move back to wp1 and start over again. This would allow multiple creations to follow their own paths without trying to cypher out the exact placement and rotation speed of parts for the current means of creating movement if you were seeking something a little more complicated.

Main thing to watch would be the link-path of parts. Link the wrong parts and half goes one way while the other goes another or just sits there

Posted: Sat Mar 29, 2008 2:52 pm
by Sasadad
Awesome! And I think it could be done, considering there is already a random waypoints option for the whole ship, but one question: Would the movement loop? Or would it just reach the end of its waypoints and stop?

Posted: Sun Mar 30, 2008 6:45 am
by n3cr0m33p5
It might be possible to do both ways, depending on how the coding / formatting goes. On one hand the coding may stop the command on the last WP or it may auto-loop. I guess it would depend on what you told the system to do when it encounters that command.

One alternative is to add a repeat variable to the format line

waypoint, part#, repeat, speed, wp#, wp#, ...

If [repeat] is set to 0 then it only does it once, otherwise it completes the given number of [repeat]
Might be able to use -1 to set for infinite, as that's the same way it's done for infinite lives

Posted: Sun Mar 30, 2008 4:15 pm
by Sasadad
I think that is the perfect solution to that. I would love to see MD put this idea into the game.