Why my materials.json don't work in vehicles folder ?

Discussion in 'Mod Support' started by Rationalist, Jan 12, 2020.

  1. Rationalist

    Rationalist
    Expand Collapse

    Joined:
    Jan 8, 2020
    Messages:
    2
    Hello here !
    I try to release my asset mod but i have somes issues with materials.json.

    Textures working properly in my \levels\smallgrid folder, but when I move my \vehicles location I have missing texture.

    In \levels\smallgrid\art\shapes folder my texture works fine.
    01.png

    But in \vehicles i have missing texture, my material name mysteriously changed. "_mat" after the name.
    02.png
    I try to research my previous material "circleDriftA_mat" in material editor, but is not here.

    Any idea ?

    I see most people work with materials.cs. But when I create my material in editor, beamng create automatically the materials.json. So I start from here. Plus I read it was the new format.

    But i don't see any mod work with materials.json so i have no comparison point. And i don't see a lot of documentation about it.

    Maybe it's more easier with .cs ?

    I upload my work folder so you can check if you want to.
    Thanks in advance, I’m struggling with this, a little help would be great :)
     

    Attached Files:

    #1 Rationalist, Jan 12, 2020
    Last edited: Jan 12, 2020
  2. thomatoes50

    thomatoes50
    Expand Collapse
    BeamNG Team

    Joined:
    Jan 31, 2013
    Messages:
    722
    when you use .cs file, Torque script knows which script you are executing so it does have a context (which path it is).
    This is why you can use keywords like "./" or just the filename to say look in the current folder.

    With Json file, The engine will decode the json but it does not have any context.
    You NEED to put full filepath (eg: /vehicles/circleDriftA/circleDriftA_****.dds )

    Then there is one bug that is our fault.
    In levels, "material.json" are loaded but no when it's a vehicle.
    You simply need to rename your file and add "main." in front, then it will work with both.

    Please note that your mesh is using the structure for a TSStatic, it won't display for vehicle flexbodies.
    For vehicle flexbodies, you don't need the structure base00>start01> lods
    You can just put all the meshes at the root level.
     
  3. Rationalist

    Rationalist
    Expand Collapse

    Joined:
    Jan 8, 2020
    Messages:
    2
    Ok i see ! Thank you, i try that later.
     
  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