The upside down T sounded interesting, which is basically a path that has branches. Here's what I came up with. Defining the paths is pretty tedious since you have to place a list of the uids of all the connected nodes in each node, but the events are fairly simple albeit dense.
https://www.dropbox.com/s/maef5spnv5olc07/path_follow_2.capx?dl=1
The motion is driven by the the input angle. If the object is between nodes the object will move forward or backwards depending if the input direction is pointing more in one way or another. Also when a node is hit it will look at all the connecting nodes and pick the one with the lowest anglediff with the input angle to move towards.
The events a mostly easy enough to follow I think. The exception is probably the formula in event 13:
obj: add (cos(inputDir-self.ang)>0?1:-1)*speed*dt to d
inputDir is the angle from the keyboard input
self.ang is the angle between the current pair of nodes.
cos(inputDir-self.ang) is the dot product between two unit vectors made from those angles. It just simplifies to that. If the dot product is positive then the inputDir is mostly in the same direction as the angle between the nodes. And if it's negative then it should go backwards.
The conditional ...cos(inputDir-self.ang)>0?1:-1 is to make it only positive or negative 1. That is to keep the speed constant.
The remainder is to apply the speed in that direction with dt.
Holy Crap. This works like a dream. I wouldn't even begin to understand anything involving all that Construct math. I was able to adjust the speed of the object so that's a plus.
How exactly would you be able to add more nodes? I couldn't figure out your number setup for the 'wide U shape' nodes. The setup for the 'wide U shape' seems to be the better one since it has the most nodes for the object to search for. I was even able to shape it like an 'upside down T' as well and have it so that the object moves all the way to the right with just pressing right on the keyboard (pressing left led to the object getting stuck until I pressed up).
In my game, the player only has to press Left/Right and the sprite would move to the far end of the set path. If you can show how to add more nodes properly then you could make a path that goes just about anywhere in the layout in any shape.
Thanks alot to the both of you.