Page 1 of 1

Is there a way to force connection_distance update?

Posted: Tue Apr 12, 2016 9:34 pm
by Jackalope_Gaming
I have made a mod (The 8L Train Project) that changes the connection_distance and joint_distance of train entities. The main problem with this is when it's loaded into a game that already has trains placed down, those values do not update until the entity is picked up and placed down again. The collision_box and such do update however, and this causes such problems as shown at https://cloud.githubusercontent.com/ass ... 4fbff6.png where the train turns and the collision boxes between the loco and the wagon behind it crash into each other.

Is there a command, script, or some other way to force the game to update the connection_distance and expand the trains out so it doesn't have to manually be done for every single one?

Re: Is there a way to force connection_distance update?

Posted: Wed Apr 13, 2016 5:18 pm
by Adil
I can only come up with finding, destroying and respawning each train in the game. (Well, and a fancy idea of checking trains during the on_train_changed_state event.)

Re: Is there a way to force connection_distance update?

Posted: Thu Apr 14, 2016 10:12 pm
by Jackalope_Gaming
Destroying the trains and respawning them might be a nuclear option. The big issue with that is going to be the items inside the trains getting destroyed, meaning locos won't have fuel and wagons would lose potentially very valuable items.

Would using a data-updates.lua file work? I'd have to learn how to set that up, but it shouldn't take long.