I don't understand set_event_filter (1.1.35)

Place to get help with not working mods / modding interface.
User avatar
ZwerOxotnik
Fast Inserter
Fast Inserter
Posts: 115
Joined: Tue Dec 19, 2017 6:58 pm
Contact:

I don't understand set_event_filter (1.1.35)

Post 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.
I make cakes from mods. However, I don't have dough now but you can help me.
Qon
Smart Inserter
Smart Inserter
Posts: 2164
Joined: Thu Mar 17, 2016 6:27 am
Contact:

Re: I don't understand set_event_filter (1.1.35)

Post 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}})
?
My mods: Capsule Ammo | HandyHands - Automatic handcrafting | ChunkyChunks - Configurable Gridlines
Some other creations: Combinassembly Language GitHub w instructions and link to run it in your browser | 0~drain Laser
User avatar
ZwerOxotnik
Fast Inserter
Fast Inserter
Posts: 115
Joined: Tue Dec 19, 2017 6:58 pm
Contact:

Re: I don't understand set_event_filter (1.1.35)

Post by ZwerOxotnik »

Yes, events works fine, but I don't see/notice any filters and their effects
I make cakes from mods. However, I don't have dough now but you can help me.
User avatar
ZwerOxotnik
Fast Inserter
Fast Inserter
Posts: 115
Joined: Tue Dec 19, 2017 6:58 pm
Contact:

Re: I don't understand set_event_filter (1.1.37)

Post by ZwerOxotnik »

I tried it again on 1.1.37 and it seems works fine except script.get_event_filter shows nil
I make cakes from mods. However, I don't have dough now but you can help me.
Post Reply

Return to “Modding help”