Hi there! You are currently browsing as a guest. Why not create an account? Then you get less ads, can thank creators, post feedback, keep a list of your favourites, and more!
Test Subject
Original Poster
#1 Old 13th Oct 2017 at 2:16 PM
Reloading of resources/xml while sims 4 is running
As i try to develop my mod Bedwetting for everyone i often find myself cursing about the amount of problems that have nothing to do with program language or thing that could be solved by better reading a documentation. They are just there and you have to learn from them to mod sims 4. That leads not only to long hours of debuging and changing of code, but also a very high amount of restarts of sims 4.

To fix some problems with xml for example i had to restart sims 4 about 8 times just to find out that "looping_animation" stopps any other interaction with "looping_animation" to be executed, even if the animations could be executed at the same time in theory.
The final solution was to use "canonical_animation" instad, who knew? By the way, this bug stopps toddlers from wetting diapers while napping on chair/floor/couch. The action is triggert, but the wetting itself "waits" until the toddler wakes up again, because the sleeping animation blocks the other one. It's a bug in the core (original) game too^^

Anyway, it's not even about the debuging time, but about the 8 restarts that need about 4 minutes each. With python code i can use a reload call that reloads the python code, but in case of xml i can not get it done.

What i have found so far:

Code:
core_services.py:
def file_change_manager():
    global _file_change_manager
    if paths.SUPPORT_RELOADING_RESOURCES:
        return _file_change_manager
    raise RuntimeError('The FileChangeService is not available')

tuning_commands.py:
def tuning_reload(_connection=None):
    if not paths.SUPPORT_RELOADING_RESOURCES:
        sims4.commands.output('Tuning reloading requires the --enable_tuning_reload flag.', _connection)
        return False
    else:
        sims4.callback_utils.invoke_callbacks(sims4.callback_utils.CallbackEvent.TUNING_CODE_RELOAD)
        done = set()
        dependents = set()
        ...

path.py
line 31: SUPPORT_RELOADING_RESOURCES = False
line 108: # global SUPPORT_RELOADING_RESOURCES ## Warning: Unused global


I tried to use the "-enable_tuning_reload" flag on starting the game, but that did not work. Has anyone got that working or other ideas how i can improve the time i need for debugging?
Advertisement
Instructor
#2 Old 14th Oct 2017 at 5:45 AM
Have you seen this ? Link
Quote: Originally posted by Proximitron
As i try to develop my mod Bedwetting for everyone i often find myself cursing about the amount of problems that have nothing to do with program language or thing that could be solved by better reading a documentation. They are just there and you have to learn from them to mod sims 4. That leads not only to long hours of debuging and changing of code, but also a very high amount of restarts of sims 4.

To fix some problems with xml for example i had to restart sims 4 about 8 times just to find out that "looping_animation" stopps any other interaction with "looping_animation" to be executed, even if the animations could be executed at the same time in theory.
The final solution was to use "canonical_animation" instad, who knew? By the way, this bug stopps toddlers from wetting diapers while napping on chair/floor/couch. The action is triggert, but the wetting itself "waits" until the toddler wakes up again, because the sleeping animation blocks the other one. It's a bug in the core (original) game too^^

Anyway, it's not even about the debuging time, but about the 8 restarts that need about 4 minutes each. With python code i can use a reload call that reloads the python code, but in case of xml i can not get it done.

What i have found so far:

Code:
core_services.py:
def file_change_manager():
    global _file_change_manager
    if paths.SUPPORT_RELOADING_RESOURCES:
        return _file_change_manager
    raise RuntimeError('The FileChangeService is not available')

tuning_commands.py:
def tuning_reload(_connection=None):
    if not paths.SUPPORT_RELOADING_RESOURCES:
        sims4.commands.output('Tuning reloading requires the --enable_tuning_reload flag.', _connection)
        return False
    else:
        sims4.callback_utils.invoke_callbacks(sims4.callback_utils.CallbackEvent.TUNING_CODE_RELOAD)
        done = set()
        dependents = set()
        ...

path.py
line 31: SUPPORT_RELOADING_RESOURCES = False
line 108: # global SUPPORT_RELOADING_RESOURCES ## Warning: Unused global


I tried to use the "-enable_tuning_reload" flag on starting the game, but that did not work. Has anyone got that working or other ideas how i can improve the time i need for debugging?
Test Subject
Original Poster
#3 Old 14th Oct 2017 at 1:19 PM
Thats... a bit more complicated then i expected, but it looks like it could work great after some try and error. Thank you
Deceased
#4 Old 13th Jul 2018 at 9:08 AM
There is - or at least WAS - a way to have XML reload automatically when the file changes. I was actually looking to find that information, but found this thread instead. Inspector won't help with that.

I remember you had to put the raw XML file named using the TGI key format, but can't remember if you had to put it in a specific folder, what file extension it should have, and I think there was a command line option you had to pass the game to enable it. If I find it, I'll put a link to it here. Hope it still works. In the process of writing a new tuning class and yeah having to reload the game every time something doesn't work quite right is very time consuming.
Deceased
#5 Old 13th Jul 2018 at 9:12 AM Last edited by scumbumbo : 13th Jul 2018 at 9:40 AM.
Found it... Hope it still works!

http://modthesims.info/showthread.php?t=535393

ETA - It appears to no longer be functional. My guess is that this was removed when, or before, they moved to the combined binary tuning format for the game.

ETA #2 - It does still work... but will the reload work if I change one of the files???

ETA #3 - No, it does not appear to auto-reload when the file is updated.

Still, I guess it does save me from having to edit the XML in a .package, can just edit the XML in that folder.
Back to top