Page 1 of 1

A few things for trains

Posted: 12 Dec 2016, 18:00
by Parzival
Hi all;

was working on a train factory about half a year ago, and was wondering if I could request two new features:

1. A way to properly link train cars. I tried almost all unit behaviours and nothing worked, so I was wondering If someone could make this happen.

2. A way to make trains follow tracks. Also i need a way to make tracks auto detect position and join together automatically.

Thanks!

Re: A few things for trains

Posted: 12 Dec 2016, 18:20
by Silentwings
Also i need a way to make tracks auto detect position and join together automatically.
This part, you can do with a lua gadget and Spring.Get/SetUnitPosition

Afaics (1) is also possible with a gadget and MoveCtrl - viewtopic.php?t=34368#p575552 - but making trains follow your tracks may be harder if you want to integrate it with pathing etc.

Re: A few things for trains

Posted: 12 Dec 2016, 23:05
by PicassoCT
A properly linked train equals rope physix, with the pieces of the rope beeing rigid. You can try to implement this in lua via move-ctrl but its going to be alot of work.
http://nehe.gamedev.net/tutorial/rope_physics/17006/
i made trainanimations.. as in one unit, having several pieces, animated as a train..
you could add s44 boat turrets for collision spheres.. its a hack
but its way better when it comes to working