json

  1. 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...
  2. 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...
  3. 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...
  4. 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...
  5. 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...
  6. 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...
  7. 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...
  8. 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...
  9. 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
  10. FrostyCat

    Asset - Scripts JSON Struct: Use structs and arrays to work with JSON

    JSON Struct Bringing out the true potential of JSON parsing in GMS 2.3+ Overview This library allows encoding and decoding JSON as structs, arrays and other first-order data types as of GMS 2.3. In addition to encoding and decoding functions, it also contains utilities for encryption and...
  11. Gigicom

    GMS 2 Use code in json file

    Hey, I‘m trying to figure out how to use pre-defined json files for some item data in my game. Before, I simply assigned all values to variables and assigned those to a ds_map like this: constantData = item.apple; name = „Apple“; graphic = spr_ItemApple; list = ds_list_create(); listVal =...
  12. samspade

    GMS 2.3+ JSON and GameMaker Studio 2

    GM Version: 2.3.1 Target Platform: All Download: Github Repo Links: YouTube Playlist Summary: A GML tutorial series on what JSON is, how to import, and export JSON files, and building a very simple Choose Your Own Adventure style game for practice. While done entirely in 2.3, and updated for...
  13. flyinian

    What are your ways to organize data for saving?

    I am looking for ways to organize data to save. I have a save/load system using JSON files and it appears to work nicely. Now, I am looking for ideas to organize data. I have several "controller" objects that controls parts of my game and done this way for organizational means. Could I place...
  14. flyinian

    SOLVED JSON save/load system questions

    Questions before I create a JSON saving and Loading system. I plan on following Shaun Spalding JSON save/Load system with that, 1. What would I have to do to save/load ds_grids? What about global variables? 2. Would it be easier/better if I were to change my global variables into a ds_grid...
  15. If Programable_Matter

    Loading JSON info Error

    I keep getting this Error even though the program successfuly uploaded the JSON key :values Apparently the code works and the values show up in my program but like 2 seconds later I get this error. I'm pretty sure I'm missing some code Create Event http_get("http://webpage.json")...
  16. Adry

    SOLVED Really no way to add to JSON save file??

    Hello! I'm just starting out with saving, and decided to go with the JSON method as the title indicates. I have successfully saved menu items like "username" and some other menu preferences. I just began my exploration of saving room and character position.. However, when I did so I was also...
  17. G

    JSON saving and loading with map chunks

    Hello! First of all this is my first time using JSON. I have an infinite, procedural generated map and I am working out a method to save the stats of instances within a chunk area as a JSON. I need to use point_in_rectangle in case collision masks go into other chunk areas however my code...
  18. If Programable_Matter

    Error when working with JSON

    I've been uploading json files unto a webserver and had no problem with them on game maker... for some reason I now keep getting this error with a new project I have started : json_decode argument 1 incorrect type (undefined) expecting a Number (YYGR) Create Event http_get("website.json")...
  19. Startoz

    Fastest way to load a JSON/text file with tens of thousands of lines?

    Hi, I want to load a large JSON file (more than 40k lines when formatted) and decode it. The system that I'm using at the moment works perfectly fine if all the data is contained in one line (loading the text into a string takes less than 1 second). However, if the JSON is formatted, it takes...
  20. Divinik

    GMS 2 Loading Grid From Json Not Working Properly?

    So in the game I'm currently working on, every companion and their info is stored in a ds_grid (Companions_Grid), and within each companion's column is another inventory grid stored for the companion. The code for storing the inventory grids into the json seems to be working perfectly, I check...
Top