• Hey Guest! Ever feel like entering a Game Jam, but the time limit is always too much pressure? We get it... You lead a hectic life and dedicating 3 whole days to make a game just doesn't work for you! So, why not enter the GMC SLOW JAM? Take your time! Kick back and make your game over 4 months! Interested? Then just click here!

ds_map

  1. P

    Legacy GM ds_grid_add not recognizing 0 as a number

    I'm trying to code a 3-dimensional grid structure for Game Maker Studio version 1.4.1804, and I've hit a bit of a snag. Every time I test the code to add a value to the data structure, it gives me this: Here's the script that encounters the error: ///ds_3d_add(id,val,x,y,z) //Initialize the...
  2. K

    Setting Array to Global Value

    Well I have a problem but not really sure where to start. Basically I have a weapon system set up in an array with ds_maps in the create even of oWeapon. //AR weapons[2] = ds_map_create(); ds_map_add(weapons[2],"sprite",sAR); ds_map_add(weapons[2],"recoil",25)...
  3. aereddia

    HTML5 Saving to local storage on Safari

    I'm using a ds_map system to save my data on an HTML game. ds_map_secure_save works fine on every browser type except for Safari. The game saves and loads fine until you exit out of Safari and boot the game up again. At that point, the temporary storage has been dumped and all the save data is...
  4. Pfap

    ds_list inside ds_map

    From my quick overview of the manual it seems to state that ds_lists and ds_maps should only be combined when working with json. Is the manual only talking about data that would need to be saved? I did some tests and what I have works, but is it a bad idea to use it like the below? Create...
  5. V

    is there a way to iterate through a map?

    Im using a ds_map for a players weapon inventory, think like a final fantasy game, they can pickup and sell them, and have multiples of each. Im using a map because each weapon in the collection should at the very least have a name, and the count for how many you have. Anyway, im trying to...
  6. Daniel Mallett

    Adding a ds grid to a ds_map

    Hey guys, Does anyone know if you can add a ds_grid to a ds_map then save the map and load it back up again and the data be intact.
  7. Daniel Mallett

    Saving data

    I am trying to figure out how to save ds_map data. I have the following code: list_data = ds_list_create(); // Create list ds_list_add(list_data, 000); // Add value to list pos 0 map_data = ds_map_create(); // Create map ds_map_add(map_data, "list_data", list_data); // Adds list to map...
  8. A

    Legacy GM Opposite of ds_map_add_map() ?

    Hello! I have various ds_map's which I stuffed into one main ds_map to encode into a json file. However, I can't figure out how to copy a nested ds_map out of the ds_map it is nested in. Is there any way to undo the ds_map_add_map() function? Thanks, Alek
  9. D

    GML ds_map wont work

    I have been trying to get my ds_map to work but every time i try something new it does not end up working. I set the ds_map levels = ds_map_create(); ds_map_add(levels, "attack", 1) ds_map_add(levels, "defence", 1) ds_map_add(levels, "hp", 5) and then I try and reference it hit1 =...
  10. Daniel Mallett

    GMS2 crashes ds_map_add_map

    I have a button and some code that will simply close the app. This works fine by itself. Then I add the following code. At this point the game still runs but as soon as you click on the quit button Gamemaker crashes and says it's become unstable etc. My problem is 1) Regardless of my code it...
  11. N

    GML [SOLVED] Where is a ds_map saved?

    So i've been working on a dsmap-based save sytem for my game recently and there's a nasty mistake somewhere in my code, because everytime I use ds_map_find_value it just returns an udefined value, even though I use it with keys that should have values attached to them. Knowing where my games'...
  12. C

    How to Flush Memory in GM Project

    Hi Everyone, I'm working with ds maps and list for saving objects and while I was messing around, I believe at one point I caused a memory leak before getting the code back to normal to try another approach. With that said, the normal working code will not produce the JSON list, but if I start...
  13. C

    Storing HTTP response as multiple global variables.

    Hi, I am trying to store a HTTP response as multiple global variables. I don't know if this is the best way to do this which is why I thought I'd post on here. I have a server which returns the levels, experience etc of a player as a JSON format here is an example... { "username"...
  14. Azenris

    GameMaker base64_encode stack over flow

    I have a ds_map "save_state" and the following var json = json_encode( save_state ); var encoded = base64_encode( json ); file_text_write_string( file, encoded ); But I get a crash at base64_encode. A small box opens telling me the script crashed cue to stack overflow. My "json" variable...
  15. K

    Question - Code [Resolved] Why can I not find get any values back from my DS map?

    Hey folks. I am running into a little trouble getting some values from my DS map. A bit of background to the code is this; The variable 'new' is storing an instance that I am placing in the DS map. The key to each instance is a combination of it's x position and y position in an array. Here is...
  16. C

    GameMaker Using ds_maps inside ds_grid for inventory

    I've been trying to figure out my inventory for and RPG, and this is the idea I have: 1. Set up ds_maps containing information for each individual item (sprite, name, description, script for what it does when used etc) 2. Set up ds_grid for inventory, then use a script to add that item to my...
  17. T

    Legacy GM Adding DS_LISTs to DS_MAPs [SOLVED]

    I'm about to start writing the save/load system for my game using ds_maps and was wondering how I'd add an entire ds_list to a ds_map? The documentation says to use ds_map_write to store the list as a string and ds_map_read to transfer it to another data structure, but I'm getting this error...
  18. S

    GameMaker ds_maps general practice question

    Man I can't believe that I've never used ds_maps before lol. So is it generally better to create a ds_map in the CREATION event and destroy it at the end of something like room change or game ending... ...or... creating a ds_map in the STEP you need it, get the info like from a...
  19. L

    DS_Map and twitch follower JSON file[Solved!]

    Greetings. I'll post the twitch json(the part I'm having trouble with) then explain { "follows": [{ "created_at": "2016-12-14T00:32:22.963907Z", "notifications": false, "user": { "_id": "129454141", } }, ... ] } What I want from this is to grab the...
  20. Bee

    Steam Saving to Steam Cloud

    Hello wonderful people, We're so close to launching our first game! But I'm trying to figure out how to save and load from Steam Cloud. Before, I was using ds_map_secure_save and load, but if I do that and save that file, it's encoded and doesn't get decoded. So I tried writing the map to an...
Top