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...
Problem with closing player gui
Re: Problem with closing player gui
What "gui mod" do you want to close?
If you want to get ahold of me I'm almost always on Discord.
Re: Problem with closing player gui
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.Rseding91 wrote:What "gui mod" do you want to close?
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
- eradicator
- Smart Inserter
- Posts: 5211
- Joined: Tue Jul 12, 2016 9:03 am
- Contact:
Re: Problem with closing player gui
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.
Author of: Belt Planner, Hand Crank Generator, Screenshot Maker, /sudo and more.
Mod support languages: 日本語, Deutsch, English
My code in the post above is dedicated to the public domain under CC0.
Mod support languages: 日本語, Deutsch, English
My code in the post above is dedicated to the public domain under CC0.