Vehicle Wagon 2


Take with you a fully charged and battle-ready vehicle and take it on a rail trip. --------------------------------------------------------------------------------- Возьмите с собой полностью заряженный и готовый к бою транспорт и отправьте его в путешествие по железной дороге.

Content
a day ago
0.17 - 2.0
21.1K
Transportation Trains Combat

g Train changing its ID when loading/unloading vehicles

4 years ago

Hi,

First of all - thanks for a very interesting mod - gave it a quick test, and it's really a nice cool feature for everyone who likes using cars in Factorio (minus all the smashing against production buildings :). I kinda like using cars even once trains become available, but find it a bit of a hassle that it's kinda hard to transport them towards outpots, and this solves that beautifully.

In my case, I was trying the Vehicle Wagon 2 mod in conjunction with Temporary Stations mod (https://mods.factorio.com/mod/QoL-TempStations). The Temporary Stations mod allows you to set a personal train that can be called on-demand. This is done by selecting the train via Train ID.

What I have noticed is that Vehicle Wagon 2 will change the train ID every time a vehicle is loaded/unloaded from a vehicle wagon.

Is it possible to somehow prevent the Vehicle Wagon 2 from changing the train ID, or reset it to original value, or is this an inherent limitation of the Factorio engine itself?

Best regards,
Branko

P.S.
I'll probably poke around in the Temporary Stations mod too to see if the way personal trains are kept track of could be changed in some way, but thought to start off here :)

4 years ago

The Factorio engine assigns a new always-increasing Train ID whenever wagons are placed, destroyed, coupled, or decoupled. This makes in-game use of Train ID limited to trains that never change configuration. Vehicle Wagon 2 has to delete and rebuild wagons whenever the graphics change, which is why the Train ID changes. Compatibility between VW2 and Temporary Stations will have to be done on the Temporary Stations side.

In the mod API, the event "on_train_created" is triggered every time a new Train ID is assigned, and includes the IDs of the train(s) that were combined or decoupled to create the new one. In theory, Temporary Stations could use this to track when the personal train is modified and update its setting. The only complication is when the player uses the "disconnect train" command, where it would have to locate which half has the locomotive or the player (I assume that is what you would want to track).

4 years ago

Hello again, thanks for a fast and detailed response :)

I've had a quick look at the event you mentioned, and seems like it should be doable to keep track of changing train IDs in the Temporary Stations mod. I've contacted the author to see if he would find such change welcome, we'll see where it goes.

I Probably will need to have a look at the disconnect train variant you mentioned, that is something I have not tried in my quick-and-dirty testing attempt (just logging what the event trigger sends back), and I don't think I've used that feature as a player before.

4 years ago

I looked at it and it was suggested to the author two times already. I commented in one of those threads that it would add VW2 compatibility. Not sure why Dockmeister has not implemented it already. He is also having trouble with LTN compatibility apparently, so you might need to fork his (MIT licensed) code to demonstrate it working yourself before he incorporates it.

New response