1. G

    [Proposed Script] ds_list_contains()

    The following script (and ancillary scripts) returns true or false depending on whether a value is present in the current ds_list. /// @function {bool} ds_list_contains(id,expression,[search_"whole_variable"=default_or_"words"_incl_num_or_"chars"_incl_digits]) /// @description returns...
  2. C

    GMS 2 Ds_list displaying as -1 after doing a ds_map_destroy.

    hi guys, im getting a bit confused.... I am attempting to create a save file and Load the save file. the only issue I am having is the below: I am loading all my credit list from JSON file... it loads in perfectly. _wrapper holds the whole JSON file information...
  3. Smenkare

    (SOLVED) Changing values in all positions in ds_list

    for(i=-1; i < exampleListSize; i++) {ds_list_replace(exampleList, i, 0)} Will it work? And is there faster way? I have like 500 positions in ds_list and i want to be able to change them all to 0.
  4. shrunkenmaster

    [SOLVED] Help with ds_list to select random path without duplication

    I'm trying to work out how to place one enemy on each of the paths I have. I used a switch to select a path which works fine, but I can't figure out the ds_list to select 4 random, but different, numbers. Eventually I'll have more paths than instances. Very new to this, so any guidance would...
  5. Smenkare

    (solved)getting index from ds_list

    Create event exampleList = ds_list_create(); ds_list_add(exampleList,1); ds_list_add(exampleList,10); ds_list_add(exampleList,10); ds_list_add(exampleList,30); choice = 0; weight_sum = 0; for(var i=0; i<ds_list_size(exampleList);i++) {weight_sum += exampleList[|i]} Draw event if...
  6. animated_ginger

    GMS 2 Trouble saving ds_list with ini

    Hello all! I've been running across this problem all day and I still can't figure out why this is not working. I'm trying to add a value to the list and then save it to an ini file. Problem is, it saves a value like "nan" or "inf". And I'm only testing out to see if this will save values...
  7. MCHLV

    GMS 2 [SOLVED]Storing sprite_index in a ds_map

    Hello, I am sure there is an obvious reason ... I can store sprite_index in a ds_list (and use for drawing later) But this does not work with ds_map... I have tried string / asset_get_index...<edit> it does in fact </edit> This works fine // create_event list = ds_list_create()...
  8. Elgarion

    GMS 2 [Solved] Scripts in ds_list

    Good morning everybody ! I need some help to figure out how to enlist scripts. I tried this : //=========== in my first room create global.My_List = ds_list_create(); ds_list_add( global.My_List, Scr_Sript1, Scr_Sript2...
  9. Bee

    GMS 2 Optimizing - ds_list question

    Hi all, I have a matching game (kinda like match 3) and it works well. However, over time the game slows down. I've done some debugging and refactored a tonne of code, but it still happens. Later on, but it happens. The matching creates and destroys a lot of lists, for every entry on the board...
  10. R

    Debugging - hierarchical preview structure of object with ds_list

    Hi, I'm trying to look into the more complex hierarchical structure of the object in debug mode, more precisely the ds_list which contains other instances and their variables. Is it even possible? It would help me a lot.
  11. W

    GML Game Crash On Collision with List Functions

    I'm making an asteroids-like shooter and I'm currently trying to get the speed value of an object before collission and calculate the "push back". I'm not using the built in physics engine cause I guess I hate myself, lol. However whenever two objects collide the game crashes saying...
  12. 3

    GMS 2 creating ds_list via script causes memory leak?

    When I create as ds_list and store it in a local variable in a script which returns this value does this cause a memory leak? example: script: createMyList var myList = ds_list_create(); return myList; objectList StepEvent if(mouse_check_button_pressed(mb_left)) { list = createmyList(); }
  13. T

    Objects Id connected to draw sprite

    Hello everyone. Have a cool person who used pseudo code to help me understand. I'm pretty sure im getting it but something isnt working right and Im not sure. Been reading in on for loops, with statements and ds_list for days. Been on this issue a little long and think it's time to ask for...
  14. Alloi

    GMS 2 [SOLVED] ds_map issue, creating a small database

    I'm creating a simple system in which people are created, then they are added to a database which has their ID, Village_ID, and Job Title. As well as a method to create villages. The problem I'm running into is that I had a ds_map value of "people" starting equal to an empty array [ ]. Then when...
  15. S

    Asset - Scripts repeat for_all

    So.. I made this a while back... noticed it's only on the old forums, so I'll post it here too. for_all This library adds the repeat for_all construct. The repeat for_all(x) syntax is an emulated language construct, enabling a foreach-like loop structure in gml. In many languages, there...
  16. V

    ds_list_size() returning wrong value

    Heya! As the title suggests, I'm getting a very strange bug when working with ds_list. In my gameplay controller object that is persistent, I create a global ds_list in the CREATE event with the following code: global.LEVEL_LIST = ds_list_create(); I also destroy the list within this object but...
  17. TheCheeseMaster

    GML Problems retrieving data from a ds_list

    Hi guys. I've been working on a system to allow the player to customize the key bindings to whichever keys they want. I've been successful in that once the keys have been changed, using those new keys in-game works fine. The problem I'm having is that when I exit and start the game again, and...
  18. M

    GML multiline chat using ds_list and for loops [Solved]

    Hello everyone, I've been using a ds_list to gather chat from my Twitch channel to make it look a little fancy. I've managed to access the chat to pull into gamemaker 2 and using the for loop function to separate them onto new lines per each person talking. I've managed to get the lines to...
  19. Dr_Nomz

    GML How do I save a ds_list to a ds_grid?

    I thought I knew how to do this, but lot's of testing shows I have no idea how to do this. for (var o=0; o<4; o+=1){ var _row = scr_DSGAR(save_blue_dialogue); save_blue_dialogue[# save_blue_dialogue_enum.option, _row]=option[|o]; } Basically it should just go through each and every value...
  20. C

    Issue when using ds_list instead of array. [SOLVED]

    I just recently, like ten minutes ago, reconfigured some code to use a ds_list instead of an array that I've been using. But it seems that when I want to access it it randomly crashes. So, falling blocks puzzle game. I've been storing all of the blocks (game objects) in an array and then...