I know I’ve missed something obvious, but after poring over the other json parsing threads i’m still lost.
The goal is to contact a server api, retrieve a json formatted list and parse the list into a structure I can call on. I thought I’d start simple and just try to process the “ID” field from the json and print it on screen.
This is the code I’m using (based on the “parse json on swapi” example).
with this as my get request:
My server is on a local network at http://192.168.1.60:1860/api/stories/TR/ If i paste that URL into a browser i get the following json list (the content of which is irrelevant, i just want to be able to parse a variable from it) :
{“ID”:“TR”,“Name”:“Test Room”,“Type”:“Standard”,“ScoreType”:“Time”,“Duration”:60,“Color”:"#000000",“Style”:{“Base”:“standard”,“BaseColor”:"#000000",“ClueIcon”:“images/clue.png”,“ClueUsedIcon”:“images/clue-used.png”,“Background”:"",“BackgroundLinkedToTimer”:true,“HideTimerWhenIdle”:false,“HideTimerWhenZero”:false,“Timer”:{“Font”:"",“FontBold”:false,“FontItalic”:false,“FontShadow”:false,“ForeColor”:"#ffffff",“Top”:0,“Left”:0,“Size”:480,“Override”:false,“Visible”:true},“Messages”:{“Font”:"",“FontBold”:false,“FontItalic”:false,“FontShadow”:false,“ForeColor”:"#ffffff",“Top”:0,“Left”:0,“Size”:40,“Override”:false,“Visible”:true},“Clues”:{“Top”:0,“Left”:0,“Override”:false,“Visible”:true},“Orientation”:1,“CustomCSS”:"",“CustomHTML”:""},“Clues”:{“Max”:3,“Bonus”:“None”,“BonusValue”:0,“Penalty”:“None”,“PenaltyValue”:0, “Duration”:20 },“MaxPlayers”:8,“DefaultTeamName”:“Investigators”,“State”:“Idle”,“Description”:"",“Marquee”:“stories/TR/m3-marquee.jpg”,“Poster”:“stories/TR/m3-poster.jpg”,“Chime”:{“Source”:“sound/chime.mp3”,“OnText”:true,“OnImage”:true,“OnAudio”:false,“OnVideo”:false},“Prologue”:false,“Epilogue”:false,“ExternalID”:"",“Rooms”:{},“Objectives”:{ },“Events”:{ },“RequiredScreens”:[],“ResetChecklist”:{ },“Music”:{},“Logs”:[{“Timestamp”:“04:18:24 pm”,“StoryID”:“TR”,“Type”:“Information”,“Message”:“Story is idle”}],“Values”:{ },“Languages”:[“English”,"","","",""],“Session”:{“Started”:“01/01/0001 00:00:00”,“Timer”:3600000,“TimerFactor”:1,“CluesRemaining”:0,“Score”:0,“Players”:0,“TeamName”:"",“Language”:0},“TimeBonus”:0,“AudioDucking”:false,“Active”:true }
If i run the above code, pressing the “a” key doesn’t seem to do anything.
However, if i change the get code to this:

and after i press “a”, they change to

and the text on screen changes to text = 0.
I wondered if there was a problem with talking to the local server, but i tried sending a server command from gdevelop and it worked fine.
(again, the function of the server here is moot, its just a testbed. I’m just trying to get consistent communications/before I proceed).A number of posts identify getting 0 as an outcome when they incorrectly called the variable type. I don’t think I did that… but maybe? Any help on how to get gdev to isolate any of the json variables would be great. Thanks!