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

Place to get help with not working mods / modding interface.
Post Reply
Phasma Felis
Inserter
Inserter
Posts: 36
Joined: Wed Feb 25, 2015 1:02 am
Contact:

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

Post 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?

sparr
Smart Inserter
Smart Inserter
Posts: 1327
Joined: Fri Feb 14, 2014 5:52 pm
Contact:

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

Post 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.

Phasma Felis
Inserter
Inserter
Posts: 36
Joined: Wed Feb 25, 2015 1:02 am
Contact:

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

Post 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.

sparr
Smart Inserter
Smart Inserter
Posts: 1327
Joined: Fri Feb 14, 2014 5:52 pm
Contact:

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

Post 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.

User avatar
darkfrei
Smart Inserter
Smart Inserter
Posts: 2903
Joined: Thu Nov 20, 2014 11:11 pm
Contact:

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

Post 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.

Post Reply

Return to “Modding help”