Page 1 of 1
Don't clear entities when calling set_tiles
Posted: Wed Feb 01, 2017 10:43 pm
by Sirenfal
I have several placable-off-grid entities placed by script, and if I set tiles under them they're deleted. Right now I'm going to just move those entities away and put them back after calling set_tiles, but it'd be nice to have a flag to disable this behavior
Re: Don't clear entities when calling set_tiles
Posted: Wed Feb 01, 2017 11:23 pm
by Rseding91
Entities are cleared only if they collide with the tile: putting water under a building for instance will delete the building.
If you don't want your entities to be deleted don't make them collide with the tile type you're putting under them.
Re: Don't clear entities when calling set_tiles
Posted: Wed Feb 01, 2017 11:30 pm
by Sirenfal
They have to collide because they're placed by a script in a location where players shouldn't be able to place buildings.
Re: Don't clear entities when calling set_tiles
Posted: Fri Feb 03, 2017 2:07 pm
by Earendel
You could move them away, set the tile, then move them back.
Re: Don't clear entities when calling set_tiles
Posted: Fri Feb 03, 2017 6:54 pm
by Sirenfal
That is exactly what I did
Thanks anyway <3
Re: Don't clear entities when calling set_tiles
Posted: Tue Sep 01, 2020 8:28 am
by Bilka
This was added at some point,
https://lua-api.factorio.com/latest/Lua ... .set_tiles - remove_colliding_entities parameter