Impossible to force player to close Remote Control / Map View in LUA script

User avatar
GreenFlagCZ
Burner Inserter
Burner Inserter
Posts: 10
Joined: Sun Sep 12, 2021 8:53 am
Contact:

Impossible to force player to close Remote Control / Map View in LUA script

Post by GreenFlagCZ »

Hello,

Before 2.0 player open the map (M) and if I had cutscene script in my control.lua, the map was automatically closed. This doesnt work right now, because classic map was replaced by remote view. I tryed to use

Code: Select all

player.exit_remote_view()
, but this also doesnt work. Even chatGBT is powerless.

Is there a way how to close player map /remote control in lua script? Thank you.
User avatar
GreenFlagCZ
Burner Inserter
Burner Inserter
Posts: 10
Joined: Sun Sep 12, 2021 8:53 am
Contact:

Re: [2.0.xx] Impossible to force player to close Remote Control / Map View in LUA script

Post by GreenFlagCZ »

Ah, we just solved problem by using

Code: Select all

player.set_controller{ type = defines.controllers.god }
for 1 nanosec. This force player be in "god mode" to close remote view, then he immidietly return to normal state. Also it is possible to do it with teleport player (beware! not a character!).

But these are just workarounds which I am not very happy about...
Rseding91
Factorio Staff
Factorio Staff
Posts: 15803
Joined: Wed Jun 11, 2014 5:23 am
Contact:

Re: Impossible to force player to close Remote Control / Map View in LUA script

Post by Rseding91 »

I've added LuaPlayer::exit_remote_view() for the next release.
If you want to get ahold of me I'm almost always on Discord.
Post Reply

Return to “Implemented mod requests”