Page 1 of 1

New TriggerEffectItem for Creating Pollution

Posted: Sat Jan 10, 2026 12:57 pm
by wagyekk
Hello,

I would like to request a new TriggerEffect - CreatePollutionEffectItem, a TriggerEffectItem with the "create-pollution" type.

Reasoning:
I'm working on a mod that allows item destruction by placing items in liquid tiles, similar to how lava works on Vulcanus (https://mods.factorio.com/mod/dispose-in-liquids). One feature I wanted to add - and which others have already started asking for - is generating pollution from item destruction.

From what I've observed so far, the most convenient way to introduce pollution would be through a tile's trigger effect. Currently, I use default_destroyed_dropped_item_trigger to create a visual effect (CreateParticleTriggerEffectItem), and my idea was to have a new TriggerEffect that would generate pollution.

Since it's safe to assume that item destruction will occur on a large scale, creating events for each item and subscribing to them would be wasteful and would significantly hurt performance. That's why I believe a TriggerEffect would be the appropriate solution here.

Re: New TriggerEffectItem for Creating Pollution

Posted: Sat Jan 10, 2026 9:26 pm
by PennyJim
Affecting pollution via triggers just seems to make sense to me +1

Though I'd type it as "pollute" to keep the possibility of it absorbing pollution instead

Re: New TriggerEffectItem for Creating Pollution

Posted: Tue Apr 28, 2026 6:45 pm
by Rseding91
This will be in 2.1.

Re: New TriggerEffectItem for Creating Pollution

Posted: Fri Jul 03, 2026 1:31 am
by wagyekk
I updated my mod to use the new create-pollution trigger effect when items are disposed of in liquid tiles.

One thing I noticed while testing is that I had to explicitly set:

Code: Select all

{
type = "create-pollution",
amount = ...,
use_entity_from_trigger = false
}
With the default (use_entity_from_trigger = true), the trigger executes (other effects such as create-particle work), but no pollution is created. Setting use_entity_from_trigger = false makes it work as expected.

This is used from TilePrototype.default_destroyed_dropped_item_trigger. The trigger can be caused either by a player dropping an item into water (pressing Z) or by an inserter dropping an item onto a liquid tile, so I was wondering whether there is actually a trigger entity available in this context that could be used for pollution attribution.

Is this the intended behavior, or is there a way to associate the generated pollution with an entity so that it appears in pollution statistics instead of having to fall back to use_entity_from_trigger = false?

For reference, the updated version of the mod is available here:
Dispose in Liquids

Re: New TriggerEffectItem for Creating Pollution

Posted: Fri Jul 03, 2026 3:15 am
by PennyJim
That sounds like you should be defining the entity. Since the trigger fires from a tile, there is no entity to use by default.

The failure to create pollution when it fails to find an entity does sound like a bug, which you should be reporting over in Bug Reports. Although I can see an argument for why it is intended behavior.
If they do say it's intended behavior I'd rather they make it a prototype error, but that sounds like a whole lot of edge cases that's annoying to find and fix so I'm not going to blame them for avoiding that solution.

Re: New TriggerEffectItem for Creating Pollution

Posted: Fri Jul 03, 2026 9:32 pm
by wagyekk
Indeed, I had to set entity explicitly as it will be used in the Pollution statistics. This makes sense in context of my mod where it's always tiles that trigger pollution creation.

So to sum up here are my observations:
  • dying_trigger_effect on trees: use_entity_from_trigger = true works and pollution is attributed to the tree.
  • default_destroyed_dropped_item_trigger: use_entity_from_trigger = true creates no pollution.
  • default_destroyed_dropped_item_trigger + use_entity_from_trigger = false: pollution is created.
  • entity = "tile-proxy" provides a nice entry in Pollution statistics for tiles.
And yeah, I'll open a bug report at least to have a confirmation of whether it's intended behavior or not.