Page 1 of 1

LuaEntity teleport

Posted: Sat Jun 25, 2016 5:47 am
by Simcra
Currently, the LuaEntity teleport function only works for players when used to teleport an entity to another surface, the workaround is to create an entity of the same type on the other surface, copy data from the old entity and then delete the old entity. This creates a large portion of extra work that must be done for the entity to be "teleported". For example, each item in an inventory of an entity must be added to the teleported entity, the more items an entity contains, the more work that must be done for it to be "teleported". In addition to the extra work required, it is also entirely possible that some data may not be able to be copied at all or other mods break due to having stored references to the old entities which are destroyed.

Re: LuaEntity teleport

Posted: Sat Jun 25, 2016 7:04 am
by Rseding91
Simcra wrote:This creates a large portion of extra work that must be done for the entity to be "teleported".
Yes, that's the same and more work we'd need to do to make teleporting all entities between surfaces work which is why I didn't do it when making just the player teleportable between surfaces. Some of that is planned but not for 0.13 because it would introduce so many bugs for the little gains.

Re: LuaEntity teleport

Posted: Wed Dec 21, 2016 9:40 pm
by darkfrei
Rseding91 wrote:
Simcra wrote:This creates a large portion of extra work that must be done for the entity to be "teleported".
Yes, that's the same and more work we'd need to do to make teleporting all entities between surfaces work which is why I didn't do it when making just the player teleportable between surfaces. Some of that is planned but not for 0.13 because it would introduce so many bugs for the little gains.
But for 0.15?

Re: LuaEntity teleport

Posted: Wed Dec 21, 2016 9:59 pm
by Rseding91
darkfrei wrote:
Rseding91 wrote:
Simcra wrote:This creates a large portion of extra work that must be done for the entity to be "teleported".
Yes, that's the same and more work we'd need to do to make teleporting all entities between surfaces work which is why I didn't do it when making just the player teleportable between surfaces. Some of that is planned but not for 0.13 because it would introduce so many bugs for the little gains.
But for 0.15?
Do you have specific entities in mind? I could do a few but I'm not going to attempt to do them all as it would take too much time for very little gains.

Re: LuaEntity teleport

Posted: Thu Dec 22, 2016 10:52 am
by Earendel
+ Player/Character, Car, Unit, and the train sections.

Re: LuaEntity teleport

Posted: Thu Dec 22, 2016 5:24 pm
by Rseding91
Earendel wrote:+ Player/Character, Car, Unit, and the train sections.
The car sounds reasonable. The unit entity just isn't going to happen and trains can't be teleported anyway so between surfaces isn't going to happen.

Re: LuaEntity teleport

Posted: Thu Dec 22, 2016 6:49 pm
by darkfrei
Rseding91 wrote:
Earendel wrote:+ Player/Character, Car, Unit, and the train sections.
The car sounds reasonable. The unit entity just isn't going to happen and trains can't be teleported anyway so between surfaces isn't going to happen.
It means, we can't build some "underground" railway stations like in factorissimo mod?