Solved JSON Forest Data v2 support

Discussion in 'Mod Support' started by thomatoes50, Jan 3, 2017.

  1. thomatoes50

    thomatoes50
    Expand Collapse
    BeamNG Team

    Joined:
    Jan 31, 2013
    Messages:
    722
    I don't know if it was officially announced and i can't find anything on the wiki.

    The game try to load a valid JSON file but it tell me that the file is missing
    a quick look at the log tells me what when wrong
    Code:
    ForestData::readJsonFormat|forest instances missing: 'levels/wip/wip.forest'
    Does json suported well?
    the indent must be the same for every file?

    Here is a small portion of the forest file
    Code:
     "header":{
      "format":"JSON Forest Data v2",
      "format description":"posX, posY, posZ, rotX, rotY, rotZ, rotW, scale",
      "version":2}
      },
      "instances": {
        "obj01": [
          [
            2828.732,
            460.8426,
            -2.898444,
            0.0,
            0.0,
            1.0000001028433914,
            41.50000313283435,
            1
          ],
          [
            2823.153,
            465.8889,
            -2.898444,
            0.0,
            0.0,
            1.0000001028433914,
            41.50000313283435,
            1
          ], 
     
  2. tdev

    tdev
    Expand Collapse
    Developer
    BeamNG Team

    Joined:
    Aug 3, 2012
    Messages:
    3,030
    >> valid json file >>
    Code:
    "header": {
        "format": "JSON Forest Data v2",
        "format description": "posX, posY, posZ, rotX, rotY, rotZ, rotW, scale",
        "version": 2
    ##################################}
    },
    "instances": {
        "obj01": [
                [
                    2828.732,
                    460.8426, -2.898444,
                    0.0,
                    0.0,
                    1.0000001028433914,
                    41.50000313283435,
                    1
                ],
                [
                    2823.153,
                    465.8889, -2.898444,
                    0.0,
                    0.0,
                    1.0000001028433914,
                    41.50000313283435,
                    1
                ],
    
    I think that makes the rest of the file 'invisible'
     
    #2 tdev, Feb 4, 2017
    Last edited: Feb 4, 2017
  3. tdev

    tdev
    Expand Collapse
    Developer
    BeamNG Team

    Joined:
    Aug 3, 2012
    Messages:
    3,030
  4. thomatoes50

    thomatoes50
    Expand Collapse
    BeamNG Team

    Joined:
    Jan 31, 2013
    Messages:
    722
    I check json and it's valid on multiple sites
    I tried your tweak but it still don't work.
    i tried modify the header to be exactly like BNG files but it doesn't work.
    I try removing entry to have just a few trees but still don't work

    I can load utah forest file
     

    Attached Files:

  5. tdev

    tdev
    Expand Collapse
    Developer
    BeamNG Team

    Joined:
    Aug 3, 2012
    Messages:
    3,030
    just tested, this file works well here ?! Could you PM me the complete zip please? Are you sure its not overlaying an older file in Documents vs game dir?
     
    • Agree Agree x 1
  6. thomatoes50

    thomatoes50
    Expand Collapse
    BeamNG Team

    Joined:
    Jan 31, 2013
    Messages:
    722
    You are right, it was an overlaying file problem. Its working fine now thank you very much.
    an invalid JSON was in Documents/BNG/levels/map/forest.json while the mods is in mods/unpacked/....

    Is there a console command that could display a warning in the console/logs to tell there is a duplicate file ?

    Just to get you informed, I written wrong data in the json (euler rotations instead of quaternion) so the mesh was all stretched weirdly and i was at 3 fps
     
  7. tdev

    tdev
    Expand Collapse
    Developer
    BeamNG Team

    Joined:
    Aug 3, 2012
    Messages:
    3,030
    good to know :)

    I'll try to think of a way to add a warning for overlaying files.
     
  1. This site uses cookies to help personalise content, tailor your experience and to keep you logged in if you register.
    By continuing to use this site, you are consenting to our use of cookies.
    Dismiss Notice