[0.10.3] Teleport() resets orientation of some entities...

This subforum contains all the issues which we already resolved.
Dark
Long Handed Inserter
Long Handed Inserter
Posts: 83
Joined: Wed May 07, 2014 12:45 pm
Contact:

[0.10.3] Teleport() resets orientation of some entities...

Post by Dark »

...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".
Attachments
"There was an old lady who swallowed a fly, perhaps she'll die."
"There was an old lady who swallowed a fly, perhaps she'll die."
teleported-inserter.png (395.92 KiB) Viewed 8351 times
User avatar
ThaPear
Fast Inserter
Fast Inserter
Posts: 226
Joined: Fri May 30, 2014 8:05 am
Contact:

Re: [0.10.3] Teleport() resets orientation of some entities.

Post by ThaPear »

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.
JamesOFarrell
Filter Inserter
Filter Inserter
Posts: 402
Joined: Fri May 23, 2014 8:54 am
Contact:

Re: [0.10.3] Teleport() resets orientation of some entities.

Post by JamesOFarrell »

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.
slpwnd
Factorio Staff
Factorio Staff
Posts: 1835
Joined: Sun Feb 03, 2013 2:51 pm
Contact:

Re: [0.10.3] Teleport() resets orientation of some entities.

Post by slpwnd »

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.
Dark
Long Handed Inserter
Long Handed Inserter
Posts: 83
Joined: Wed May 07, 2014 12:45 pm
Contact:

Re: [0.10.3] Teleport() resets orientation of some entities.

Post by Dark »

slpwnd 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).
Thanks, I can throw away my per-tick rotation code then :)
Post Reply

Return to “Resolved Problems and Bugs”