Page 1 of 1

[Lua API] Max size of entity_filters and tile_filters

Posted: Mon Apr 05, 2021 1:00 pm
by ickputzdirwech
I suggest adding "Max. 30 filters." to both entity_filters and tile_filters. People should be aware of that since trying to add more crashes the game.

Re: [Lua API] Max size of entity_filters and tile_filters

Posted: Mon Apr 05, 2021 1:35 pm
by DaveMcW
1. Lua API documentation improvements should be posted in bug reports or modding interface requests.
2. It does not crash the game, it gives a mod error.
3. It does not give an error in data.lua when setting entity_filter_count = 31. The error only occurs in control.lua when trying to set 31 filters.

Re: [Lua API] Max size of entity_filters and tile_filters

Posted: Mon Apr 05, 2021 3:21 pm
by ickputzdirwech
1. Thought it would be the best place for documentation improvements.
2. Sorry for unspecific phrasing.
3. It works if you increase entity_filter_count beforehand. Didn't think of that! Thanks for pointing it out.

The maximum number for entity_filter_count seems to be 255, not 65535 (uint16) however. There is something wrong with the wiki after all :twisted: See https://wiki.factorio.com/Prototype/Dec ... lter_count

Re: [Lua API] Max size of entity_filters and tile_filters

Posted: Mon Apr 12, 2021 1:33 pm
by Bilka
ickputzdirwech wrote:
Mon Apr 05, 2021 3:21 pm
1. Thought it would be the best place for documentation improvements.
It is.
ickputzdirwech wrote:
Mon Apr 05, 2021 3:21 pm
The maximum number for entity_filter_count seems to be 255, not 65535 (uint16) however. There is something wrong with the wiki after all :twisted: See https://wiki.factorio.com/Prototype/Dec ... lter_count
Fixed. The data type is ItemStackIndex (uint16) as already given on the page, but it's manually limited to not be larger than uint8 max.