Page 1 of 1

Event for trains manual coupling /consist changes

Posted: Tue Apr 18, 2017 3:00 am
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!

Re: Event for trains manual coupling /consist changes

Posted: Tue Apr 18, 2017 3:12 am
by KatherineOfSky
+1

Re: Event for trains manual coupling /consist changes

Posted: Tue Apr 18, 2017 8:36 am
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.

Re: Event for trains manual coupling /consist changes

Posted: Tue Apr 18, 2017 10:26 am
by Nexela
Is there anything you haven't done yet! Thanks and Looking forward to .15

Re: Event for trains manual coupling /consist changes

Posted: Tue Apr 18, 2017 10:37 am
by Optera
Patch notes for 0.15 will be huge. I hope I won't overlook events that would make life much easier. :)