[Lua API] Max size of entity_filters and tile_filters

Post Reply
User avatar
ickputzdirwech
Filter Inserter
Filter Inserter
Posts: 770
Joined: Sun May 07, 2017 10:16 am
Contact:

[Lua API] Max size of entity_filters and tile_filters

Post 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.
Mods: Shortcuts for 1.1, ick's Sea Block, ick's vanilla tweaks
Tools: Atom language pack
Text quickly seems cold and unfriendly. Be careful how you write and interpret what others have written.
- A reminder for me and all who read what I write

User avatar
DaveMcW
Smart Inserter
Smart Inserter
Posts: 3707
Joined: Tue May 13, 2014 11:06 am
Contact:

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

Post 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.

User avatar
ickputzdirwech
Filter Inserter
Filter Inserter
Posts: 770
Joined: Sun May 07, 2017 10:16 am
Contact:

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

Post 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
Mods: Shortcuts for 1.1, ick's Sea Block, ick's vanilla tweaks
Tools: Atom language pack
Text quickly seems cold and unfriendly. Be careful how you write and interpret what others have written.
- A reminder for me and all who read what I write

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

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

Post 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.
I'm an admin over at https://wiki.factorio.com. Feel free to contact me if there's anything wrong (or right) with it.

Post Reply

Return to “Resolved Requests”