Page 1 of 1

Problem with closing player gui

Posted: Tue Jan 02, 2018 6:14 pm
by _npo6ka_
The goal: to close the gui mod, if it is open, when the player enters the game.
If a player starts a multiplayer game, then for some players, the on_player_joined_game event is called, but for the player who created this game, this event is not called.
The on_player_create event is called 1 time when the player is created, which also does not solve the task.
The on_load event has no information about the players, so it's also impossible to close the gui.
Tell me your thoughts on this matter...

Re: Problem with closing player gui

Posted: Thu Jan 04, 2018 11:56 pm
by _npo6ka_
up

Re: Problem with closing player gui

Posted: Fri Jan 05, 2018 12:24 am
by Rseding91
What "gui mod" do you want to close?

Re: Problem with closing player gui

Posted: Fri Jan 05, 2018 11:49 am
by _npo6ka_
Rseding91 wrote:What "gui mod" do you want to close?
I create a flow container for my mod and add it to the player's opened gui. Further inside the flow of the container, I have the additional elements necessary inside the mod. While the player is using the gui, autosave occurs. Next, I load the preservation of the game and the gui player remains open, which does not look right.
I would like to close this gui while saving/loading the game or when entering/leaving the player from the game, but so far I have not found an available solution

Re: Problem with closing player gui

Posted: Fri Jan 05, 2018 12:18 pm
by eradicator
The game does not make a difference between "game has just been loaded" and "game has just been saved", it must be deterministically identical in both cases or multiplayer games would desync. Thus what you're trying to do is not something you're supposed to do. Just leave the gui open.