[Rseding91] [for 0.16] [0.15.x] Mod Settings Menu does not update in SP properly.

We are aware of them, but they have low priority. We have more important things to do. They go here in order not to take space in the main bug thread list.
Post Reply
credomane
Filter Inserter
Filter Inserter
Posts: 278
Joined: Tue Apr 12, 2016 6:21 pm
Contact:

[Rseding91] [for 0.16] [0.15.x] Mod Settings Menu does not update in SP properly.

Post by credomane »

Install this attached example mod.

It adds a per-player setting of each type string, bool, int, double with default values of each.

See this post for correct instructions to replicate this bug. The mod is no longer required.
46146?p=265083#p265083
original and wrong directions to reproduce the issue
Attachments
BrokenModSettings_0.0.1.zip
(2.01 KiB) Downloaded 108 times
Last edited by credomane on Wed May 03, 2017 3:17 am, edited 4 times in total.

Nexela
Smart Inserter
Smart Inserter
Posts: 1828
Joined: Wed May 25, 2016 11:09 am
Contact:

Re: [0.15.x] Changing mod-settings in-game doesn't work.

Post by Nexela »

settings.get_player_settings(player_index) to get the settings for the player

credomane
Filter Inserter
Filter Inserter
Posts: 278
Joined: Tue Apr 12, 2016 6:21 pm
Contact:

Re: [0.15.x] Changing mod-settings in-game doesn't work.

Post by credomane »

Nexela wrote:settings.get_player_settings(player_index) to get the settings for the player
Well that fixed the mod fetching the incorrect value but the mod settings menu is still showing the wrong values while in game. Plus the Options -> Other -> "Use different mod settings per save" checkbox still doesn't appear to actually do anything.

Now the in-game mod settings menu will show one value while the mod will pull an entirely different value from what is displayed.
Attachments
BrokenModSettings_0.0.2.zip
(2.02 KiB) Downloaded 104 times

Nexela
Smart Inserter
Smart Inserter
Posts: 1828
Joined: Wed May 25, 2016 11:09 am
Contact:

Re: [0.15.x] Changing mod-settings in-game doesn't work.

Post by Nexela »

"Use different mod settings per save"

This should use the values you had in the map and overwrite any values set at the main load screen. If any of these values are of the startup type you will be prompted (or forced) to restart Factorio if they are different.



What you see at the main load screen is probably the "defaults" that will used when a world is created. These should be whatever the setting has as default if you didn't change it at the loading scren. Inside the game the player settings will affect the active "player" and not the defaults you see at the load screen.

Nexela
Smart Inserter
Smart Inserter
Posts: 1828
Joined: Wed May 25, 2016 11:09 am
Contact:

Re: [0.15.x] Changing mod-settings in-game doesn't work.

Post by Nexela »

So to sum it up

Global and Player Load screen settings are the "default" used when starting a new map. If you change the player settings here they will only affect NEW worlds. If you change the player settings in game they will not change the load screen settings.

Startup can only be changed outside of world since they require a restart, These are the ones that would sync-with-save otherwise you could load into your world and all your god-modules would be gone :)

credomane
Filter Inserter
Filter Inserter
Posts: 278
Joined: Tue Apr 12, 2016 6:21 pm
Contact:

Re: [0.15.x] Changing mod-settings in-game doesn't work.

Post by credomane »

This still doesn't explain the difference between what the mod says the values are and what the in-game mod settings menu says the values are.

There is certainly a display issue going on.

Nexela
Smart Inserter
Smart Inserter
Posts: 1828
Joined: Wed May 25, 2016 11:09 am
Contact:

Re: [0.15.x] Changing mod-settings in-game doesn't work.

Post by Nexela »

I just tested your mod and the button printed out the correct settings shown in the settings screen every time.

Maybe a video/gif of what it is doing for you?

credomane
Filter Inserter
Filter Inserter
Posts: 278
Joined: Tue Apr 12, 2016 6:21 pm
Contact:

Re: [0.15.x] Changing mod-settings in-game doesn't work.

Post by credomane »

Nexela wrote:I just tested your mod and the button printed out the correct settings shown in the settings screen every time.
That not working was a goof on my part. I've moved on from that now. Now this issue is that the Mod-settings screen isn't updating after you change the values. This is purely an issue with Factorio as the settings are read-only for mods.

load up a saved game.
open the game menu and goto options -> mods -> per player.
change one of the settings.
close mod settings window. don't return to the game
Click mods again to reopen the mod settings window.
Surprise the menu shows the value of the setting before you changed it. however in game the mod will report the value you changed it too.

It was because of this that I didn't realize my earlier goof.

I have noticed that if the autosave triggers THEN the in-game mod settings menu will now show the correct and updated values. However no matter what you change them too they will be stuck showing the wrong values again until the next auto save is triggered.

This is so strange.

I'll try to grab a video for you to explain it better.

credomane
Filter Inserter
Filter Inserter
Posts: 278
Joined: Tue Apr 12, 2016 6:21 pm
Contact:

Re: [0.15.x] Changing mod-settings in-game doesn't work.

Post by credomane »

Apparently I just needed to slow down and not do twelve things at once.
attempting to make the video revealed the issue to me. Sadly my video recording is failing. Keeps crashing or recording nothing at all.
Hopefully these new steps will show the issue for real and what I was doing wrong in my previous explanations.

These steps are working as intended and expected. No issues here. The second set cause the issue.
  1. Load up a save or start a new game.
  2. Open the menu and goto options -> mods -> per player.
  3. change a setting and close the mod settings using the back button.
  4. resume the game.
  5. click button my mod makes and the value you entered will be printed.
Now for the steps I kept doing and not realizing leading to all the confusion that this entire thread is consists of....Ooops. Three cheers for spastic credomane making things difficult. :(
  1. Load up a save or start a new game.
  2. Open the menu and goto options -> mods -> per player.
  3. change a setting and close the mod settings using the back button.
  4. it is critical you do not leave the menus and resume the game!!
  5. Open the mod settings again and go to per player.
  6. The old value is shown and NOT the value you just entered 5 seconds ago.
  7. exiting the mod settings again using the back button without changing anything.
  8. resume the game
  9. click button my mod makes and the "wrong" value you entered will be printed.
It would seem that exiting the mod settings will update the mod setting values correctly; as shown by the first set of steps. However, opening the mod settings menu again before resuming the game will NOT update the mod settings menu with the new values and it will continue to show the now old and outdated values. This can lead to head scratching that is this thread on why and how the mod settings aren't updating in-game.

It gives the menu the appearance of not working at all and was leading to my confusion and inability to explain the problem.

Nexela
Smart Inserter
Smart Inserter
Posts: 1828
Joined: Wed May 25, 2016 11:09 am
Contact:

Re: [0.15.x] Changing mod-settings in-game doesn't work.

Post by Nexela »

I see it now! Might want to edit the original post with the new information and update title :)

I believe it is not updating because in single player the game is "paused" and the event doesn't fire until you resume. In multiplayer the event fires as soon as you hit back.

So in short: In game mod settings screen doesn't update displayed values when settings screen is reopened BEFORE resuming the game in single player.

credomane
Filter Inserter
Filter Inserter
Posts: 278
Joined: Tue Apr 12, 2016 6:21 pm
Contact:

RE:[0.15.x] Mod Settings Menu does not update in SP properly

Post by credomane »

Nexela wrote:I see it now! Might want to edit the original post with the new information and update title :)

I believe it is not updating because in single player the game is "paused" and the event doesn't fire until you resume. In multiplayer the event fires as soon as you hit back.

So in short: In game mod settings screen doesn't update displayed values when settings screen is reopened BEFORE resuming the game in single player.
Thank goodness. I was getting so frustrated that I could replicate it every time with extreme precision but you could not. I left out a step here in this thread. *bangs head on desk* Sorry for all of that confusion. I updated the title you have a suggestion for a better title than that?

You are right.
In MP the mod menu updates the moment you hit the back button. Reopening it shows the new and correct values.
In SP the mod menu does NOT update until you exit the menus and resume the game. Only then will reopening the mod menu update with the new and correct values. Failing to resume the game before opening the mod settings again revert the settings to the old values.

Rseding91
Factorio Staff
Factorio Staff
Posts: 13219
Joined: Wed Jun 11, 2014 5:23 am
Contact:

Re: [0.15.x] Mod Settings Menu does not update in SP properly.

Post by Rseding91 »

At the moment this is how it has to work because going into the menu in single player pauses processing any changes to the game state.

I'll think about ways to make the GUI visually show as if the changes already applied to the paused game but for now you'll simply need to go back to the game and un-pause before the settings will be updated.
If you want to get ahold of me I'm almost always on Discord.

credomane
Filter Inserter
Filter Inserter
Posts: 278
Joined: Tue Apr 12, 2016 6:21 pm
Contact:

Re: [Rseding91] [0.15.x] Mod Settings Menu does not update in SP properly.

Post by credomane »

I don't know how hard it would be to implement but here is my idea.
  1. When the mod setting dialog is opened have the engine create an internal mod-settings-pending table and copy the mod settings current game state to the pending table IF AND ONLY IF the pending table is nil.
  2. Have the mod settings dialog show the settings of the pending table.
  3. Have the mod settings dialog only save settings to the pending table.
  4. When the game engine is going to fire the mod-settings-changed event have it move the mod-settings-pending back into the real mod-settings table. Then set mod-settings-pending to nil again.
  5. Actually fire the mod-settings-changed event.
This should still allow the system to work as it currently does in multiplayer without issues. Needs another set of eyes and testing. While also allowing singleplayer to function in what I believe is to be the expected way.

Post Reply

Return to “Minor issues”