r/code • u/[deleted] • Dec 13 '21
I need help with JSON code
So I was try to do some JSON code and I got an error message and now I’m kinda stuck what should I do
1
u/JaggedMetalOs Dec 13 '21
What's the error?
1
Dec 13 '21
That it has trouble creating the planet i makes its like a space game you can code also here is all my code I had to do it has trouble with the format
{ "version": "1.5", "BASE_DATA": { "radius": 3013400.0, "gravity": 10.44, "timewarpHeight": 25000.0, "velocityArrowsHeight": 0.0, "mapColor": { "r": 1.85, "g": 0.66, "b": 0.43, "a": 1.0 } }, "ATMOSPHERE_PHYSICS_DATA": { "height": 70000.0, "density": 0.01, "curve": 20.0, "parachuteMultiplier": 3.0, "upperAtmosphere": 0.3 }, "ATMOSPHERE_VISUALS_DATA": { "GRADIENT": { "positionZ": 0, "height": 24000000.0, "texture": "Atmo_Saturn" }, "CLOUDS": { "texture": "Earth_Clouds", "startHeight": 0.0, "width": 1200000.0, "height": 95000.0, "alpha": 0.65, "velocity": 0.0 }, "FOG": { "keys": [] } }, "TERRAIN_DATA": { "TERRAIN_TEXTURE_DATA": { "planetTexture": "Saturn", "planetTextureCutout": 0.995, "surfaceTexture_A": "Ice", "surfaceTextureSize_A": { "x": -1.0, "y": -1.0 }, "surfaceTexture_B": "Ice", "surfaceTextureSize_B": { "x": -1.0, "y": -1.0 }, "terrainTexture_C": "Ice", "terrainTextureSize_C": { "x": -1.0, "y": -1.0 }, "surfaceLayerSize": 60.0, "minFade": 0.0, "maxFade": 0.6, "shadowIntensity": 0.0, "shadowHeight": 0.0 }, "terrainFormula": [], "textureFormula": [], "verticeSize": 10.0, "collider": false, "flatZones": [] }, "POST_PROCESSING": { "keys": [ { "height": 0.0, "shadowIntensity": 1.4, "starIntensity": 1.0, "hueShift": 0.0, "saturation": 0.95, "contrast": 1.1, "red": 0.96, "green": 0.98, "blue": 1.0 }, { "height": 100000.0, "shadowIntensity": 1.65, "starIntensity": 1.0, "hueShift": 0.0, "saturation": 0.95, "contrast": 1.1, "red": 0.96,p "green": 0.98, "blue": 1.0 } ] }, "ORBIT_DATA": { "parent": "Sun", "semiMajorAxis": 71344855371.0 "eccentricity": 0.0, "argumentOfPeriapsis": 0.0, "direction": 1, "multiplierSOI": 1.25 }, "ACHIEVEMENT_DATA": { "Landed": true, "Takeoff": true, "Atmosphere": true, "Orbit": true, "Crash": true } }
1
u/JaggedMetalOs Dec 13 '21
What are you using to actually load all this data? A game engine you created yourself or some existing game framework?
1
1
0
Dec 13 '21
{ "version": "1.5", "BASE_DATA": { "radius": 3013400.0, "gravity": 10.44, "timewarpHeight": 25000.0, "velocityArrowsHeight": 0.0, "mapColor": { "r": 1.85, "g": 0.66, "b": 0.43, "a": 1.0 } }, "ATMOSPHERE_PHYSICS_DATA": { "height": 70000.0, "density": 0.01, "curve": 20.0, "parachuteMultiplier": 3.0, "upperAtmosphere": 0.3 }, "ATMOSPHERE_VISUALS_DATA": { "GRADIENT": { "positionZ": 0, "height": 24000000.0, "texture": "Atmo_Saturn" }, "CLOUDS": { "texture": "Earth_Clouds", "startHeight": 0.0, "width": 1200000.0, "height": 95000.0, "alpha": 0.65, "velocity": 0.0 }, "FOG": { "keys": [] } }, "TERRAIN_DATA": { "TERRAIN_TEXTURE_DATA": { "planetTexture": "Saturn", "planetTextureCutout": 0.995, "surfaceTexture_A": "Ice", "surfaceTextureSize_A": { "x": -1.0, "y": -1.0 }, "surfaceTexture_B": "Ice", "surfaceTextureSize_B": { "x": -1.0, "y": -1.0 }, "terrainTexture_C": "Ice", "terrainTextureSize_C": { "x": -1.0, "y": -1.0 }, "surfaceLayerSize": 60.0, "minFade": 0.0, "maxFade": 0.6, "shadowIntensity": 0.0, "shadowHeight": 0.0 }, "terrainFormula": [], "textureFormula": [], "verticeSize": 10.0, "collider": false, "flatZones": [] }, "POST_PROCESSING": { "keys": [ { "height": 0.0, "shadowIntensity": 1.4, "starIntensity": 1.0, "hueShift": 0.0, "saturation": 0.95, "contrast": 1.1, "red": 0.96, "green": 0.98, "blue": 1.0 }, { "height": 100000.0, "shadowIntensity": 1.65, "starIntensity": 1.0, "hueShift": 0.0, "saturation": 0.95, "contrast": 1.1, "red": 0.96,p "green": 0.98, "blue": 1.0 } ] }, "ORBIT_DATA": { "parent": "Sun", "semiMajorAxis": 71344855371.0 "eccentricity": 0.0, "argumentOfPeriapsis": 0.0, "direction": 1, "multiplierSOI": 1.25 }, "ACHIEVEMENT_DATA": { "Landed": true, "Takeoff": true, "Atmosphere": true, "Orbit": true, "Crash": true } }
3
u/spliffen Dec 13 '21
using https://jsonlint.com/, it shows that you have a random p in there, try it out, see if it makes sense