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

Place to ask discuss and request the modding support of Factorio. Don't request mods here.
Post Reply
User avatar
Muppet9010
Filter Inserter
Filter Inserter
Posts: 278
Joined: Sat Dec 09, 2017 6:01 pm
Contact:

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

Post 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.

Pi-C
Smart Inserter
Smart Inserter
Posts: 1647
Joined: Sun Oct 14, 2018 8:13 am
Contact:

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

Post 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()
A good mod deserves a good changelog. Here's a tutorial (WIP) about Factorio's way too strict changelog syntax!

Post Reply

Return to “Modding interface requests”