auto-updating .json files - progress...?


So uh... I've hit a bit of a wall. I thought I had a working solution by making a .cfg file with entries like this:

[0000000e]
file_name_extra = pine
auto_update_json = True

This means that for Slot_0000000e, the mod will (...should) automatically load in and update information in riv_rel_pine.json and riv_relparents_pine.json when you start the game, and also update this list when a new sim is born. I've added auto_update_json as a variable there as well so that you can temporarily disable the feature (by directly editing the .cfg file to have False instead of True) without deleting the entry.

I've faced the following issues and I'm not sure how to resolve them:

  • Sometimes the save slot ID isn't set, and it stays at the default value (0). This seems to happen when you go directly into build mode, exit to world select, and then go into live mode after that. I have this set to run when all households and sim infos are loaded, just so that it's grouped together with when the .cfg file is loaded in and the .json file is updated, but it doesn't seem to work here and I have no clue why.
  • Parents aren't automatically added to the .json file when a sim is born, but this sim is still added to the other .json file. I have this set to run when a sim info is created, so I'm assuming the parents are added after. I tried injecting into the code that runs when a parent relbit is added, but this hasn't done anything. The parents will still be added the next time the file is updated though.

I'm working with try/excepts, so if an exception is thrown then I should get the error text for it, but I'm getting no errors... I only know something's going wrong from the results being wrong.

There are a few extra things that I've added/fixed, unrelated to the auto json thing:

  •  the gap-filling part of the code (to find indirect relations where no shared ancestor exists, but there are some ancestors with a relbit) now runs when you're using .json files, so siblings with no parents will show up as siblings, though there is another thing that went wrong with the nibling/pibling connection... I've temporarily set this to just not show a relationship if there's an error for the sake of my sanity, because I spent an entire day trying to find the issue (the error it gave me was just the instance of a sim...).
  • there were some issues with the .json files themselves - exact duplicates weren't being removed, and some sims were marked as culled when they shouldn't have been. riv_clean now removes exact duplicates and 'unculls' sims that have been mistakenly marked as culled
  • the list of sim mini-infos is now cleared if you switch save slots without quitting the game (might be affected by the save slot issues I've mentioned above)

I want to get these bug fixes out but I also don't want to release it when the auto json still isn't working properly...

Get [unsupported] riv_rel - genealogy mod for sims 4

Comments

Log in with itch.io to leave a comment.

gonna comment instead of bothering with a new devlog - there's some autosave feature within EA's code, unimplemented if that's an autosave the way we think of it, that resets the save slot ID to 0 if you loaded in to a lot, went into manage worlds, and loaded in again.

it does give the correct ID if you've loaded in for the first time or if you've saved since you last loaded in - i'm now experimenting with not allowing my variable corresponding to the save slot ID to be set to 0.

potential issue though is whether Slot_00000000.save is a valid slot?