LuaSurface.can_move_entity()

Place to ask discuss and request the modding support of Factorio. Don't request mods here.
Post Reply
User avatar
Reika
Filter Inserter
Filter Inserter
Posts: 582
Joined: Tue May 19, 2015 1:56 am
Contact:

LuaSurface.can_move_entity()

Post by Reika »

Either taking a deltaX, deltaY, a position, optionally either, or anything else. Basically like can_place_entity but not failing on self-collision. This also allows checking if an entity can be moved by less than its size without needing to hackily destroy and recreate it, or do a find_entities_filtered and check collision masks, entity identity, et cetera, which is comparatively unperformant.
Image

Rseding91
Factorio Staff
Factorio Staff
Posts: 13218
Joined: Wed Jun 11, 2014 5:23 am
Contact:

Re: LuaSurface.can_move_entity()

Post by Rseding91 »

There's currently no mechanic to do this with every entity type in the game as the base game has only ever needed it for a select few entities. Things like ghost entities where they don't collide with other entities in most cases but can in some very specific ones just aren't handled right now because it was never needed.

This does sound like a useful thing to have but I'm not sure when someone would work on adding support for it.
If you want to get ahold of me I'm almost always on Discord.

Post Reply

Return to “Modding interface requests”