Loupimo / UniversalSwatchSlots

A satisfactory mod that adds new swatches (one for each item in the game) splitted into categories. These swatches comes with default colors depending on the item it correspond to. You can add swatches of your own or modify the existing ones by modifying the JSON file. It also means that you can share swatches between different save game.
GNU General Public License v3.0
0 stars 0 forks source link

Suggestions and a potential bug #2

Open UltraJohn opened 1 week ago

UltraJohn commented 1 week ago

Hi there, nice mod! I really like having the colors of every item available to make themed factories for each item.

I'd like to request compatibility with More swatch slots, and other mod added swatches (structural solutions has one) I'm assuming it is overwriting these due to the swatches being set to the same id?

Bug: I'm not sure if I just did it incorrectly, but when I set the session name in the group named "USS Default - English" I ended up with the swatches in french instead.

Loupimo commented 1 week ago

Hi,

Thanks for the feedback! You're right MMS shares the same IDs than the first swatches of your palette. I think I could easly fix that by setting the starting slot index to the last one used by MMS (but that would only work if Kyrium does not add new static swatch anymore ^^). Same thing goes for all other swatches. I could use a dynamic approach to not overwrite slots but the problem is if you remove one of these mod (MMS or structural solotions) all your swatches will be moved up, messing everything you already have painted.

For your other problem could send me your config file and possibly your save game ? (in a .zip) I have tested both configurations and never had this problem. Anyway if the problem still persist try to delete the french config to see if it changes something.

UltraJohn commented 1 week ago

Well I suppose that's why not many mods incorporate custom swatches. Though it seems like Structural Solutions does it without overwriting anything? Perhaps you could ask the author how he does it.

In the end I think going for the option to dynamically read how many swatches already exist, and then offsetting the id is the best option. I think you shouldn't worry about it messing up when someone uninstalls a mod that can mess up the order. It's generally adviced that you don't uninstall mods during a playthrough because it can cause unforeseeable errors down the line. I would just put this as a disclaimer that it might not be safe to uninstall without side effects. Not that you'd want to do that anyway since the colors will mess up lol.

As for the language, I've tried deleting the french configs using the ingame editor, so there's nothing related to it except the english ones, but it still loads the french names once I purchase it from the shop.

Modland.zip

Here's the savefile. It's saved right before I downloaded the mod, so you can try to reproduce the issue. Do note that I have a bunch of other mods installed, so I've included my SMM profile, which you can import.

Aulberon commented 1 week ago

The same problem happens with me, my swatches are in french. The only thing I changed was the "session name" in the config. Naxumerus.zip

The .zip contains my save, .cfg and SMM profile.

Loupimo commented 1 week ago

Hi, I'm currently building a patch. This patch includes a better compatibility with More Swatch Slot and other mods that add new swatches (using dynamic ID). However please note that it will shift all the IDs and mess up with the buildings you've already painted.

I have also changed things during the loading process which, I hope, will fix your issue. Unfortunately, I was not able to reproduce it even if I load the french config first then save and turn it to english. It always loads the correct configuration...

Loupimo commented 1 week ago

New patch uploaded,

Don't hesitate to tell me if the bug is still there !

UltraJohn commented 1 week ago

Thanks for the update. The swatches are indeed not overwritten anymore, which is great! However I am still getting the french language. I've even tried deleting the cfg to generate a fresh one, and only changing the session name for english, and still french unfortunately.

Loupimo commented 1 week ago

As a last resort you could try to overwrite the french config with the english one using a text editor (just let the palette name unchanged). I will see if I can do something tomorrow or maybe later this week.

Btw could you please check the log file : C:\Users\YourName\AppData\Local\FactoryGame\Saved\Logs\FactoryGame.log And check for the "LogUniversalSwatchSlots" lines (or just upload it here)

UltraJohn commented 1 week ago
[2024.11.19-23.47.28:479][390]LogUniversalSwatchSlots: Display: Find session Modland for palette USS Default - English but doesn not match desired . Ignoring the palette for now.
[2024.11.19-23.47.28:479][390]LogUniversalSwatchSlots: Display: Find session  for palette USS Default - Français. Loading palette.

FactoryGame.log

Loupimo commented 1 week ago

Mmmm Ok it's a blueprint problem. The get session name function failed to retrieve the name and returned an empty string which indeed match the associated session set up in the french configuration. Thx for that, no idea how to fix that for now, I will run some test tomorrow. To fix your problem try with an empty slot in associated session under the USS - Default English. It should work. However, this also means that it will affect every session you load so be careful

Stevoni commented 1 week ago

The session information isn't available for Single Player only session configurations.

Here's the logs from the different session types:

Epic:

[2024.11.20-12.01.19:878][538]LogUniversalSwatchSlots: Display: Find session for palette USS Default - English but doesn not match desired Session Test 2. Ignoring the palette for now. [2024.11.20-12.01.19:878][538]LogUniversalSwatchSlots: Display: Find session for palette USS Default - Français but doesn not match desired Session Test 2. Ignoring the palette for now.

IP:

[2024.11.20-12.05.39:058][864]LogUniversalSwatchSlots: Display: Find session for palette USS Default - English but doesn not match desired Session Test IP. Ignoring the palette for now. [2024.11.20-12.05.39:058][864]LogUniversalSwatchSlots: Display: Find session for palette USS Default - Français but doesn not match desired Session Test IP. Ignoring the palette for now.

Single Player Only:

[2024.11.20-12.06.54:522][844]LogUniversalSwatchSlots: Display: Find session for palette USS Default - English. Loading palette. [2024.11.20-12.07.54:035][243]LogUniversalSwatchSlots: Display: Find session for palette USS Default - English. Loading palette. NOTE: Switching from SPO to Cross Play then launching the customizer via the shortcut caused the game to crash, lol.

Cross Play:

[2024.11.20-12.10.24:938][893]LogUniversalSwatchSlots: Display: Find session for palette USS Default - English but doesn not match desired Session Test IP. Ignoring the palette for now. [2024.11.20-12.10.24:938][893]LogUniversalSwatchSlots: Display: Find session for palette USS Default - Français but doesn not match desired Session Test IP. Ignoring the palette for now.

I'm also noticing a bug here that a default palette isn't select if the session doesn't match any palette. I wonder if it's worth updating the Association for a save when the default is selected?

Also, is there any localization options for the names so a default can be applied based on the current user language?

Loupimo commented 1 week ago

Hi,

Thanks for everything you've shared so far. I'm still working on a patch.

To answer your questions: 1) The "default" palettes are just here to propose an already complete set of swatches and to illustrate how to configuration your own. I designed it to not load anything if the user did not explicitly tell the mod to do so (by filling the associated session / palette array), explaining why there is no default palette loaded. Therefore it is not a bug but a design (a stupid one maybe xD). I did that because it is my first mod and I didn't want to mess up too much with people save in case of problem ^^

2) For the localization question, there is no way (using the default configuration classes proposed by SML) to switch between languages for a configuration file explaining why you have english and french proposed by default. I could probably write some code to produce the matching default palette based on localization but that wasn't my main goal at first. But maybe as a next feature when the mod will be more stable.

houghi commented 1 week ago

What you could do is put the FR one in a different file and have the mod look for the filename. This has the result of the file being way smaller, as well as a lot easier to share. And no issues with loading the wrong info.

Love the mod so far, but will be waiting for the next version.

What would be even better is in-game adding and removal of groups and colours. Because I edited some in a text file and deleted a bit too much. JSON editing is not that easy if you are not used to it. Tiny mistake and you are done. So I lost the two hours I was working on it. (Next time I take a backup first)

Loupimo commented 1 week ago

Hi there,

New version available ! I hope it will solved most of your issue.

Please note that you have already applied will break (like 99% sure) but it should be the last time as I'm saving info about previously loaded swatches now :)

It is not perfect but should allow me to push update without breaking everything you've made so far (I hope so)

Edit: I was not able to reproduce the "not loading bug / loading the wrong conf" bug but I've changed the time at which I'm checking for the session name. I hope it will fix the issue. Please tell me it does or not :)

Loupimo commented 1 week ago

What you could do is put the FR one in a different file and have the mod look for the filename. This has the result of the file being way smaller, as well as a lot easier to share. And no issues with loading the wrong info.

Love the mod so far, but will be waiting for the next version.

What would be even better is in-game adding and removal of groups and colours. Because I edited some in a text file and deleted a bit too much. JSON editing is not that easy if you are not used to it. Tiny mistake and you are done. So I lost the two hours I was working on it. (Next time I take a backup first)

Thanks for this nice idea. I was about to look at creating my own display for the mod configuration. I still don't really how does it work but this is a nice suggestion 👍

houghi commented 1 week ago

Thanks for your work. Unfortunately I see no change. I either get the FR one, even if I put my session name at English version, or I see nothing.

Perhaps a good idea would be to start with 1` language, I assume you are FR native, so do that as a default. And then, when that is working mostly bug free, try adding other languages (or session names). This might simplify bug hunting for you.

And perhaps try with a smaller sample of colors. Having all these colors is a nice feature, but if you have less, it might be easier for people to test. e. just two groups with 8 colors each. And then perhaps some info in the info bar on the side on how and where to do changes.

Again: Thank you for your work. I have been waiting a LONG time for something like this and you are smarter than I am for being able to do it.

Stevoni commented 1 week ago

What you could do is put the FR one in a different file and have the mod look for the filename. This has the result of the file being way smaller, as well as a lot easier to share. And no issues with loading the wrong info. Love the mod so far, but will be waiting for the next version. What would be even better is in-game adding and removal of groups and colours. Because I edited some in a text file and deleted a bit too much. JSON editing is not that easy if you are not used to it. Tiny mistake and you are done. So I lost the two hours I was working on it. (Next time I take a backup first)

Thanks for this nice idea. I was about to look at creating my own display for the mod configuration. I still don't really how does it work but this is a nice suggestion 👍

Looks like I can modify the JSON through the Mods in game menu. I would like to see a color picker though :) image

Loupimo commented 1 week ago

Hi maybe in a next update (I'm currently making my own configuration UI, so I may be able to add color picker :D)

Note that the 1.0.2 is not multiplayer compatible. Only the host can see / use the swatches. Other players should remove empty association to join the game without crashing.