ds list

  1. meme

    How do I save a ds list containing ds map?

    Hello everyone, so I'm implementing some kind of "inventory", so here is my initial code: for (i = 0;i < x;i++) { global.playerMap[i] = ds_map_create(); ds_map_add(global.playerMap[i], "name", "John"); ds_map_add(global.playerMap[i], "hp", "10"); } At first...
  2. Claspo Jones

    GML Grabbing Variable Values From Object IDs In DS Lists

    I'm trying to set up a system where once a teleporter object (obj_teleporter) collides with the player, it looks through a DS list "global.tele_list" which stores the ids of any teleport stops (obj_teleportstop) in the current room, then when it finds one with a matching tele_id value (ex: both...
  3. Smenkare

    GMS 2 (solved)Big data structure, easy to handle

    I need data structure with about 700 objects, every object needs to store 6 properties. I need to be able to change, get these values, and look for values through this whole data structure. What is the best way to make it? Ds_list, grid or simple array? If someone has time, please show me some...
  4. Yizzard

    Saving issues

    Hi I'm trying to make a saving mechanism in my game, and all of the single real number values are working fine with the ini_write_real() function, but when I try to use ds_lists to save arrays, it saves completely the wrong values and I can't figure out why. The loading works correctly, because...
  5. 3

    ds_list still gets value pointed to after deleting[SOLVED]

    When I execute this code: dsListOld = ds_list_create(); ds_list_add(dsListOld,"old"); ds_list_destroy(dsListOld); dsListNew = ds_list_create(); ds_list_add(dsListNew,"new"); and look in the debugger then the debugger shows me that there is a dsListOld which contains the value "new" and there...
  6. B

    DS List on MAC

    This code works on PC but not on Mac. Have any ideas? var i // deselect all of the assets that are in the list for (i = 0; i < ds_list_size(global.group_selected); i+=1) { show_message("deselected1") <------------ this message will show when I test it...
  7. tagwolf

    Shuffle card deck and map values

    GM Version: GMS2 Target Platform: ALL Download: https://host-a.net/f/226890-cardsyyz (I found a place to upload thanks to a community suggestion! The project has all the card assets I reference but code doesn't exactly match the tutorial as it was part of some prototyping. It's got some fun...
  8. F

    GML How, when and where to use arrays and lists

    GM Version: GMS2 Target Platforms: ALL Download: N/A Links: N/A Summary: This is a GMS2 tutorial explaining first of all how to use arrays and DS lists for beginners. Followed by where and when to use 'em. Tutorial:
  9. F

    GML ds_list_add() not working properly

    Hi, I was following a tutorial by friendly cosmonaut on event system in gms2. My all my scripts were working fine except event_register: ds_list_add(listenerList, listenerInfo); Error: ds_list_add argument 1 incorrect type(undefined) line 36[given above..] Can an array be directly put into a...
  10. Flashpants

    GMS 2 DS List vs DS grid with embedded arrays

    Hello all Our game is based off of a 120x64 grid and we want to hold multiple variables of information for each grid square (what room type it is, what's on it etc). The information in the variables will have to be accessed every few seconds by 50-100 different objects, so needs to be as fast...
  11. A

    need help with chainbolt script

    Dear smart people, pls help me to figured out how I can achieve this chainbolt script. By chainbolt I mean an object that hits the neares instance of a certain type (I'll refert to this as "target"), interacts with it and then goes for the next one. My Problem here is that instance_nearest...
  12. DarklinkFighter

    GML [SOLVED - Workaround] Savegame System has strange side effect on Event Listeners

    Hi, I implemented a Savegame System where I can configure for each object what kind of data I want to store without coding it for everyone... The code for the Saving and Loading is currently implemented like this: (still work in progress but works already in some cases) This system was...
  13. Gresse

    Windows Save data

    Hey I created a game in which the player has the option to play a mission (he has to reach a specific height with a limited amount of fuel(and other variables)) so because I don't have the time to manualy test all combinations of the settings and what height is possioble with them and all write...
  14. Phil Strahl

    GMS 2 [SOLVED] Remove Duplicates from ds_list

    Hey, I am just wondering if there's an easy way to go through a ds_list and remove duplicate entries other than picking a candidate entry and going through the whole list looking for matches.
  15. P

    GMS 2 Does deleting a data structure full of data structures delete all the data structures with in it?

    Does deleting a data structure full of data structures delete all the data structures with in it?
  16. Gabriel

    [SOLVED] Assigning a Random Number Without Repeating

    My game has 8 different characters, each represented by a different sprite to assign to the player object. The player can switch to another character whenever they want, before entering any level. I want this special level to have all the characters gathered together, so I created an object...
  17. S

    Game restart clear lists

    My code has a game room, and one of the objects in it has two ds_lists. In order to avoid memory leaks (correct me if I'm wrong), I'm deleting the lists when the room is left. To avoid memory leaks, do I also have to delete these lists when I call room_restart and game_restart? Thanks.
  18. J

    Making an Info App

    Hey everyone, I'm making an app with what will be a lot of info. I'll be using a lot of words and need certain words that fall into categories to be highlighted when they appear and able to be interactive or clickable. I've already started with data structures and see that i can draw boxes...
  19. K

    Legacy GM Issue With Ds_Lists

    Well I Have An Object That Uses Ds_lists And I Need To Place This Same Object Over And Over In One Room, But The "Lists Contents" Are Different In All The Instances Of The Same Object But The List Only Works On The Last Object That I Place in The Room HELP?
  20. W

    A Visual Representation of Ds List style text boxes

    I really want to learn how to do a text box but simply. I tried making my own version but it's kind of limited. I tried following a tutorial but coming back to it I couldn't really change it as I didn't understand just exactly what was going on with each line. So if anyone could manage it can...
Top