json

  1. C

    Ds_map_add_list not working?

    Here's the step event of the object collecting data, it grabs all the variables for each ship object, puts them all in ds_maps, and puts all of those into a list. That list is put into another map which has one list for each level, which is what I'm trying to write out as json. if...
  2. Philip Wallin

    GMS 2 Save & Load Arrays Problem

    I'm having issues with the save & load system in Shaun Spalding's RPG series... Shauns video. Code: Save Script: function save_game() { var _map = ds_map_create(); //Inventory _map[? "Inventory"] = global.Inventory; _map[? "bombs"] = global.bombs; _map[? "arrows"] =...
  3. B

    SOLVED JSON_Stringify returns null

    Hi, I'm still having issues with JSON_Stringify. I have a function based on Shaun Spaldings video called "GameMaker studio 2 - Best Saving and Loading Tutorial (2.3.1+)". (It's an awesome video) The function is pretty straight forward: 1. An array is created and then the function gets each...
  4. B

    SOLVED Help - Loading JSON level data into a 2d array

    Hi all, I'm having issues in trying to work out how to read a JSON file into a 2D array. I've written code to set up a JSON file containing all of my level data for all levels of my game. The basic idea is that I have an array with a level number and then I have a struct within that level array...
  5. JeanSwamp

    GMS 2.3+ Structs and json save load

    Hello, I am getting started with structs and json save/load and I have a big problem compared to saving with ds_maps, maybe is just a misunderstanding on how they work... With maps I could modify entry values and save them to a file, and easily compare a map value or fetch variables with the...
  6. Josi Craft's

    Windows how to export a json/ .txt file with the game

    if i have a json ( .txt ) file with my games stats in how do i then export it with the game if you can do it at all....
  7. Josi Craft's

    GMS 2.3+ problem whit reading from a "sub" list inside a map (JSON)

    hello im trying to learn how to use json but when i import the file it comms out as a list inside a list inside a map and i dont know how to read the fx "another question" part of the file plz help i have followed the 3 part tutorial from SamSpadeGameDev the Json file: { "sub list": [...
  8. N

    GMS 2.3+ Trouble with saving ds_lists and arrays to a struct based (json) saving system

    So I have done a video explaining things but the most important things are in the post itself. In the video I show the content of the json file though Hi, I have multiple problems using a save and loading system using json. My Saving code looks like this function SaveTest(){ if...
  9. giraffeman210

    GMS 2.3+ saving with a parent object

    I followed a tutorial to save objects and it said that if I gave each object the same parent object it would still load the individual objects correctly. However when I save and load, it loads every object as the parent object. Is there something I did wrong? Here is the save code and the load...
  10. S

    GMS 2.3+ Getting Vars From and To The Proper Instance

    So I have been trying to work on a "save" system based off of structs and have reviewed many tutorials and the GM manual regarding these related topics. I can get the data I need to save into my structs "technically" but I am having issues when I try to get the data from a specific instance. I...
  11. S

    GMS 2.3+ Trying to get a struct to a variable from a .txt or .json file

    Hey all, I want to use a txt or json file containing a struct with all the dialogue for the game (so I could swap in translations etc) but with all my attempts at searching how to do this correctly I still haven't managed to. If I have a .txt or .json file containing: { "teststring": "this is a...
  12. A

    Data import: csv or json?

    Hi all, for the purpose of importing data into gml, is there any specific reason to prefer csv over json format? I do not have an actual case or application at hand, it's more of a general question. But as a vanilla example, let's say something like data describing a number of monsters or NPCs...
  13. O

    SOLVED Saving / loading maps using JSON; getting the error "Data structure with index does not exist"

    Hey all, I'm experiencing some difficulties creating a save game system, specifically with saving / loading maps that store lists inside them. I have a map oData.map_oIntObj_indexes which stores lists with data about certain objects. In my save script I have tried both this (where _map is the...
  14. Ekit

    GMS 2.3+ Trouble with saving with JSON

    Hi all, I'm currently getting back into GameMaker Studio after a year long hiatus. I wanted to implement a saving system into my game and found this tutorial on Youtube: GameMaker Studio 2 - Best Saving and Loading Tutorial (2.3.1+) - YouTube I followed it and it seems to work perfectly...
  15. gnysek

    GMS 2.3+ Saving and loading structs with constructor to/from string?

    With 2.3+, there's easy option to save/load struct, using json_stringify() and json_parse(). That however saves only normal struct, not those created using new keyword from constructor functions (they will be converted to normal struct too), so I can't later use instanceof on them. I was...
  16. Aaron Craig

    GMS 2.3+ Using json parse returns the values in different orders from time to time

    I'm working on a card game and have created a json file to import all the card details. The problem is the parsed json changes the order it comes in, seemingly at random. It seems like if I add any extra code into my project, anywhere, it may change it. It only seems to alternate between two...
  17. R

    Legacy GM [QUESTION] Dynamic Objects via JSON

    Hey all! I'm making a survival/crafting game, and I want to be able to define objects/items (as well as crafting recipes) and their parameters via json files rather than tediously creating one after the other, adding a create event, and setting the variables directly in GameMaker. Of course...
  18. samspade

    GMS 2.3+ JSON with Structs in 2.3.1

    Now that we can load json data as structs and arrays, I have a question. I can take the following data and load it in: { "Some Data" : "Hello World", "Some More Data" : "Goodbye" } And that will give me a struct with two variables containing the strings hello world and goodbye...
  19. T

    SOLVED Saving system (JSON)

    Hello! I need some help with saving system. Now I am using JSON-system, it saves everithing in files. But saving in files is not good for saving when player, for example, change the room. I think the game can use some temporary memory during playing, and use file-saving only if player push...
  20. T

    Error: Unexpected token reading a json Object at line...

    I recovered my game file after like 10 months, and when I try to run the game, this compile error pops up cant I cant run my game
Top