Im not a programmer myself and i cant do it, but talking from the big part of the modding community, .json format of materials instead of .cs is really hard to switch to. Can someone make a converter from .cs to .json materials format?
Sort of. I made a simple .json to .cs converter. (Though it's currently broken) https://github.com/swift502/BeamNG-material-tools I can definitely make a .cs to .json converter. Should be fun. I can also add any other functionality. I personally needed duplicate detection and removal so I made it for that purpose. But if you need anything specific let me know. It's all very simple stuff though. No GUI, just python code.
So can anyone explain this thing they did to materials? I asked in the discussion thread and got no answers. It's not that the format doesn't make sense, I haven't had any luck making my own materials via Notepad++ and having the game recognize them.
I haven't been able to get .json figured out either. Been a HUGE reason why I don't do maps anymore. I can take a stock .json, modify it EXACTLY in Notepad and sure enough every time the game has an issue with it. A converter is certainly a great idea in my book.
The 0.17 changelog says: "Material files moved to new Json format, allowing multiple files for better modability" And I got this answer recently:
It may be usefull for someone but there is a tool inside the game Code: \lua\ge\extensions\util\resaveMaterials.lua This is not really supported and may crash the game. It will hang and try to convert the entire universe. Not recommended to use when you have lots of mods or unclean userpath start by using this command Code: extensions.load("util_resaveMaterials")
In the process of removing anything TorqueScript related (like it happened for the levels and the .MIS files, now it's time for the materials .CS files). .JSON is a more future-proof format which we can work and support better. Also, this move allow us to have multiple "materials" files in a single folder (see the vehicles, which have their skin materials files in a separate .JSON file from the rest)
Thank you for explaining it a bit more, but you also forgot the other half of my question; It's not that the format doesn't make sense, or that I don't know where or what everything is, it's that I can't seem to add a new material to one of these files in Notepad++ and have the game recognize it.
That's pretty generic description you gave unfortunately, could be anything. Can you provide the file? By the way, to clear the doubts. This JSON move for materials is at early stages yet. You can keep working with the .CS format, as it works as usual. In the future we have will have some automatic converter built-in the new editor, to make the move quick and painless. If you are still interested, you just need to be extra careful with this format. And mind that since it's a work in progress feature, things could change, so be aware. This format is way more strict with the syntax, which is good as it prevents broken stuff to be inserted and left in there (which can become an issue in the future). Since it's JSON specification, you can use a JSONLinter to validate your file. The game will also throw errors in the console if your Json is invalid: (A common mistake for example is forgetting that the last lines of a group does not need a comma) Here I'm attaching my VR_City level materials file, both the original .CS and the hand-written .JSON Here's a comparison between the two: The most noticeable chance is that you don't have [0] [1].. at the end of the material feature to indicate the 'layer' (stage). You now have { } brackets present all the time, which correspond to every layer (stage)
Thank you for the explanation I'll give converting to the new system another shot when I have more time, this should be very helpful in regards to understanding things.