Page 1 of 1

LuaSurface.find_non_colliding_position() and LuaSurface.can_place_entity() to support direction and orientation

Posted: Thu Jun 30, 2022 10:59 pm
by Muppet9010
At present there is no way to find a placement location for either a non north direction or a non 0 orientated entity.
Also you can't check buildability of a non 0 orientated entity.

My example is trying to teleport a player's car at its current orientation. However, I can see finding a placement for a non rotationally symmetrical entity could also be a challenge presently.

So ideally:

- LuaSurface.find_non_colliding_position() - would support direction and orientation being supplied.
- LuaSurface.can_place_entity() - would support orientation being supplied.

Re: LuaSurface.find_non_colliding_position() and LuaSurface.can_place_entity() to support direction and orientation

Posted: Sat Dec 23, 2023 9:51 am
by Pi-C
Muppet9010 wrote:
Thu Jun 30, 2022 10:59 pm
My example is trying to teleport a player's car at its current orientation.
I have a similar issue: A user requested that cars teleported by my mod get the same orientation as the player who ordered the teleporting. I'd need to check whether the car with that orientation could be placed at the requested position.
So ideally:
I'd like to extend this list. Please add orientation to
  • LuaSurface.find_non_colliding_position()
  • LuaSurface.find_non_colliding_position_in_box()
  • LuaSurface.can_place_entity()
  • LuaPlayer.can_place_entity()