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

Place to get help with not working mods / modding interface.
Post Reply
NoQ
Inserter
Inserter
Posts: 46
Joined: Mon Jan 09, 2017 2:01 pm
Contact:

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

Post 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 316 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.
Last edited by NoQ on Mon Jan 18, 2021 5:36 am, edited 1 time in total.

NoQ
Inserter
Inserter
Posts: 46
Joined: Mon Jan 09, 2017 2:01 pm
Contact:

Re: Disable the new 1.1 train limit via scripts?

Post by NoQ »

Figured it out: obviously i needed to set trains_limit to 4294967295.

User avatar
boskid
Factorio Staff
Factorio Staff
Posts: 1578
Joined: Thu Dec 14, 2017 6:56 pm
Contact:

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

Post by boskid »

1.1.13:

Code: Select all

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

NoQ
Inserter
Inserter
Posts: 46
Joined: Mon Jan 09, 2017 2:01 pm
Contact:

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

Post by NoQ »

Whoa, amazing, thank you!!

Post Reply

Return to “Modding help”