Event for trains manual coupling /consist changes

Place to ask discuss and request the modding support of Factorio. Don't request mods here.
Post Reply
Nexela
Smart Inserter
Smart Inserter
Posts: 1828
Joined: Wed May 25, 2016 11:09 am
Contact:

Event for trains manual coupling /consist changes

Post by Nexela »

Keeping track of trains is hard work. An event that is triggered when a trains consist changes would be a big help.

events.on_train_consist_changed -- Fires whenever a trains consist is changed
event.trains -- Array of new trains (for adding it would have just the "new" train, for removing it would contain both new trains)
event.player_index -- The player who changed the trains

Would fire for manual coupling/decoupling as well as after building a locomotive/cargo-wagon

Even if it just fired for manual coupling/decoupling would be a great benifit.

Thanks!

KatherineOfSky
Fast Inserter
Fast Inserter
Posts: 124
Joined: Wed Mar 30, 2016 7:54 pm
Contact:

Re: Event for trains manual coupling /consist changes

Post by KatherineOfSky »

+1
Tutorials, wild playthroughs, and more! https://www.youtube.com/@KatherineOfSky

Rseding91
Factorio Staff
Factorio Staff
Posts: 13248
Joined: Wed Jun 11, 2014 5:23 am
Contact:

Re: Event for trains manual coupling /consist changes

Post by Rseding91 »

I already added an event when a train is created for 0.15 which will fire when any of these things happen due to how trains work.

It doesn't contain the player that did it but that information isn't known by the trains or train system anyway so it's not available for any events.
If you want to get ahold of me I'm almost always on Discord.

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

Re: Event for trains manual coupling /consist changes

Post by Nexela »

Is there anything you haven't done yet! Thanks and Looking forward to .15

User avatar
Optera
Smart Inserter
Smart Inserter
Posts: 2919
Joined: Sat Jun 11, 2016 6:41 am
Contact:

Re: Event for trains manual coupling /consist changes

Post by Optera »

Patch notes for 0.15 will be huge. I hope I won't overlook events that would make life much easier. :)

Post Reply

Return to “Modding interface requests”