Modding Help My first mod: Hair troubles

Discussion in 'Starbound Modding' started by OldPants101, Feb 19, 2019.

  1. OldPants101

    OldPants101 Void-Bound Voyager

    After a long while, I've managed to create my first mod but I've run into a few problems:

    I've created some hair for each race and for each gender for said races and I've saved them as pngs and made the patch files need for them but for some reason, the hair doesn't show on character creation except they end up bald. The modinfo file doesn't come up in the game for some reason as well.

    I'm currently using unstable Starbound as a testing grounds since my normal Starbound is modded like crazy so I thought it would be better for testing my mod.

    Have I missed a step somewhere or have I coded something wrong? I would love and appreciate the help :)
     
  2. JT`

    JT` Phantasmal Quasar

    1) Check your starbound.log. It will tell you if your mod or patch file is failing somehow.

    2) Use http://chbrown.github.io/rfc6902/ to test patches: copy and paste the contents of your original unpacked human.species file into the "original" box under the Apply patch section, and then copy and paste your patch file into the "patch" box. (If you're concerned about privacy, all of it is handled through JavaScript within your own browser -- you're not sharing anything with the server.) Repeat as needed for the other species. Make sure you remove all comment lines that start with "//" after pasting it, because they're not officially supported in JSON and many developers of JSON validators infuriatingly refuse to support them in spite of widespread usage outside of JavaScript.

    3) If you're making races bald, it sounds like you're wiping out the existing hair array (list) rather than adding to the end of it. Double-check your patch to make sure you're adding your hairs one-by-one to the end of the hair array for your race with the path "/genders/0/hair/-" and not "/genders/0/hair" (likewise for /genders/1 for females). Note the tiny difference in the paths: the first path uses the "slash-dash" path, which is a special RFC6902 format for "at the end of the list", while the second (bad) path is using the direct path, which means that it is overwriting the entire list.

    4) Modinfo not showing up in the game? Is your mod folder located within "/Starbound/mods"? Is the file correctly named "_metadata" or ".metadata"?

    I have no idea what level you're operating at and you haven't shown your patch files, so I can't be more specific.
     
    Last edited: Feb 26, 2019
  3. OldPants101

    OldPants101 Void-Bound Voyager

    Thanks for the reply, managed to fix the mod info and got the sprities to work a while back around Saturday (because I named the pngs differently to the names used in the patch files) but only to have the apex still bald and only 4 hair, three human male and 1 novakid male hairs working and not being able to change the colours of the other races hair.
    On Monday, I thought the bald problem for apex was due to to me using wrong colour tones so I redid one of them to see if I could get one to work the others should do too, did this to one of the novas as well for a test but to find out that i got the colour right the first time. Still didn't work I tried to make new patch files for them only to then crash the game after the chucklefish logo.

    https://www.dropbox.com/sh/wi8k5yck2madc9n/AAA6wuYJqpHW7XAx1DsqRRdFa?dl=0 here are the logs i found for the original mod and the new one I'm testing
    https://www.dropbox.com/sh/yv4l5jgy04io639/AAAnGOTzzb8vRt5qJOwo8vR2a?dl=0 here is the link to the mods themselves

    Thanks again for the reply, sorry to ask but can you continue to help me if you don't mind? Completew newb to all this

    Thank you!
     
  4. JT`

    JT` Phantasmal Quasar

    Code:
    [11:36:38.809] [Error] Could not load image asset '/humanoid/apex/hairmale/sep_ffh_apexm01.png', using placeholder default.
    [11:36:46.159] [Error] Could not load image asset '/humanoid/apex/hairfemale/RW_hair_apex_female_afro_bun.png', using placeholder default.
    The hair files need to be in /humanoid/apex/hairmale or /humanoid/apex/hairfemale. Your current folder structure has both of those files in the same folder, /humanoid/apex/hair. Simple mistake just needed another pair of eyes. =)
     
  5. OldPants101

    OldPants101 Void-Bound Voyager

    Ah, ok thanks for that!

    New problem though, once I've done separate folders for them and put the hair into each one, the game crashes at the chucklefish logo.

    https://www.dropbox.com/sh/sg7wdl90sv2opvv/AAB5SzRlHF_IrPC6K5T5C_Y0a?dl=0 here are the logs.

    Knowing last time, I've missed typed something or miss placed something...

    Thank you so much for the help with this :)
     
  6. DrPvtSkittles

    DrPvtSkittles Master Astronaut

    Code:
        Line 59: [06:55:14.647] [Error] Exception caught loading asset: /species/apex.species, (AssetException) Could not read JSON asset /species/apex.species
        Line 108: Caused by: (JsonParsingException) Error parsing json: unexpected character parsing word at 12:1
        Line 138: [06:55:18.700] [Error] Application: exception thrown, shutting down: (AssetException) Error loading asset /species/apex.species
        Line 138: [06:55:18.700] [Error] Application: exception thrown, shutting down: (AssetException) Error loading asset /species/apex.species
    That is saying at line 12 there is an unexpected character there. BUT because you are patching the file I am confused.
     
  7. OldPants101

    OldPants101 Void-Bound Voyager

  8. JT`

    JT` Phantasmal Quasar

    apex.species.patch:
    Code:
    [
    {"op":"add", "path" : "/genders/0/hair/-", "value":"sep_apexm_ffh01"},
    {"op":"add", "path" : "/genders/0/hair/-", "value":"sep_apexm_ffh02"},
    {"op":"add", "path" : "/genders/0/hair/-", "value":"sep_apexm_ffh03"},
    {"op":"add", "path" : "/genders/0/hair/-", "value":"sep_apexm_ffh04"},
    {"op":"add", "path" : "/genders/1/hair/-", "value":"sep_apexf_ffh01"},
    {"op":"add", "path" : "/genders/1/hair/-", "value":"sep_apexf_ffh02"},
    {"op":"add", "path" : "/genders/1/hair/-", "value":"sep_apexf_ffh03"},
    {"op":"add", "path" : "/genders/1/hair/-", "value":"sep_apexf_ffh04"}, //ERROR: stray comma
    ]
    There's an additional trailing comma after the last line. JSON has an extremely rigid syntax that requires a comma between all list items but does not forgive a comma after the last list item.

    Same problem in hylotl.species.patch. =)

    I strongly recommend using JSONlint or some other parser to test files, especially patch files, because the game *really* doesn't like malformed JSON data.

    (JSON is one of those absurd formats that's frequently recommended for use for user-inputted data, and yet has an extremely rigid syntax that is entirely unforgiving of simple mistakes. XML usually degrades gracefully if there's a stray tag, simply throwing an error on the node it appears in, but JSON will break the entire file. If I had a dollar for every time I crashed Starbound with a bad JSON file...)
     
  9. OldPants101

    OldPants101 Void-Bound Voyager

Share This Page