Spider-vehicle surface teleport

Place to ask discuss and request the modding support of Factorio. Don't request mods here.
Post Reply
PyroFire
Filter Inserter
Filter Inserter
Posts: 356
Joined: Tue Mar 08, 2016 8:18 am
Contact:

Spider-vehicle surface teleport

Post by PyroFire »

Cars can be teleported between surfaces (because they can contain players), but the spidertron cannot.

.. Why?

x2605
Inserter
Inserter
Posts: 41
Joined: Fri Jul 31, 2020 4:08 pm
Contact:

Re: Spider-vehicle surface teleport

Post by x2605 »

Yep. I also don't know why... I guess it is not prepared "yet".

But you may can "teleport" that via

- Check existing spider-vehicles with LuaSurface::find_entities_filtered at around of destination position in destination surface.
- Do LuaSurface::clone_entities for teleporting spider-vehicle.
- Check whether it is successfully cloned finding LuaEntity of it using LuaSurface::find_entities_filtered at destination again and compare with array firstly got. (Because clone_entities function doesn't return any values.)
- Do original_spider.set_driver(nil) or .set_passenger(nil) to eject character from it.
- .destroy() the original_spider.
- Teleport character to position of cloned spider.
- Do cloned_spider.set_driver(player) or .set_passenger(player) to restore.

.unit_number or LuaEntity pointer stored in other variables will not identical to original spider, but you may can register them again after cloning it.
English is not my native language. Sorry for bad English.
My mods :
Lua API global Variable Viewer (mod portal)
Lua API Event Trace (mod portal)
My tools :
Locale String Editor (github.io webapp)

User avatar
boskid
Factorio Staff
Factorio Staff
Posts: 2249
Joined: Thu Dec 14, 2017 6:56 pm
Contact:

Re: Spider-vehicle surface teleport

Post by boskid »

This was already implemented and will be released with 1.1

Rseding91
Factorio Staff
Factorio Staff
Posts: 13209
Joined: Wed Jun 11, 2014 5:23 am
Contact:

Re: Spider-vehicle surface teleport

Post by Rseding91 »

boskid wrote:
Tue Aug 25, 2020 1:33 pm
This was already implemented and will be released with 1.1
Teleporting was, cross-surface teleport hasn't been done (yet).
If you want to get ahold of me I'm almost always on Discord.

User avatar
boskid
Factorio Staff
Factorio Staff
Posts: 2249
Joined: Thu Dec 14, 2017 6:56 pm
Contact:

Re: Spider-vehicle surface teleport

Post by boskid »

Rseding91 wrote:
Tue Aug 25, 2020 2:59 pm
Teleporting was, cross-surface teleport hasn't been done (yet).
My mistake!

PyroFire
Filter Inserter
Filter Inserter
Posts: 356
Joined: Tue Mar 08, 2016 8:18 am
Contact:

Re: Spider-vehicle surface teleport

Post by PyroFire »

Figured as much. It's brand new!
Amazing addition, really changes the end game.

For the moment i just boot players out of their spiderbot and clone like a regular entity which works reasonably.
I could do some tracking to find the cloned bot and re-insert the player but, with spiderbots being a vehicle, they should probably be treated more closely like a car.

Post Reply

Return to “Modding interface requests”