[Solved] Does create-entity trigger effect take ghosts into account?

Place to get help with not working mods / modding interface.
User avatar
Fishbus
Inserter
Inserter
Posts: 31
Joined: Sat Sep 28, 2024 8:20 pm
Contact:

[Solved] Does create-entity trigger effect take ghosts into account?

Post by Fishbus »

Heya,

I have a create entity trigger effect that is the result of an enemy attack. It creates an entity where the attack hits.

However, this has a side effect of removing any player ghosts that happen to be on that location.

I'm using the two properties, which I thought may take ghosts into account but with no luck (I still need them so they create the entity around the location if it fails (e.g, hitting a big bunch of walls/turrets).

check_buildability = true,
find_non_colliding_position = true,

Am I missing something here? Or is this one to mark up as a modding interface request/bug?

Cheers
Last edited by Fishbus on Tue Jul 08, 2025 8:01 pm, edited 1 time in total.
Osmo
Long Handed Inserter
Long Handed Inserter
Posts: 88
Joined: Wed Oct 23, 2024 12:08 pm
Contact:

Re: Does create-entity trigger effect take ghosts into account?

Post by Osmo »

By default, creating entites removes colliding ghosts. In some places like LuaSurface.create_entity() there is an option to disable this behaviour, but seems like there isn't on the trigger effect
User avatar
Fishbus
Inserter
Inserter
Posts: 31
Joined: Sat Sep 28, 2024 8:20 pm
Contact:

Re: Does create-entity trigger effect take ghosts into account?

Post by Fishbus »

Darn, I was hoping it'd all be on a trigger effect as I don't want to over rely on control stuff.

Unfortunately you can't even use the layer="ghost" as from looking at it, this is only the check for the initial test, but not the outward radius of re-checks.
User avatar
Fishbus
Inserter
Inserter
Posts: 31
Joined: Sat Sep 28, 2024 8:20 pm
Contact:

Re: Does create-entity trigger effect take ghosts into account?

Post by Fishbus »

I have had help to solve this

The fix was that the created entity should have its collision mask customised/changed to include the ghost layer.

Code: Select all

collision_mask = {layers={item=true, meltable=true, object=true, player=true, water_tile=true, is_object=true, is_lower_object=true, ghost=true}},
Post Reply

Return to “Modding help”