[0.15] Automatic Coupler

Topics and discussion about specific mods
ransburger
Burner Inserter
Burner Inserter
Posts: 6
Joined: Tue Nov 29, 2016 2:58 pm
Contact:

Re: [0.15] Automatic Coupler

Post by ransburger »

vortex1967 wrote: by vortex1967 » Sat Aug 19, 2017 11:07 am

Hi all,

Sorry, in advance for the long post. There is a lot involved in getting this mod to work automatically with no, or very little intervention by the player.

The station at the smelters uses an expanded and adapted version of the outpost design.
All the following images are taken from the station at the smelters.
At the moment designs have been laid out into sections for ease of trouble shooting.
Blueprints...I am using the 'Lighted Power Pole Mod' and all the signal wires are run along these poles. I will have to redo all the logic stuff onto vanilla poles.
Any chance you could give a little explanation about how you got rail signals to work in conjunction with this mod?

I have a small system set up where a pair of locomotives brings in empty cars and swaps it for full cars, but the whole system is one big block, which is a bad plan long term.

Your screenshots seem to have signals on the tracks. How do you get your locomotives to approach parked rolling stock and successfully connect?

TalAntilles
Manual Inserter
Manual Inserter
Posts: 3
Joined: Wed Aug 30, 2017 11:09 am
Contact:

Re: [0.15] Automatic Coupler

Post by TalAntilles »

GotLag, I just wanted to say that this mod is fantastic. It's the only working automatic coupler mod I can find and it makes trains so much more interesting.

I've also just run into a multiplayer desync involving a train coupling to a few cars (in my case, two locomotives coupling to four item cars). No other mods installed. I have attached a desync report to this post if that is any help. Has anyone else found a solution to this?

Ruben_NL
Burner Inserter
Burner Inserter
Posts: 8
Joined: Sun May 14, 2017 2:02 pm
Contact:

Re: [0.15] Automatic Coupler

Post by Ruben_NL »

TalAntilles wrote:GotLag, I just wanted to say that this mod is fantastic. It's the only working automatic coupler mod I can find and it makes trains so much more interesting.

I've also just run into a multiplayer desync involving a train coupling to a few cars (in my case, two locomotives coupling to four item cars). No other mods installed. I have attached a desync report to this post if that is any help. Has anyone else found a solution to this?
i have the same problem. since today(maybe because an upgrade in server hardware, but i don't think so.)

It happens also when i setup an multiplayer server local, with only me on it.

Nexela
Smart Inserter
Smart Inserter
Posts: 1828
Joined: Wed May 25, 2016 11:09 am
Contact:

Re: [0.15] Automatic Coupler

Post by Nexela »

If this is easily reproducible can you post the save where it happens?

TalAntilles
Manual Inserter
Manual Inserter
Posts: 3
Joined: Wed Aug 30, 2017 11:09 am
Contact:

Re: [0.15] Automatic Coupler

Post by TalAntilles »

Yes, I will post the save and a guide to reproducing it later tonight. I have gotten it to happen 3-4 times now, though I am the only one (of three total) on the server affected. Although the other two are on the same network, so that may be a factor as well. If I find a solution I will post it, and any other things people find that work would be awesome to read.

TalAntilles
Manual Inserter
Manual Inserter
Posts: 3
Joined: Wed Aug 30, 2017 11:09 am
Contact:

Re: [0.15] Automatic Coupler

Post by TalAntilles »

Apologies for taking longer than anticipated, but I have attached the save. Only mod used is Automatic Coupler. You will want to look at the Southeast corner, specifically the railyard-in-progress right next to a large iron refinery. It is disconnected from the main rail line. It can be reproduced by having a shunter vehicle on automatic connect to a train of just cargo cars that is more than one car long.

In the meantime I have done a little more testing. It appears to select the player it desyncs at random. It is confirmed to not be the most recent player to join the server. It is also unrelated to the player that actually sets the orders. I suppose it could be based on ping, but can't test that theory yet. I have not yet tested it with fluid train cars either. All the cars tested have been empty as well, if that matters. It works fine on singleplayer.

Hope this helps!
Attachments
AutoCouplerDesync.zip
(12.16 MiB) Downloaded 164 times

vortex1967
Inserter
Inserter
Posts: 40
Joined: Fri Apr 15, 2016 8:48 am
Contact:

Re: [0.15] Automatic Coupler

Post by vortex1967 »

Hi ransburger,

Sorry for the delay in replying.
Connecting to rolling stock.
The But...and an Also.
Connecting to the back of locomotives.

driver
Long Handed Inserter
Long Handed Inserter
Posts: 58
Joined: Wed Oct 28, 2015 11:24 am
Contact:

Re: [0.15] Automatic Coupler

Post by driver »

You usually need three stops for uncoupling ("end"-stop to change direction and two stops for decoupling/coupling, because trainstops don't always properly align to each other. To better understand this, you could take a look at Nifty Maniacs video https://www.youtube.com/watch?v=fQAgWssR2aY
his mod worked similar.
Something I tried recently is this:
A train with 4 waggons (2x coal and 2 more or less empty waggons for copperore) enters the station at the right border, unloads some coal, then goes backwards to an "end"-stop, then forwards to the next stop for decoupling and decouples the 2 waggons for copperore (which ideally should be empty), goes to the stop at the right border again and then backwards to the station to couple two waggons with copperore and leaves.
The second pair of locomotives which provides the two full copperore waggons is still blocked and can only continue the path if the 4-waggon-train takes the 2 full waggons with copperore and leaves. No circuits involved.
Attachments
Three stops.jpg
Three stops.jpg (228.44 KiB) Viewed 9422 times

cid0rz
Long Handed Inserter
Long Handed Inserter
Posts: 89
Joined: Sun Jul 31, 2016 5:52 pm
Contact:

Re: [0.15] Automatic Coupler

Post by cid0rz »

Hello all, I'm trying this mod. Very nice indeed! I liked the one with pieces of rail that break or join the train but of course with signals it is much more flexible!

I'm trying to do a classification staiton. In this station trains with mixed wagons should arrive in different composition from the factories. So one can bring 3 wagosn of ironplate + 2 wagons of greencards for example. And then in this station the wagons would be stacked, classified and when needed a train according to factory demand would be assembled. It is a proof of concept so the complete operation cycle is not totally defined yet.
I managed to make it work sequentially, so it was not easy but I managed to place the couplers and uncouplers to perform the tasks I wanted. The problem is I'm using the Smarter Trains mod to be able to direct the wagons to their corresponding stock railways "programatically". When I couple or uncouple the wagons, they are taken out form the "line" of the smarter trains so they start going to the stations sequentially (like normal facotrio trains do). My question is, is it possible to keep the locomotives that couple or stack in the smarter trains line? I don't know how the internals of the mods work so any help on this directioon would be appreciated. I modified the layout wit the smart stops so I cannot show you images of it let's say working but I attach one so you have an idea.
Attachments
20170927115326_1.jpg
20170927115326_1.jpg (700.74 KiB) Viewed 9367 times

cid0rz
Long Handed Inserter
Long Handed Inserter
Posts: 89
Joined: Sun Jul 31, 2016 5:52 pm
Contact:

Re: [0.15] Automatic Coupler

Post by cid0rz »

I made a small video to show functionality. i had to implement it with "dumber" trains. The problem with this approach is you loose a lot of flexibility and you need one locomotive for each operation instead of one for all. If I counld use the gotosignal# of smarter trains the build would have more combinators and less locos ^^

https://vimeo.com/235793457

vortex1967
Inserter
Inserter
Posts: 40
Joined: Fri Apr 15, 2016 8:48 am
Contact:

Re: [0.15] Automatic Coupler

Post by vortex1967 »

Hi cidOrz,

I don't think Smarter Trains can be used to sort wagons by their contents.

I came up with a design to see if it was possible to automatically sort random composition trains.
It uses 1 double header locomotive to do the sorting.
Wagons can be delivered any length(adjust length of the delivery station to suit)
No requirement to split wagons before sorting.
The sorted wagons can be any length(adjust length of the sorted stations to suit)
Ready to sort
Midway sorted
Last wagon to sort
Sorting complete

cid0rz
Long Handed Inserter
Long Handed Inserter
Posts: 89
Joined: Sun Jul 31, 2016 5:52 pm
Contact:

Re: [0.15] Automatic Coupler

Post by cid0rz »

Hi Vortex,

Very interesting design, very similar to what I have. I think smarter trains can be used to send the locomotive where you want, following a program that could also change the other signals, including the coupling and uncoupling signals. It was to explore more complex logic when sorting and composing new trains. I've used smarter trains to create a system that can deliver trains on demand, calculating number of trains needed, if the stock is available, it resets if it does not find a suitable provider, etc. So i think wit the ability to change your train itinerary by a signal you can build more complex stuff. Nevertheless it is very nice to try to solve this limitation by other means, like your design. I was just asking, I imagine as it gets changed to manual mode and then automatic again, smarter trains take it out of the line (like it does with trains set to manual). I stopped using the decoupling since I got desync errors when playing online with a friend, but this is a functionality that I'd love to have in Facotrio.

laku
Long Handed Inserter
Long Handed Inserter
Posts: 51
Joined: Tue Apr 04, 2017 5:17 am
Contact:

Re: [0.15] Automatic Coupler

Post by laku »

First of all, thank you for this mod :)

I kept thinking for quite a while now, how i would use this mod and finaly made up my mind. So i started looking at your code and changed
line136

Code: Select all

schedule.current = (schedule.current)% #schedule.records + 1
to

Code: Select all

schedule.current = (schedule.current)% #schedule.records
it works with the following train setup, for decoupling = -2
<>CC (<,> are locomotivs showing the direction; C are cargo wagons)

but i dont fully understand it yet

Krazycat2012
Manual Inserter
Manual Inserter
Posts: 4
Joined: Fri Apr 01, 2016 12:48 am
Contact:

Re: [0.15] Automatic Coupler

Post by Krazycat2012 »

I have a question, it seems i can not get a train to go down the same path to pick up the wagons after they are full, and pull them to the drop off zone. the rail signals will not change to green. Any way some one can do a in detail basic set up of this, how to set up the logic that goes with it please.

driver
Long Handed Inserter
Long Handed Inserter
Posts: 58
Joined: Wed Oct 28, 2015 11:24 am
Contact:

Re: [0.15] Automatic Coupler

Post by driver »

There's a nice video featuring the coupler mod in action:
https://www.youtube.com/watch?v=ODg3Eir ... e=youtu.be

Fahrradkette
Inserter
Inserter
Posts: 45
Joined: Thu Aug 27, 2015 4:37 pm
Contact:

Re: [0.15] Automatic Coupler

Post by Fahrradkette »

Is it possible to have hauling trains (locomotives included) being moved by shunter engines? Like saving/restoring the schedule/id of the hauler vial signals?

vortex1967
Inserter
Inserter
Posts: 40
Joined: Fri Apr 15, 2016 8:48 am
Contact:

Re: [0.15] Automatic Coupler

Post by vortex1967 »

Hi all,

Sorry it has taken so long, life got in the way, but here is a map(Factorio version 15.28) with two of my outpost designs set to work in a loop showing what controls and safety measures I have used.
One outpost is for loading the wagons and the other is for unloading the wagons.
Robots are used to transfer items. Currently there are 1000 bots in the network, when you open the map the player is
near a red lamp, Constant Combinator and a steel chest, in the steel chest there is another 2000 bots.
It gets very busy with 3000 bots flying around in such a small area.

There are two mods that are required:
Automatic Coupler by GotLag.(obviously)
and
Inventory Sensor by Optera(without which the detection of wagons and wagon contents breaks)

To start, turn off the Constant Combinator just below the red lamp(near player).
If you turn on the Constant Combinator again after the 3 locomotives have moved, one cycle will be completed and
the 3 locomotives will stop at their current position again.
If you leave the Constant Combinator off the whole thing will run continuously.
Eventually the two problems I have encountered and have described in my previous posts occur.

When using this mod, every couple and uncouple that occurs increases the trains ID by one.
The map I'm playing now, my train ID has just passed 25,000.

Hi Fahrradkette,
I wanted to do this also but currently it's not possible.

Hi Krazycat2012,
Hopefully the map will help.


Edit: removed map download. New version 1.0.1 of mod broke map.

kickbackman1277
Burner Inserter
Burner Inserter
Posts: 15
Joined: Sun Feb 08, 2015 9:14 pm
Contact:

Re: [0.15] Automatic Coupler

Post by kickbackman1277 »

Is there any chance this could be updated for 0.16. I am desperate to try it in my current build. Than you

bitbased
Burner Inserter
Burner Inserter
Posts: 9
Joined: Wed Jul 19, 2017 5:44 pm
Contact:

Re: [0.15] Automatic Coupler

Post by bitbased »

kickbackman1277 wrote:Is there any chance this could be updated for 0.16. I am desperate to try it in my current build. Than you
I haven't tested a full setup yet but seems the only change needed for 0.16 is to set the factorio_version to 0.16 in `info.json` and add `icon_size = 32,` to each signal in `signals.lua`

change info.json

Code: Select all

{
	"name": "Automatic Coupler",
	"version": "1.0.1",
	"title": "Automatic Coupler",
	"author": "Hopewelljnj",
	"homepage": "https://forums.factorio.com/viewtopic.php?f=94&t=48455",
	"description": "Adds signals to allow stations to couple/uncouple trains automatically.",
	"factorio_version": "0.16"
}
change signals.lua

Code: Select all

BLUE_BACKGROUND = "__base__/graphics/icons/signal/shape_square.png"

data:extend({
  {
    type = "item-subgroup",
    name = "couple-signals",
    group = "signals",
    order = "g"
  },
  {
    type = "virtual-signal",
    name = "signal-couple",
    icons =
    {
      {icon = BLUE_BACKGROUND},
      {icon = "__Automatic Coupler__/graphics/signal/couple.png"}
    },
    icon_size = 32,
    subgroup = "couple-signals",
    order = "a-a"
  },
  {
    type = "virtual-signal",
    name = "signal-uncouple",
    icons =
    {
      {icon = BLUE_BACKGROUND},
      {icon = "__Automatic Coupler__/graphics/signal/uncouple.png"}
    },
    icon_size = 32,
    subgroup = "couple-signals",
    order = "a-b"
  }
})

kickbackman1277
Burner Inserter
Burner Inserter
Posts: 15
Joined: Sun Feb 08, 2015 9:14 pm
Contact:

Re: [0.15] Automatic Coupler

Post by kickbackman1277 »

ty. that worked

Post Reply

Return to “Mods”