Does "persistentId" have to be unique within level or game?

Discussion in 'Content Creation' started by geobeck, Sep 14, 2021.

  1. geobeck

    geobeck
    Expand Collapse

    Joined:
    May 1, 2014
    Messages:
    183
    I've been creating terrain materials by modifying json files, but they don't always show up in the game. After checking all the commas, file paths, file extensions, and other errors I typically find (or make), I'm stumped on certain materials. I've added the material names to the terrain.json file.

    To create a persistentId that's unique within the level, I often change one character in the ID value. It's a very long string, so changing one random character should result in a unique value. But it led me to wonder whether it has to be unique within the level, or within the whole game.

    If it's just the level, I'm considering writing a json from scratch, using sequential values with the correct ID string length.

    Has anyone had success creating terrain material files from scratch?
     
    • Like Like x 1
  2. Agent_Y

    Agent_Y
    Expand Collapse

    Joined:
    Jul 10, 2020
    Messages:
    4,557
    As far as I'm aware it doesn't even have to be unique in the entire game, you can copy it from any vanilla asset and it still works. Might be only unique per vehicle/map or per mod or something. If it had to be unique, then all mods would need to have all different ones, and mod conflicts would be really frequent.
     
    • Like Like x 1
  3. Philipo98

    Philipo98
    Expand Collapse

    Joined:
    Jan 2, 2014
    Messages:
    35
    The persistent ID seems to be the connection between everything. The savest way is to create a new Material and the edit it. If you use the same persistent ID it could get into trouble when switching levels with same persistenIDs on different Materials.
    But actually only experienced one time where east_coast_usa got some interferences with a map I'm working on.
    I rather create unique Id's for savetyness.
    In original files I saw blank persistent Id's so there aren't even required?
     
    • Like Like x 1
  4. geobeck

    geobeck
    Expand Collapse

    Joined:
    May 1, 2014
    Messages:
    183
    I've wondered about that. Two maps I'm surrently working on are re-saves of Gridmap 2.0. I was surprised to see multiple redundant copies of a couple of materials, several that looked incomplete, including some with no persistentId. There are several materials with an order_simset, one with a 10-digit value and two with the same 7-digit value.

    It seems to be quite possible to make a functional main.materials.json with a lot of inconsistencies, but when I try to do it consistently, I have hours of bug squashing!
     
  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