...and breaks the others. While it may be intended for reasons unknown, it certainly hinders the modding.
Teleport() resets orientation/direction of some entities (car, player), if someone wanted to reset the entity's orientation he would either set it explicitly or recreate the entity.
Another problem is that teleport would do strange things to other entities, inserts after teleporting off-grid look like abomination, I guess it should snap entities to the grid unless that have "off-grid" flag, like createentity() does. But it workaround-able by recreating said inserter.
Writable "orientation" property of entities that support precise orientation control is an alternative to fixing teleport in case of car/player.
Right now it's not exactly easy to set car's orientation to precise 0.23611 and place that car in a set position with great precision without functional teleport or writable "orientation".
[0.10.3] Teleport() resets orientation of some entities...
[0.10.3] Teleport() resets orientation of some entities...
- Attachments
-
- "There was an old lady who swallowed a fly, perhaps she'll die."
- teleported-inserter.png (395.92 KiB) Viewed 8358 times
Re: [0.10.3] Teleport() resets orientation of some entities.
Teleport does indeed do strange things. Some more examples:
- ItemStacks stop being affected by transport belts.
- Trains only teleport when standing still and snap back to their old location when they start moving.
- ItemStacks stop being affected by transport belts.
- Trains only teleport when standing still and snap back to their old location when they start moving.
My mods: Red Alert Harvesters - Clean Pipes - Filtered Splitters
-
- Filter Inserter
- Posts: 402
- Joined: Fri May 23, 2014 8:54 am
- Contact:
Re: [0.10.3] Teleport() resets orientation of some entities.
Teleport does not update network connections either. If you teleport a power pole or a roboport it will remain connected as it if was still in its original position. This is also true for things that draw power, If you teleport an electric furnace to a point outside the power network it will remain connected to the original power source.
Re: [0.10.3] Teleport() resets orientation of some entities.
Bug that teleport resets entity orientation will be fixed in 0.10.4. In 0.10.4 it will also be possibel to change the car orientation manually via the existing Lua API (i.e. car.orientation = 0.21). The rest (oddities when using it for electric pole, etc.) is bit more tricky to fix for now.
Details: Teleport is a very old function not used that much in the actual Factorio code. At the moment it is used only for internal code in the inserter (to teleport the item into inserter hand). Originally it was designed to teleport the player to a starting location after he died (we had that). It should be safe to use with simple entities but things that require non-trivial interaction with its environment (i.e. roboport, electric network members) will just not work (do strange stuff) as @JamesOFarrell correctly mentioned. We will look into this, but for now it is rather a minor issue.
Details: Teleport is a very old function not used that much in the actual Factorio code. At the moment it is used only for internal code in the inserter (to teleport the item into inserter hand). Originally it was designed to teleport the player to a starting location after he died (we had that). It should be safe to use with simple entities but things that require non-trivial interaction with its environment (i.e. roboport, electric network members) will just not work (do strange stuff) as @JamesOFarrell correctly mentioned. We will look into this, but for now it is rather a minor issue.
Re: [0.10.3] Teleport() resets orientation of some entities.
Thanks, I can throw away my per-tick rotation code thenslpwnd wrote:Bug that teleport resets entity orientation will be fixed in 0.10.4. In 0.10.4 it will also be possibel to change the car orientation manually via the existing Lua API (i.e. car.orientation = 0.21).