Page 1 of 1

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

Posted: Mon Jul 07, 2025 4:31 am
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

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

Posted: Mon Jul 07, 2025 1:57 pm
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

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

Posted: Tue Jul 08, 2025 4:09 pm
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.

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

Posted: Tue Jul 08, 2025 8:01 pm
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}},