Don't clear entities when calling set_tiles
Don't clear entities when calling set_tiles
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
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.
If you don't want your entities to be deleted don't make them collide with the tile type you're putting under them.
If you want to get ahold of me I'm almost always on Discord.
Re: Don't clear entities when calling set_tiles
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
You could move them away, set the tile, then move them back.
Re: Don't clear entities when calling set_tiles
That is exactly what I did
Thanks anyway <3
Thanks anyway <3
Re: Don't clear entities when calling set_tiles
This was added at some point, https://lua-api.factorio.com/latest/Lua ... .set_tiles - remove_colliding_entities parameter
I'm an admin over at https://wiki.factorio.com. Feel free to contact me if there's anything wrong (or right) with it.