Modding Help Caused by: (JsonParsingException) Error parsing json: bad object, should be '}' or ',' at 3:1

Discussion in 'Starbound Modding' started by Nentendoboy360, Jun 30, 2017.

  1. Nentendoboy360

    Nentendoboy360 Scruffy Nerf-Herder

    I've tried to load my mod but if I leave it as a folder, the game crashes leaving the following eror. But if I compres it too a zip the game work but I cannot see my mod: I know how to look for an error but thi error is'nt showing me the cause. It's 2am I'm going to be (got work) but if anyone can help I would greatly apperciate it.


    Error:

    Code:
    [01:51:54.892] [Info] Root: Preparing Root...
    [01:51:54.893] [Info] Root: Done preparing Root.
    [01:51:54.893] [Info] Client Version 1.3.1 (windows x86_64) Source ID: 09b4358d76e61cf447ecb3e11612af0c2f387fad Protocol: 742
    [01:51:54.894] [Info] Root: Scanning for asset sources in directory '..\assets\'
    [01:51:54.894] [Info] Root: Skipping hidden '_unpacked' in asset directory
    [01:51:55.202] [Info] Root: Scanning for asset sources in directory '..\mods\'
    [01:51:55.205] [Info] Root: Shutting down Root
    [01:51:55.344] [Error] Fatal Exception caught: (ApplicationException) Application threw exception during startup
    [0] 7ff64bf57713 Star::captureStack
    [1] 7ff64bf5649e Star::StarException::StarException
    [2] 7ff64bf56588 Star::StarException::StarException
    [3] 7ff64c698210 Star::ApplicationException::ApplicationException
    [4] 7ff64c94ea32 `Star::SdlPlatform::SdlPlatform'::`1'::catch$275
    [5] 7ffda5fac2e0 _C_specific_handler
    [6] 7ffda5fa2a23 _FrameUnwindFilter
    [7] 7ffdb293a193 RtlCaptureContext
    [8] 7ff64c698490 Star::SdlPlatform::SdlPlatform
    [9] 7ff64c69b072 Star::runMainApplication
    [10] 7ff64bea0506 WinMain
    [11] 7ff64c8885ff __scrt_common_main_seh
    [12] 7ffdb26b8364 BaseThreadInitThunk
    [13] 7ffdb28f70d1 RtlUserThreadStart
    Caused by: (JsonParsingException) Error parsing json: bad object, should be '}' or ',' at 3:1
    [0] 7ff64bf57713 Star::captureStack
    [1] 7ff64bf5649e Star::StarException::StarException
    [2] 7ff64beeed9d Star::inputUtf32Json<Star::U8ToU32Iterator<std::_String_const_iterator<std::_String_val<std::_Simple_types<char> > >,char32_t>,Star::JsonBuilderStream,Star::Json>
    [3] 7ff64bef96f7 Star::Json::parseJson
    [4] 7ff64bf7f482 Star::DirectoryAssetSource::DirectoryAssetSource
    [5] 7ff64c2fb380 std::_Ref_count_obj<Star::DirectoryAssetSource>::_Ref_count_obj<Star::DirectoryAssetSource><Star::String & __ptr64>
    [6] 7ff64c304ff5 std::make_shared<Star::DirectoryAssetSource,Star::String & __ptr64>
    [7] 7ff64c313246 Star::Root::scanForAssetSources
    [8] 7ff64c30a4a5 <lambda_629bd0625747976ff7eb77559f7c4f59>::operator()
    [9] 7ff64c2fbc5f std::_Invoker_functor::_Call<<lambda_629bd0625747976ff7eb77559f7c4f59> & __ptr64>
    [10] 7ff64c2ffcd6 std::invoke<<lambda_629bd0625747976ff7eb77559f7c4f59> & __ptr64>
    [11] 7ff64c2fd4b9 std::_Invoke_ret<std::shared_ptr<Star::Assets>,<lambda_629bd0625747976ff7eb77559f7c4f59> & __ptr64>
    [12] 7ff64c30c8b6 std::_Func_impl<<lambda_629bd0625747976ff7eb77559f7c4f59>,std::allocator<int>,std::shared_ptr<Star::Assets> >::_Do_call
    [13] 7ff64c30b277 std::_Func_class<std::shared_ptr<Star::MonsterDatabase> >::operator()
    [14] 7ff64c300e83 Star::Root::loadMemberFunction<Star::Assets>
    [15] 7ff64c30e325 Star::Root::assets
    [16] 7ff64be9bff7 Star::ClientApplication::startup
    [17] 7ff64c698490 Star::SdlPlatform::SdlPlatform
    [18] 7ff64c69b072 Star::runMainApplication
    [19] 7ff64bea0506 WinMain
    [20] 7ff64c8885ff __scrt_common_main_seh
    [21] 7ffdb26b8364 BaseThreadInitThunk
    [22] 7ffdb28f70d1 RtlUserThreadStart
    Caught at:
    [0] 7ff64bf57713 Star::captureStack
    [1] 7ff64bf57cd4 Star::fatalException
    [2] 7ff64c94edbc `Star::runMainApplication'::`1'::catch$76
    [3] 7ffda5fac2e0 _C_specific_handler
    [4] 7ffda5fa2a23 _FrameUnwindFilter
    [5] 7ffdb293a193 RtlCaptureContext
    [6] 7ff64c69b072 Star::runMainApplication
    [7] 7ff64bea0506 WinMain
    [8] 7ff64c8885ff __scrt_common_main_seh
    [9] 7ffdb26b8364 BaseThreadInitThunk
    [10] 7ffdb28f70d1 RtlUserThreadStart
    
     

    Attached Files:

  2. projectmayhem

    projectmayhem Spaceman Spiff

    For one, you dont need all the frame files. Just follow the item pathing of the vanilla assets and it will load the frame files from vanilla.

    Secondly, your player.config needs to be player.config.patch
    It should look more like this...
    Code:
    [
    {
    "op" : "add",
    "path" : "/defaultBlueprints/tier1/-",
    "value" : { "item" : "eroshead" }
    },
    {
    "op" : "add",
    "path" : "/defaultBlueprints/tier1/-",
    "value" : { "item" : "eroschest" }
    },
    {"op" : "add",
    "path" : "/defaultBlueprints/tier1/-",
    "value" : { "item" : "erospants" }
    },
    ]
    
    Third, you need commas in your metadata file.
    {
    "friendlyname" : "Eros Helm Mod"
    "name" : "eroshelm"
    "author" : "MrPixel"
    "description" : "A simple armour mod of my own creation"
    version : "1"
    }

    It should look like this..

    {
    "friendlyname" : "Eros Helm Mod",
    "name" : "eroshelm",
    "author" : "MrPixel",
    "description" : "A simple armour mod of my own creation",
    version : "1"
    }



    See if all that helps
     
    IHart and bk3k like this.
  3. bk3k

    bk3k Oxygen Tank

    Also just to get you started, http://json.org/

    Once you know the terms and the syntax of JSON, those error messages should be clear.
    Code:
    Error parsing json: bad object, should be '}' or ',' at 3:1
    in reference to your _metadata
    Code:
    {
    "friendlyname" : "Eros Helm Mod"
    "name" : "eroshelm"
    "author" : "MrPixel"
    "description" : "A simple armour mod of my own creation"
    version : "1"
    }
    They're complaining about line 3, character 1 but the actual problem is (as already stated) your lack of commas between string-value pairs. A line break is not a sufficient separation as JSON isn't looking at your whitespace. Your file might as well be
    Code:
    {"friendlyname":"Eros Helm Mod""name":"eroshelm""author":"MrPixel""description":"A simple armour mod of my own creation""version":1}
    So you can see where the comma separating one thing from the next is quite necessary. However don't add one after the last string-value pair(or you'll get another error) because that comma tells it there is more data in the set.

    I'm afraid you're still missing something significant here. A missing " before and after version
    A less significant problem(in this case) is that the number doesn't need to be in quotes unless it is intended to be a string rather than a number. Since the version is really for our use only, that won't make for any errors in this case.

    Anyhow here is a copy/paste ready _metadata
    Code:
    {
      "friendlyname" : "Eros Helm Mod",
      "name" : "eroshelm",
      "author" : "MrPixel",
      "description" : "A simple armour mod of my own creation",
      "version" : 1
    }
    
     
  4. Nentendoboy360

    Nentendoboy360 Scruffy Nerf-Herder

    The game dosen't crash, I can see the armor as an item but when I equip it, it's invisible. 20170630083931_1.jpg
     

    Attached Files:

  5. IHart

    IHart Scruffy Nerf-Herder

    Your .chest file points to "eroschest.png" yet none of your files are names "eroschest.png".

    Removing the excess frames files was the right call, but, in order to utilize the default frames files your image files have to match their naming convention.

    I put your armors in their own folder, renamed the image files so that they can use the default frames files, and edited the item files to point to the image files new names.

    In addition to @projectmayhem and @bk3k 's wisdom I recommend researching existing items or features that do what you want, in order to better anticipate what a new one would need to look like.
     

    Attached Files:

    Nentendoboy360 likes this.
  6. Nentendoboy360

    Nentendoboy360 Scruffy Nerf-Herder

    Thank you, I will check this out as soon as I get home from work!
     
  7. Nentendoboy360

    Nentendoboy360 Scruffy Nerf-Herder

    Works like a charm, just gonna do some graphical changes, thanks you guy!
     

Share This Page