Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Java exception when converting json back to db #6

Closed
pieterhouwen opened this issue Mar 28, 2021 · 3 comments
Closed

Java exception when converting json back to db #6

pieterhouwen opened this issue Mar 28, 2021 · 3 comments

Comments

@pieterhouwen
Copy link

My map seed didn't have the dragonqueen in it, so I extracted the .db file to json (670MB!), copied and pasted the Vendor_BlackForest entry and modified the coördinates for it. But now when I convert it back it throws this error:

INFO Reading from /mnt/c/Users/Pieter/worldjson.json
INFO Archive type: DB
INFO Saving DB to /mnt/c/Users/Pieter/worldnew.db
Exception in thread "main" java.lang.NullPointerException
        at net.kakoen.valheim.save.parser.ZPackage.writeString(ZPackage.java:342)
        at net.kakoen.valheim.save.archive.save.PrefabLocation.save(PrefabLocation.java:26)
        at net.kakoen.valheim.save.archive.save.Zones.lambda$save$0(Zones.java:67)
        at java.base/java.util.ArrayList.forEach(ArrayList.java:1511)
        at net.kakoen.valheim.save.archive.save.Zones.save(Zones.java:67)
        at net.kakoen.valheim.save.archive.ValheimSaveArchive.writeZdos(ValheimSaveArchive.java:86)
        at net.kakoen.valheim.save.archive.ValheimSaveArchive.save(ValheimSaveArchive.java:66)
        at net.kakoen.valheim.save.SaveToolsCLI.saveArchive(SaveToolsCLI.java:77)
        at net.kakoen.valheim.save.SaveToolsCLI.main(SaveToolsCLI.java:56)

Any ideas on what I'm doing wrong or how I can put the dragonqueen in my world file?

@pieterhouwen
Copy link
Author

Could it be that they are simply too close to each other?

    }, {
      "name" : "Vendor_BlackForest",
      "position" : {
        "x" : -1017.7126,
        "y" : 47.02371,
        "z" : -1220.2775
      },
      "generated" : true
    }, {    }, {
      "name" : "Dragonqueen",
      "position" : {
        "x" : -1012.7126,
        "y" : 46.02371,
        "z" : -1220.2775
      },
      "generated" : true
    },

@Kakoen
Copy link
Owner

Kakoen commented Mar 28, 2021

@pieterhouwen Between the two entries, there's an empty object. Removing that should fix it.

Change

}, { }, {

to

}, {

Also note that the y coordinate is height. You probably want to modify x and z instead. If you want the summoning altar to spawn, set generated to false. This should make the game spawn the game objects related to the boss when you get near.

Hope that helps!

@pieterhouwen
Copy link
Author

Hi Kakoen,

Removing the empty object seemed to do the trick as far as re-reading the json file and creating a new world db file.
However there was nothing being spawned at selected coördinates, I ended up cheating the moder into the game, saving it and publishing it back to my server.

Thanks for the help anyway :)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants