requested items out of bounds

Adds new train stops forming a highly configurable logistic network.

Moderator: Optera

Post Reply
Zanostra
Long Handed Inserter
Long Handed Inserter
Posts: 82
Joined: Mon Apr 03, 2017 8:03 pm
Contact:

requested items out of bounds

Post by Zanostra »

Error while running event LogisticTrainNetwork::on_train_changed_state (ID 23)
Value (2147483648.000000) outside of range. The data type allows values from -2147483648 to 2147483647 in property tree at ROOT[4].count
stack traceback:
__LogisticTrainNetwork__/script/stop-update.lua:508: in function 'UpdateStopOutput'
__LogisticTrainNetwork__/script/train-events.lua:100: in function 'TrainArrives'
__LogisticTrainNetwork__/script/train-events.lua:199: in function <__LogisticTrainNetwork__/script/train-events.lua:195>
stack traceback:
[C]: in function '__newindex'
__LogisticTrainNetwork__/script/stop-update.lua:508: in function 'UpdateStopOutput'
__LogisticTrainNetwork__/script/train-events.lua:100: in function 'TrainArrives'
__LogisticTrainNetwork__/script/train-events.lua:199: in function <__LogisticTrainNetwork__/script/train-events.lua:195>

I have a provider station for landfill, wich use filter inserters, all works well, no problems there.
I drove a train manually, so the train does not get filled automatically, so I added the station in the train shedule.
It only loads landfill if the train gives set filter to the providing station, but I didn't want to calculate, and I wanted the train to be absolutely full, AND not moving after done filling up.
So I set the condition landfill > 13545615313 ( random very very high number ), showing a G.x number, to be sure the condition would never be met, so the train would never leave so I could come there later and the train would be there for me.
I didn't see the timing, but I assume ( since the on_train_changed_state error ) the game crashed when the train arrived at that station.
I think I uploaded the right factorio-current.
Attachments
factorio-current.log
(20.83 KiB) Downloaded 89 times

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

Re: requested items out of bounds

Post by Optera »

Reading through your steps to reproduce it seemed odd this error suddenly popped up now in code that was untouched for over a year.
Turns out the recent ui changes allow for numbers outside 32bit int range, earlier versions would cap positive numbers at 2147483647.

Bilka
Factorio Staff
Factorio Staff
Posts: 3129
Joined: Sat Aug 13, 2016 9:20 am
Contact:

Re: requested items out of bounds

Post by Bilka »

Optera wrote:
Fri Mar 20, 2020 4:57 pm
Reading through your steps to reproduce it seemed odd this error suddenly popped up now in code that was untouched for over a year.
Turns out the recent ui changes now allow for numbers outside 32bit int range, earlier versions would cap positive numbers at 2147483647.
Which GUI is this?
I'm an admin over at https://wiki.factorio.com. Feel free to contact me if there's anything wrong (or right) with it.

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

Re: requested items out of bounds

Post by Optera »

Going by op description that should be Train waiting condition item > n

Edit:
Now i see what happened.... it's a 1 off error from > n while in ltn usually uses >=
I had some really old legacy code in place from a time before we had >= conditions. I guess removing that legacy code will be the cleanest way to fix, since I don't even support directly migrating from such ancient LTN versions.

So it seems no one tried that in the last year. :o

dockmeister
Inserter
Inserter
Posts: 48
Joined: Tue Feb 26, 2019 5:49 pm
Contact:

Re: requested items out of bounds

Post by dockmeister »

I cannot test it right now, but i ran into this a couple month back.

Code: Select all

https://lua-api.factorio.com/latest/LuaControlBehavior.html#LuaConstantCombinatorControlBehavior.set_signal
I think this method is very picky and only accepts signed int 32

Zanostra
Long Handed Inserter
Long Handed Inserter
Posts: 82
Joined: Mon Apr 03, 2017 8:03 pm
Contact:

Re: requested items out of bounds

Post by Zanostra »

:P I'm always doing strange stuff,
but it seems like it is fixed,
I didn't use the exact same train, but I tried all kind of 'out of bound' conditions, and there was no crash anymore. :D

Post Reply

Return to “Logistic Train Network”