tl;dr I want entity.teleport to allow for cross-surface teleportation on (basically) all entities. I'm fine with leaving transport lines out of this conversation.
Compound entities are, well, compound, and having to deconstruct and reconstruct them piecewise whenever they are teleported can become both cumbersome and prevent certain features from working properly without massive headaches. I'd like to be able to teleport these entities regardless, so that a mod with compound entities can hook onto that event and just update the entity's surface and/or location.
Cross-surface teleport support for other entities
-
- Filter Inserter
- Posts: 276
- Joined: Fri Sep 09, 2022 4:33 pm
- Contact:
Cross-surface teleport support for other entities
If you need to reach me, message me on discord.
I make qol mods. Check them out, maybe.
https://mods.factorio.com/user/protocol_1903
If you have a mod idea, I can look into it.
I make qol mods. Check them out, maybe.
https://mods.factorio.com/user/protocol_1903
If you have a mod idea, I can look into it.
Re: Cross-surface teleport support for other entities
Cross surface teleport is riddled with issues on the C++ side as the game needs to invalidate all references to the entity - but not destroy configuration data - and then restore the entity on the other surface. This makes it extremely tedious to implement because it can't be done generically. Every entity that wants to do it has to know it's about to happen, do a bunch of special logic, and then un-do it when moved to the other surface.
If you want to get ahold of me I'm almost always on Discord.
Re: Cross-surface teleport support for other entities
So, what you are saying it's clone_entities and destroying the originals after? Seems to me like it could be a single API method so the entities are unambiguously moved from the script perspective. Consider a uniquely existing entity, e.g. a Factorissimo building. Such entities would benefit from being able to detect the move.Rseding91 wrote: Sun Jul 13, 2025 5:50 pm Cross surface teleport is riddled with issues on the C++ side as the game needs to invalidate all references to the entity - but not destroy configuration data - and then restore the entity on the other surface. This makes it extremely tedious to implement because it can't be done generically. Every entity that wants to do it has to know it's about to happen, do a bunch of special logic, and then un-do it when moved to the other surface.