Charles445 / SimpleDifficulty

Difficulty mod based on Tough as Nails
MIT License
14 stars 9 forks source link

How come the custom temperature .json files randomly re-organize themselves? #26

Open vizthex123 opened 3 years ago

vizthex123 commented 3 years ago

I have armour sets grouped together so they're easier to find, but whenever the game loads it just re-organizes them for no reason.

It does at least change the values, but it's quite irksome that it ruins my groupings.

Charles445 commented 3 years ago

Annoyingly the JSON format is unordered, so it screws with the order of stuff If you're editing the files with notepad and not using the ingame commands, you can set the JSON files to read-only and that should stop them shuffling about

vizthex123 commented 3 years ago

Very odd...I've never had a mod that uses json do this before.

Charles445 commented 3 years ago

Really? If you know of a mod that doesn't shuffle things around I'd love to know about it so I can learn from how they did it.

edit: my initial guess is that other mods only make the json file once, and don't keep updating it my mod will read the json, then write it again for mod compatibility reasons (hence why you might need to set it to read only)

vizthex123 commented 3 years ago

Really? If you know of a mod that doesn't shuffle things around I'd love to know about it so I can learn from how they did it.

edit: my initial guess is that other mods only make the json file once, and don't keep updating it my mod will read the json, then write it again for mod compatibility reasons (hence why you might need to set it to read only)

Well, there's FTGU, Dropt, Lore Expansion, and more.

Those are the main ones I use though, and the files stay the way I make them.

Could you perhaps make it not write the file again? Maybe print errors in chat/the log if something goes wrong?