ds_list

  1. G

    Checking if a value of a Ds_list repeats in another Ds_list

    I'm not really sure if this is the most efficient way to check with every value of a Ds_list, if its value repeats in another Ds_list, but its just the way i came with (which isnt managing to work anyways), so i came here for some help to do some changes.... I have two objects, which IDs are in...
  2. P

    GMS 2 [SOLVED] Can I set the size of a ds_list without a for loop?

    I want to make a ds_list that is n values long. Can I do this in GML without using a for loop?
  3. P

    GMS 2 [SOLVED] Finding one value of a set of numbers in a single ds_list position

    I've set up a ds_list with each position of the list being coordinates. It looks like this: global.grad3 = ds_list_create(); ds_list_add(global.grad3, [1,1,0],[-1,1,0],[1,-1,0],[-1,-1,0], [1,0,1],[-1,0,1],[1,0,-1],[-1,0,-1]...
  4. Mert

    Android Efficient ds_list searching & getting

    Hi. I have a ds_list that contains 680.000 words. I alphabetically listed them (from A > Z) I also have a list that contains the words used before. Whenever I get a word from the main list, I add this word's position to my second list so that I know that this word was used before. What I want...
  5. C

    DS_LIST Scope

    Hello everyone, I've been searching for some info regarding variable scope for DS Lists. I'm sort of under the impression they are global. My scenario is that I have a number of instances in a room that are from the same object. I am setting them up so that they monitor a circle around...
  6. A

    GMS 2 Iterating through DS List Works when Debugging only [Solved]

    I have encountered a bug in my code when I attempt to iterate over a ds_list containing objects returned from a json file. When the application runs normally this error appears, as well as when I debug the code and hit F5 to move to the break point after the for loop (the error on line 23...
  7. J

    Creating a DS_list within a list and loading from that list

    Hi all, I have figured out how to do saving and loading for a position within a ds_list with the help of Shaun Spaldings excellent tutorial Saving to position 0 var _root_list = ds_list_create(); var _map_player = ds_map_create(); ds_list_add(_root_list, _map_player)...
  8. T

    DS list of all of a certain object live in game

    Hello. I need to make a DS list of all the "obj_object" objects currently in my room so that I can reference them all individually in my code. How would I go about doing this? This is so that they can reference each other. Also when the object dies it also needs to get off the list. Is this...
  9. W

    Legacy GM Drawing Object sprites from a ds_list[solved]

    I need to draw the sprites of objects I store in a list but every time I try for some reason my inventory object draws my sprite above the object writing the code no matter where I put the y value. I'm just doing a loop and drawing whatever's in the array at the checked position if there's...
  10. W

    Legacy GM [solved] Difference between ds_list_add and ds_list_set?

    I just started working with ds_list and I'm looking through the functions but I don't get what's the specific practical use of ds_list_set compared to ds_list_add. It says if you use set to put a value in the list outside the size of the list, it'll just create the indices needed to reach that...
  11. D

    Help with enemies's position

    How can I make the cursor jump to the next enemy checking if the next enemy its alive or not? I saw a stream where the guy used ds_list to do that I want, but doesnt explain how this works :/
  12. C

    Legacy GM How many max values can a ds_list hold?

    Title says it all. Is there a maximum amount of values a ds_list can hold? If it's something low like 15, is there an alternative to list that has a high maximum amount or infinite values. I wont be needing something like quintillions or so something to check which all servers the player has...
  13. F

    Passing a ds_list as parameter to an extension function

    Hello, I'm writing an extension for Android (which will be also ported to iOS and Windows). I need to pass a ds_list as a parameter of a Java method. How would I do it? In GML I would pass the index of the ds_list as argument to the function. But how do I access the values of the said list in...
  14. 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...
  15. Q

    Object IDs stored in ds_list result in <invalid instance>

    EDIT: With a little more digging, it looks like this only happens when I change rooms after creating the ds_list. Is there a way to mark a ds_list as persistent? EDIT2: Duh! The objects IN the ds_list weren't persistent, so they were getting destroyed when the room changed. The ds_list still...
  16. Z

    Multiple Collisions Based On Z Axis

    Hi GMC ! For my game in fake 3D, I coded collisions with objects on the x axis and y axis ("normal" collisions). For the "jump" function, I need to set collisions on differents levels of floor. To do that, I created an object named "LEVEL", which take the depth of its layer and use it as z...
  17. Amir Bayareh

    Sorting objects by positions.

    Hello everyone! I am creating a little race game where 4 objects are racing each other. I want to give each object its own place (1st, 2nd, 3rd & 4th) depending on their actual position. But I've been strugglin for a while now. I think that I can do it by creating a ds_list and sorting it by...
  18. Bee

    GMS 2 variable_instance_set, but the variable is a ds_list

    I'm hoping there is a solution to this... I have a bunch of ds_lists that hold two values each. Then I have a json that refers to the ds_list names. So in order to adjust the values in the two list positions, how do I access them? I'm assuming I need to use variable_instance_set since the name...
  19. M

    Legacy GM How to assing hierarchical value to variables without repeting positions

    Hi, I'm having trouble making a position system in a race game. What I was expecting is that if any of the four players, for example Player A, hits the lap detection zone first he will be in first place and if Player B hits the lap detection zone next and both have the same ammount of laps...
  20. 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...
Top