Page 1 of 1

[solved] Disable the new 1.1 train limit via scripts?

Posted: Mon Jan 18, 2021 4:43 am
by NoQ
How do I toggle this checkbox via scripts:

2021-01-17-203657_1920x1080_scrot.png
2021-01-17-203657_1920x1080_scrot.png (36.37 KiB) Viewed 1076 times

I can access the number via LuaEntity's trains_limit property but i can't seem to find the property for that corresponds to the checkbox. Passing any number to trains_limit automatically enables this checkbox. Setting trains_limit to 0 does not have the desired effect (the station actually starts accepting at most 0 trains). Setting it to nil results in a type error ("real number expected got nil"). Control behavior's set_trains_limit is a different checkbox.

Re: Disable the new 1.1 train limit via scripts?

Posted: Mon Jan 18, 2021 5:35 am
by NoQ
Figured it out: obviously i needed to set trains_limit to 4294967295.

Re: [solved] Disable the new 1.1 train limit via scripts?

Posted: Mon Jan 18, 2021 10:30 am
by boskid
1.1.13:

Code: Select all

- Writing nil to LuaEntity::trains_limit disables the limit (sets maximum possible value).

Re: [solved] Disable the new 1.1 train limit via scripts?

Posted: Tue Jan 19, 2021 1:10 am
by NoQ
Whoa, amazing, thank you!!