Cars can be teleported between surfaces (because they can contain players), but the spidertron cannot.
.. Why?
Spider-vehicle surface teleport
Re: Spider-vehicle surface teleport
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.
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)
My mods :
Lua API global Variable Viewer (mod portal)
Lua API Event Trace (mod portal)
My tools :
Locale String Editor (github.io webapp)
Re: Spider-vehicle surface teleport
Re: Spider-vehicle surface teleport
Teleporting was, cross-surface teleport hasn't been done (yet).
If you want to get ahold of me I'm almost always on Discord.
Re: Spider-vehicle surface teleport
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.
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.