Page 1 of 1

[Solved] "create-entity" Trigger Effect "find_non_colliding_position" to care about ghosts

Posted: Tue Jul 08, 2025 4:18 pm
by Fishbus
Heya,

I have a" create-entity" trigger effect which does this:

Code: Select all

 {
	type = "create-entity",
	entity_name = data.entity_name,
	check_buildability = true,
	find_non_colliding_position  = true,
	non_colliding_search_radius = 3,
	tile_collision_mask  = {layers = {ghost= true} }
}
When this is created near a ghost, it will place on it and remove the ghost. (which is undesired)

Adding the tile collision mask for ghosts doesn't seem to effect the search radius as it will place on a ghost and remove it.

The expected behavior for me would be to not remove/replace the ghost, or at least avoid it altogether (or fail placement - either is fine)

Something along the lines of find_non_colliding_position_use_mask = true, which would mean that when rechecking the position to also use the tile_collision_mask layers when checking the radius.

Cheers

Re: "create-entity" Trigger Effect "find_non_colliding_position" to care about ghosts

Posted: Tue Jul 08, 2025 5:07 pm
by Rseding91
Note the reason it doesn't work how you're asking is: it's using the collision mask from the entity defined in the trigger.

Re: "create-entity" Trigger Effect "find_non_colliding_position" to care about ghosts

Posted: Tue Jul 08, 2025 5:15 pm
by Fishbus
Rseding91 wrote: Tue Jul 08, 2025 5:07 pm Note the reason it doesn't work how you're asking is: it's using the collision mask from the entity defined in the trigger.
Ok that makes a lot of sense. it would use the created entitys collision mask.

Much thanks, I will report back.

Re: "create-entity" Trigger Effect "find_non_colliding_position" to care about ghosts

Posted: Tue Jul 08, 2025 5:28 pm
by Fishbus
Yes that works

Many thanks again!