Well currently the scripts only work for the left and right curve sections, I need to sit down and work out the other track pieces and then add carriages, figure out what to do about points, add some collision detection so the trains don't just drive through each other (boy does that look weird!) add acceleration and deceleration ... etc
The way it works is you name the train parts, T1E for the engine, T1C1 for the first carriage T1C2 for the second etc, the bogeys would then be called T1EB1 for the primary bogey (this one basically controls where the train is on the track and its speed and direction) and T1EB2, carriage bogeys would be T1C1B1, T1C1B2, T1C2B1 etc. Up to 9 trains with 9 carriages each using this simple naming convention.
The tracks are named in such a way that the scripts can figure out the mathy bits, i.e. RC1 is right hand curve type '1' that's what I've called it anyhow
, the track layout script at present simply builds a list with 'next' and 'prev' fields but this will be built upon when I start playing with points, each bogey works out where it should be on the track and the engine or carriage piece just positions itself with respect to it's bogey pair.
It's not rocket science .. yet ..
Will be interesting to see how many trains moving at once before the FPS dips below 60.
Been there, done that, got all the T-Shirts!