[2.0.22] Set filter comparator to 'any quality' (= nil) not possible per lua
Posted: Thu Nov 28, 2024 1:52 pm
If you want to set the comparator of a filter of an inventory slot to 'any quality', which as far as I understand is achieved with the value 'nil' for the comparator, this is not possible. The comparator value 'nil' is overwritten by Factorio with the comparator string '=' when the code is executed.
Code I tried with:
If you copy an ingame set filter via script to another itemslot, then the comparator is transferred correctly.
Code I tried with:
Code: Select all
local myContent = {
name = "iron-plate",
quality = "normal",
comparator = nil
}
local myPlayer = game.get_player(1)
local myInventory = myPlayer.get_main_inventory()
myInventory.set_filter(1, myContent)