Thank you for this tutorial! Most tutorials on JSON skip the whole "how to make / how to save / where to place the file"-step. This is very useful for first-time JSON users.
Ah, yes. Please do the internally self-updating from a server -game tutorial that you mention near the end. :) Sounds cool. And you could throw self-updating online Highscore lists into that too!
Nice video, I just started using JSON for my project so this helps. Also, the $ accessor should only be used when you're unsure of the field you're accessing at compile time. If you know the name of the field required, the dot accessor is much faster.
Thanks for Making the Tutorial. It's easy learning for beginner. I have a beginner question about how to access value from others object. When I create another object and add create event, I try using with() function to get the value from cards variable. But it had a error said "not set before reading it". So how did people using the value from read-json object?
@@LetsLearnThisTogether So question, when you import the json in, does the data in each of the struct vars only come out as a string, or can I put any data type in there eg numbers, bools, etc? I saw the debugger had "" around each data value but wasn't sure if that was just how the debugger presents struct info.
It’s been a bit since I’ve looked at that specifically, but I think it brings it in as a string. It’s up to you to know what it should be and then convert it to that data type. In GMS, you can take a string and turn it into an integer with a function, so then when you use it in code, it is a number.
Thanks for making such exceptional videos! In my current GMS2 project I am importing csv files into ds grids and manipulating those. Are there specific reasons why JSON files are preferable to this approach? Thanks so much 🙏
Thank you for this tutorial! Most tutorials on JSON skip the whole "how to make / how to save / where to place the file"-step. This is very useful for first-time JSON users.
Ah, yes. Please do the internally self-updating from a server -game tutorial that you mention near the end. :) Sounds cool. And you could throw self-updating online Highscore lists into that too!
I'll add it to my list! I do a lot of server dev for my side jobs, but I haven't tried doing it with GameMaker just yet. It sounds pretty fun, though.
Nice video, I just started using JSON for my project so this helps. Also, the $ accessor should only be used when you're unsure of the field you're accessing at compile time. If you know the name of the field required, the dot accessor is much faster.
Thk´s man, different content of gmsstidio 2. I was bored of the ton of contents of other GMS content tubers that are more about assets and graphics.
Man, this is gold. Thank you, so much !!
Nice tutorial but I have question: how make to read from json Polish characters becouse I dont see them ("ł", ń, ż, ź, ć, ń, ą, ś, ł, ę, ó,)
That’s a great question, and I don’t know. I’d suggest going over to the GameMaker forum and ask there, as a dev might see it and give you an answer.
@@LetsLearnThisTogether I already know what was wrong: I change encoding of json file on UTF - 8 with BOM
That table of contents gave me a nerdgasm
Thanks for Making the Tutorial. It's easy learning for beginner. I have a beginner question about how to access value from others object.
When I create another object and add create event, I try using with() function to get the value from cards variable. But it had a error said "not set before reading it".
So how did people using the value from read-json object?
You can use with, or you can type the name of the object, followed by a period, to then access its data.
@@LetsLearnThisTogether Thank you for the answer about my question! I'll try in my project. :D
Amazing, almost precisely what I was looking for! Now I just need to understand how it imports as an array/structs (and what the hell a struct is)...
Lol, yeah. It’s all connected, but just go for 1 thing at a time and you’ll get there!
@@LetsLearnThisTogether So question, when you import the json in, does the data in each of the struct vars only come out as a string, or can I put any data type in there eg numbers, bools, etc? I saw the debugger had "" around each data value but wasn't sure if that was just how the debugger presents struct info.
It’s been a bit since I’ve looked at that specifically, but I think it brings it in as a string. It’s up to you to know what it should be and then convert it to that data type. In GMS, you can take a string and turn it into an integer with a function, so then when you use it in code, it is a number.
You sound like David Schwimmer :D :D
amazing
ty so much, priceless
why json cant parse arrays
JSON is just a notation format, it doesn’t do anything except provide structure for data.
Good!
Thanks for making such exceptional videos!
In my current GMS2 project I am importing csv files into ds grids and manipulating those.
Are there specific reasons why JSON files are preferable to this approach?
Thanks so much 🙏
GameMaker has functions built to deal with JSON, and as it's an accepted standard, it's a good idea to get familiar with it.
"Not sure what the V stands for ..." CSV = Comma Separated Values.
You passed the test :)