Page 1 of 1

Are two-way, single-engine, automatic trains possible?

Posted: Wed May 24, 2017 8:31 pm
by Phasma Felis
I was thinking of making a mod based on Shuttle Train Lite that lets a single locomotive with no attached cars drive automatically in both directions, for use as a small, fast player transport. (Possibly using this engine sprite from Yuoki Industries Railroads, since it looks bidirectional.)

Is that possible in the game engine? Are there any mods that do something like that that I could use for reference?

Re: Are two-way, single-engine, automatic trains possible?

Posted: Wed May 24, 2017 9:43 pm
by sparr
I believe that the current game engine won't allow this.

You might be able to fake it by making a shorter locomotive and replacing placed shuttles with two of the shorter loco, facing opposite directions.

Re: Are two-way, single-engine, automatic trains possible?

Posted: Thu May 25, 2017 12:04 am
by Phasma Felis
sparr wrote:I believe that the current game engine won't allow this.

You might be able to fake it by making a shorter locomotive and replacing placed shuttles with two of the shorter loco, facing opposite directions.
Dang, that's too bad. :( Thanks. Perhaps you could have a "main" engine with an invisible, zero-length one attached to the "back", which is created/damaged/destroyed when the "main" engine is? That may be beyond my scripting ability, though. Is it possible to replace a single entity with two like that, in the scripting engine?

Or, perhaps, is it possible to rotate an engine on the track in response to a pathing request? That might be simplest, if possible.

Re: Are two-way, single-engine, automatic trains possible?

Posted: Thu May 25, 2017 12:41 am
by sparr
You could probably wait for a train to change state, then flip it and re-path and see if the new path is shorter, and unflip if not.

A zero-length engine behind the real engine sounds viable.

Re: Are two-way, single-engine, automatic trains possible?

Posted: Thu May 25, 2017 12:49 pm
by darkfrei
Why not placing the second head every time when you place locomotive? When they have twice more power and synchronized inventory, then it looks like they both are motorized in every direction.