Page 1 of 1

I don't understand set_event_filter (1.1.35)

Posted: Fri Jul 16, 2021 1:18 pm
by ZwerOxotnik
https://lua-api.factorio.com/1.1.35/Lua ... ent_filter

First off, I don't know understand where it should be. I ask this because I don't get any results except via console.

Re: I don't understand set_event_filter (1.1.35)

Posted: Sat Jul 17, 2021 9:56 am
by Qon
Did you try seomthing like

Code: Select all

script.on_event(defines.events.on_marked_for_deconstruction, function(ev) game.print(game.table_to_json(ev)) end)
-- Lua code is executed from top to bottom, so this will execute after:
script.set_event_filter(defines.events.on_marked_for_deconstruction, {{filter = "ghost", invert = true}})
?

Re: I don't understand set_event_filter (1.1.35)

Posted: Sat Jul 17, 2021 2:11 pm
by ZwerOxotnik
Yes, events works fine, but I don't see/notice any filters and their effects

Re: I don't understand set_event_filter (1.1.37)

Posted: Sun Aug 08, 2021 10:07 am
by ZwerOxotnik
I tried it again on 1.1.37 and it seems works fine except script.get_event_filter shows nil