Allow "unit" type to teleport cross-surface

Place to ask discuss and request the modding support of Factorio. Don't request mods here.
heyqule
Long Handed Inserter
Long Handed Inserter
Posts: 61
Joined: Sun Mar 05, 2017 1:35 am
Contact:

Allow "unit" type to teleport cross-surface

Post by heyqule »

https://lua-api.factorio.com/latest/cla ... l#teleport

Only players, cars, and spidertrons can be teleported cross-surface. May you add "unit" type support?

I workaround it by destroying existing unit and recreating with the unit with same health on the other surface. Doing so have other overhead calls for the army count calculations. It would be nice to do that with one teleport() call.
curiosity
Filter Inserter
Filter Inserter
Posts: 471
Joined: Wed Sep 11, 2019 4:13 pm
Contact:

Re: Allow "unit" type to teleport cross-surface

Post by curiosity »

heyqule wrote: Thu Jun 13, 2024 3:42 am I workaround it by destroying existing unit and recreating with the unit with same health on the other surface. Doing so have other overhead calls for the army count calculations. It would be nice to do that with one teleport() call.
You should be able to clone it. This still has overhead, of course, but avoids numerous other issues.
Post Reply

Return to “Modding interface requests”