[0.12.33] teleport deconnected player...

This subforum contains all the issues which we already resolved.
Post Reply
User avatar
binbinhfr
Smart Inserter
Smart Inserter
Posts: 1524
Joined: Sat Feb 27, 2016 7:37 pm
Contact:

[0.12.33] teleport deconnected player...

Post by binbinhfr »

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
Attachments
factorio-current.log
(9.3 KiB) Downloaded 96 times
My mods on the Factorio Mod Portal :geek:

Oxyd
Former Staff
Former Staff
Posts: 1428
Joined: Thu May 07, 2015 8:42 am
Contact:

Re: [0.12.33] teleport deconnected player...

Post by Oxyd »

Fixed in 0.12.34: LuaPlayer::teleport will do nothing and return false when called on a disconnected player.

User avatar
binbinhfr
Smart Inserter
Smart Inserter
Posts: 1524
Joined: Sat Feb 27, 2016 7:37 pm
Contact:

Re: [0.12.33] teleport deconnected player...

Post by binbinhfr »

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 ?
My mods on the Factorio Mod Portal :geek:

User avatar
Klonan
Factorio Staff
Factorio Staff
Posts: 5148
Joined: Sun Jan 11, 2015 2:09 pm
Contact:

Re: [0.12.33] teleport deconnected player...

Post by Klonan »

binbinhfr 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 ?
You shouldn't have to make a new character entity for each surface, you can use player.teleport to move between surfaces

User avatar
binbinhfr
Smart Inserter
Smart Inserter
Posts: 1524
Joined: Sat Feb 27, 2016 7:37 pm
Contact:

Re: [0.12.33] teleport deconnected player...

Post by binbinhfr »

Klonan wrote:You shouldn't have to make a new character entity for each surface, you can use player.teleport to move between surfaces
Thx for your answer Klonan and Oxyd.

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 ! ;)
My mods on the Factorio Mod Portal :geek:

Post Reply

Return to “Resolved Problems and Bugs”