Page 1 of 1

[kovarex] [0.17.75] Crash placing modified rail wagons

Posted: Tue Nov 05, 2019 6:12 pm
by Muppet9010
I was placing some modified locamotives and cargo wagons in editor mode and the game crashed. They were being placed in a line using the auto connect placement feature. I placed into a train from front heading backwards a loco, wagon and clicked to place a second loco when it happened. I saw the 2nd loco appear in the game and the ghost marker then appeared between the 2nd (back) loco and the cargo wagon when the error occured.
Capture.PNG
Capture.PNG (199.12 KiB) Viewed 1860 times
The modified wagon entity prototype values were:

Code: Select all

local smallLoco = factorioUtil.table.deepcopy(data.raw.locomotive.locomotive)
smallLoco.name = "small_locomotive"
smallLoco.minable.result = "small_locomotive"
smallLoco.collision_box = {{-0.6, -0.7}, {0.6, 0.7}}
smallLoco.selection_box = {{-1, -0.9}, {1, 0.9}}
smallLoco.vertical_selection_shift = -0.5
smallLoco.connection_distance = 2
smallLoco.joint_distance = 1

local smallCargoWagon = factorioUtil.table.deepcopy(data.raw["cargo-wagon"]["cargo-wagon"])
smallCargoWagon.name = "small_cargo_wagon"
smallCargoWagon.minable.result = "small_cargo_wagon"
smallCargoWagon.collision_box = {{-0.6, -1.25}, {0.6, 1.25}}
smallCargoWagon.selection_box = {{-1, -1.4}, {1, 1.4}}
smallCargoWagon.vertical_selection_shift = -0.5
smallCargoWagon.connection_distance = 2
smallCargoWagon.joint_distance = 2


To reproduce
In 0.17.75
Load the mod zip attached: small_trains_17.0.0.zip
Load the save attached: _small loco test a.zip
In editor place a small_locomotive on the horizontal track with it snapping to the station.
Place a small_cargo_wagon behind it, snapping in place.
Place another small_locomotive behind the cargo wagon, snapping to it.
Game errors.

Re: [0.17.75] Game Crash from placing modified rail wagons

Posted: Wed Nov 06, 2019 1:33 pm
by Muppet9010
from antidotal experience this seems to be related to the selection boxes, as if I make them smaller the crash doesn't occur.

Re: [kovarex] [0.17.75] Crash placing modified rail wagons

Posted: Fri Jun 26, 2020 1:51 pm
by kovarex
I can't load the mod.

It is generally not a good idea to try to change the size of the rolling stocks too much.

Re: [kovarex] [0.17.75] Crash placing modified rail wagons

Posted: Fri Jun 26, 2020 4:56 pm
by Muppet9010
I had forgotten this was logged tbh. I gave up on this mod idea shortly after posting this bug due to other game engine limitations relating to non default sized wagons. I never ported the POC mod code in to .18 so no idea if the bug still occurs, but seems pretty pointless now given the wider context.

Re: [kovarex] [0.17.75] Crash placing modified rail wagons

Posted: Sun Jun 28, 2020 8:57 pm
by Muppet9010
Ended up trying this mod concept again and I no longer see an issue with selection boxes that touch/overlap when on corners.
So guess the core issue was fixed in the past 7 months :)