Implement LuaEntity.teleport for all building types

Place to ask discuss and request the modding support of Factorio. Don't request mods here.
Post Reply
jimrandomh
Manual Inserter
Manual Inserter
Posts: 3
Joined: Sat Aug 12, 2017 10:20 pm
Contact:

Implement LuaEntity.teleport for all building types

Post by jimrandomh »

Attempting to add factory-building rotation to Factorissimo2. Factorissimo2 is a mod which lets you place factory buildings that are bigger on the inside than on the outside. Rotation would mean that you could stand outside a factory building, press Rotate on the building, and all the buildings and items inside would reposition themselves so that the whole interior was rotated 90 degrees. LuaEntity.teleport(position) can be used to move most buildings, but it can't be used to move transport belts, underground belts, or storage tanks; if you try to teleport any of these types it will return fail. While it is possible in principle to work around this by destroying and recreating buildings, in practice this leads into a minor rabbit hole of special cases, since many buildings have complex state and shouldn't be recreated this way.

So, my interface request is: make all buildings (including these) able to be teleported within the same plane.

Underground belts are a tricky case, because if you teleport one side but not the other, it breaks the connection and any items that were in the belt need to go somewhere. Requiring that an underground belt be empty before teleporting either end of it would be acceptable, as long as there's a way to programmatically empty it and a way to programmatically refill it.

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

Re: Implement LuaEntity.teleport for all building types

Post by Rseding91 »

jimrandomh wrote:... in practice this leads into a minor rabbit hole of special cases ...
That's why we haven't done it on the C++ side as well :P
If you want to get ahold of me I'm almost always on Discord.

Post Reply

Return to “Modding interface requests”