1. Welcome to the Starbound support forums. Please check the support FAQs before posting: http://playstarbound.com/support

[SOLVED] Comments inside game files makes patching impossible

Discussion in 'Starbound Support' started by odkupiciel375, Aug 5, 2016.

  1. odkupiciel375

    odkupiciel375 Starship Captain

    As in title...
    There are comments like this in game files (assets)
    "// text goes here"
    And comments like this are not tolerated by JSON (link1, link2).
    I've wanted to add my deathclaw to spawn list for scorchedcity.biome but there is 1... but for eg in toxic .biome You can find 10 of these but even that one makes JSON gives You an error that goes like this
    "[Error] Could not apply patch from source: C:\Gry\Steam\steamapps\workshop\content\211820\736006992\contents.pak. Caused by: (JsonPatchException) Could not apply patch to base. (JsonPatchException) Could not apply operation to base. (TraversalException) No such key 'spawnProfile' in pathApply("/spawnProfile/groups/-")" (there is something like "spawProfile/groups" but JSON wasn't able to read that file completely)
    I was only able to add my deathclaw to toxicoceanfloor and magmaoceanfloor biome which wasn't my target for "Fallout mod"
    Than i thought about making vault suit and ran into another problem that's called "Comments are everywhere"... i thought about creating my own droppool for deathclaw and add vault suit to it but i found that inside monster.treasurepools there are 21 of these monster (comments that goes like this //text goes here) and in order to let us add new stuff to vanila biomes we have to be able to do that and by that i mean those comments have to be removed or just changed like they say link1.

    why someone didn't removed that if its not used its just wasted space (part of toxic.biome file located assets/biomes/surface/<here>)
    // ,
    // {
    // "mode" : "floor",
    // "priority" : 1.0,
    // "variants" : 1,
    // "distribution" : "/biomes/distributions.config:denseLarge",

    // "type" : "microdungeon",
    // "microdungeons" : [ "toxicplains" ]
    // }
    If You are not going to change that give us a workaround or just tell us to create our own biomes/droppools/etc.
    Sincerely RafaƂ B.
     
  2. Iris Blanche

    Iris Blanche Pudding Paradox Forum Moderator

    can you post the contents of your patch file?

    ~ Iris ~
     
  3. odkupiciel375

    odkupiciel375 Starship Captain

    sure, here it comes (for all biomes it looks the same and as i said it works for toxicoceanfloor and magmaoceanfloor but for other isnt)
    [
    {"op":"add","path":"/spawnProfile/groups/-",
    "value":{
    "select" : 1,
    "pool" : [
    [ 0.05, "deathclaw" ]
    ]
    }
    }
    ]
     
    Last edited: Aug 5, 2016
  4. Iris Blanche

    Iris Blanche Pudding Paradox Forum Moderator

    Have you tried adding it to the beginning of the list?

    ~ Iris ~
     
  5. odkupiciel375

    odkupiciel375 Starship Captain

    im pretty much sure that its not gonna work besides it's not recommended
    if You'll paste code from any biome file (that contain those comments) into this JSON validator it will give You and error form data side that says that it contains "Unexpected characters"
    edit:
    and my code for patching
    but if You will remove those comments manually it'll work
     
  6. Iris Blanche

    Iris Blanche Pudding Paradox Forum Moderator

    The comments seem to be filtered anyways by the game when applying the patches and/or loading the files so there should be no need to remove them.
    After a bit of investigation of the biome files and your patch files The oceans are the culprit here since they don't have initial a spawnlist.

    ~ Iris ~
     
  7. odkupiciel375

    odkupiciel375 Starship Captain

    first so whats that? (part of a toxicoceanfloor.biome file)
    Code:
      "spawnProfile" : {
        "groups" : [
          {
            "select" : 8,
            "pool" : [
              [ 1, "smallFishOcean1" ],
              [ 1, "smallFishOcean2" ],
              [ 1, "passiveLargeFish" ],
              [ 1, "aggroLargeFish" ],
              [ 1, "poisonfishcritter" ],
              [ 1, "skellyfishcritter" ],
              [ 1, "pufferfishcritter" ],
              [ 1, "jellocritter" ]
            ]
          }
        ],
        "monsterParameters" : {
          "colors" : "toxic",
          "statusSettings" : {
            "stats" : {
              "poisonStatusImmunity" : {
                "baseValue" : 1.0
              }
            }
          }
        }
      },
    
    and second and the most important i was only able to find my creatures in toxicoceanfloor biome (didnt traveled to magmaoceanfloor biomes yet)
     
  8. Kulsius

    Kulsius Scruffy Nerf-Herder

    umm, maybe just because they are in spawn pool doesn't mean they get spawned 100% of time?
     
  9. Iris Blanche

    Iris Blanche Pudding Paradox Forum Moderator

    oops forget to edit the post to the end :nurunaughty:
    At least i removed those two patches and it doesn't threw any errors (maybe it was caused by magmaoceanfloor itself, didn't check)

    ~ Iris ~
     
    odkupiciel375 likes this.
  10. odkupiciel375

    odkupiciel375 Starship Captain

    when i was testing my creations i've set them to 1.0 spawn chance (in spawn types) and when i was patching it with select 1 with pool [1, deathclaw] which in radscorpion case was disaster cause there were only radscorpions and like 10 of them on a small island (as far as i can tell 1 means 100% chances of spawnning such crature (for that group) am i right?)
     
  11. odkupiciel375

    odkupiciel375 Starship Captain

    holy shi... Iris Blanche i had to skip or idk the magmaoceanfloor and You were right it was cause by magmaoceanfloor cuz it doesnt contain spawnProfile :D thx
     
  12. Iris Blanche

    Iris Blanche Pudding Paradox Forum Moderator

    First i was writing about the oceans and was investigating during that time and forgot to edit the post to the end. That's why the first post was...a bit wrong :nurunaughty:

    ~ Iris ~
     
  13. odkupiciel375

    odkupiciel375 Starship Captain

    Ok but at the end it was my mistake that i skipped magmaoceanfloor.biome file (somehow) and comments have nothing in common with that thx again
     
    Kulsius likes this.
  14. Mackinz

    Mackinz The Waste of Time

    Comments are annoying, I agree. Whenever I need to patch into a vanilla file with commented out sections, I ctrl F // or /* and manually remove the commented out sections before selecting everything (Ctrl+A), copying it (Ctrl+C) to paste (Ctrl+V) it on the patch validator.
     

Share This Page