well ok, i know that we are not supposed to do this, but I had a crash making a stupid call like :
player.teleport( force.get_spawn_position(player.surface) )
on a not connected player in a MP map opened locally by one single player !
in case it could be useful anyway...
see log attached
[0.12.33] teleport deconnected player...
[0.12.33] teleport deconnected player...
- Attachments
-
- factorio-current.log
- (9.3 KiB) Downloaded 135 times
My mods on the Factorio Mod Portal ![Geek :geek:](./images/smilies/icon_e_geek.gif)
![Geek :geek:](./images/smilies/icon_e_geek.gif)
Re: [0.12.33] teleport deconnected player...
Fixed in 0.12.34: LuaPlayer::teleport will do nothing and return false when called on a disconnected player.
Re: [0.12.33] teleport deconnected player...
by the way, it also seems that changing player.character from one surface to another is making problems.
is it normal ?
I mean if entity1 is on surface 1 and entity2 on surface2, if player.character changes from entity1 to entity2 and try to come back to entity1,
the display does not refresh correctly, showing a mix of the 2 surfaces, and sometimes it crashes, but I cannot reproduce it perfectly.
(I tried this with the SubSurface mod, and my Drones mod, that works on changing player.character).
But are we supposed to use this surface thing yet ? Or is it here for future uses ?
is it normal ?
I mean if entity1 is on surface 1 and entity2 on surface2, if player.character changes from entity1 to entity2 and try to come back to entity1,
the display does not refresh correctly, showing a mix of the 2 surfaces, and sometimes it crashes, but I cannot reproduce it perfectly.
(I tried this with the SubSurface mod, and my Drones mod, that works on changing player.character).
But are we supposed to use this surface thing yet ? Or is it here for future uses ?
My mods on the Factorio Mod Portal ![Geek :geek:](./images/smilies/icon_e_geek.gif)
![Geek :geek:](./images/smilies/icon_e_geek.gif)
Re: [0.12.33] teleport deconnected player...
You shouldn't have to make a new character entity for each surface, you can use player.teleport to move between surfacesbinbinhfr wrote:by the way, it also seems that changing player.character from one surface to another is making problems.
is it normal ?
I mean if entity1 is on surface 1 and entity2 on surface2, if player.character changes from entity1 to entity2 and try to come back to entity1,
the display does not refresh correctly, showing a mix of the 2 surfaces, and sometimes it crashes, but I cannot reproduce it perfectly.
(I tried this with the SubSurface mod, and my Drones mod, that works on changing player.character).
But are we supposed to use this surface thing yet ? Or is it here for future uses ?
Re: [0.12.33] teleport deconnected player...
Thx for your answer Klonan and Oxyd.Klonan wrote:You shouldn't have to make a new character entity for each surface, you can use player.teleport to move between surfaces
Yes the simple player.teleport works.
But my Drones mod works on changing character (from a "player" character to a "drone" character having limited potential).
So the teleport works if you are in "player" or in "drone", but when you switch from "player" to "drone" or reverse, and if the 2 entites are not on the same surface, it creates problems.
I tried to work on moving the player, then switching character, then moving back the old entity on its belonging surface, but moving an entity between is not allowed (error message).
By the way, is there a trick to hide/show an entity on a map, because you do not use it temporarly ? (because I thought about sending it to a hidden surface, but it is not accepted).
I'd like to use this for switching from a character-entity to another, hidding the unused entity but not losing it (to keep all its inventory contents, weapons, etc...)
And thx for your great game. Lot of fun playing but also modding !
![Wink ;)](./images/smilies/icon_e_wink.gif)
My mods on the Factorio Mod Portal ![Geek :geek:](./images/smilies/icon_e_geek.gif)
![Geek :geek:](./images/smilies/icon_e_geek.gif)