r/code • • 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 Upvotes

11 comments sorted by

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

1

u/[deleted] Dec 13 '21

Ok I did it and this showed up also I’m not a good coder but this showed up

Error: Parse error on line 90: ... "red": 0.96, p "green": 0.98, ----------------------^ Expecting 'STRING', got 'undefined'

1

u/spliffen Dec 13 '21

look at the line thats highlighted, the line directly after is: p "green": 0.98,

im very much guessing that it should be: "green": 0.98,

*edit a bit tired atm, didnt see you got it :)

1

u/[deleted] Dec 13 '21

I was I got it all down but thanks

0

u/[deleted] Dec 13 '21

Nvm I got it thanks so much

1

u/JaggedMetalOs Dec 13 '21

What's the error?

1

u/[deleted] 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

u/[deleted] Dec 13 '21

Existing but I already got it down

1

u/[deleted] Dec 13 '21

Dang

0

u/[deleted] 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 } }