xNul / palworld-host-save-fix

Fixes the bug which forces a player to create a new character when they already have a save. Useful for migrating maps from co-op to dedicated servers and from one dedicated server to another.
MIT License
886 stars 65 forks source link

Unable to find attribute on up-to-date dedicated save #144

Closed dankozlowski closed 4 months ago

dankozlowski commented 5 months ago

When running the tool against a current save from a dedicated linux server, I get the following error:

3E85000000000000000000000000.sav (type: 49) converted to JSON successfully
Done!
Parsing JSON files...Done!
Modifying JSON save data...Traceback (most recent call last):
  File "C:\Users\dakoz\OneDrive\Documents\PalWorld\palworld-host-save-fix-main\fix-host-save.py", line 276, in <module>
    main()
  File "C:\Users\dakoz\OneDrive\Documents\PalWorld\palworld-host-save-fix-main\fix-host-save.py", line 122, in main
    instance_ids_len = len(level_json["root"]["properties"]["worldSaveData"]["Struct"]["value"]["Struct"]["CharacterSaveParameterMap"]["Map"]["value"])
                           ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
KeyError: 'CharacterSaveParameterMap'

It looks like the structure of the save files has changed. Let me know if I can help!

xNul commented 4 months ago

yes! It looks like you were using an older version of the .py file with a newer version of the palworld-tools dependency. If you do everything fresh, you won't have this issue again.