ds_list

  1. huenix

    Issue removing spawn point form available list after taking it

    I am trying to make it so a connected player spawns on an available starting spot (its a board game). It currently works to place them at random points, but they CAN over lap players, i don't want that. How do i remove the available spawn point after "ojb_player" is crated at x/y? if (type...
  2. G

    SOLVED Trouble Saving and Loading an Array using ds_map/list

    I'm just getting into understanding how to save and load my game and have had success with saving and loading single variables using the ds_map system, however I'm having many issues with doing the same with arrays. I've tried using ds_lists and searched around the internet for anyone else...
  3. Ekke

    GML Update multiple entries in ds_map

    I'm trying to update multiple entries in a ds_map, namely the value for AGE. The age is supposed to be added to a timer so it changes every time the timer fires. There will also be a "add baby" timer that will add more people to the list. I'm fairly new to GML and programming in general and I...
  4. P

    GMS 2 Different DS_lists get same index

    So hello everybody, I am struggling with very strange problem in my code, my object has a variable Path, when I change the state (the step event script) of this object to my PathMovement it does this path = ds_list_create , but then when it executes this code in step event : var...
  5. FoxyOfJungle

    SOLVED "for" statement problem... (trying to make a dialogbox)

    Hi. I have a ds_list, it contains dialogs for my dialogbox. How I make: CREATE: messagebox_list = ds_list_create(); messagebox_show = true; messagebox_n = 0; ds_list_add(messagebox_list,"The quick brown fox jumps over the lazy dog"); ds_list_add(messagebox_list,"This is a long history...")...
  6. Adry

    GMS 2 Memory Leak - Stack overflow (how to properly delete a list?)

    Greetings! I've been working on a system to house multiple dialogue triggers and to save them as they change. I finally believe I got it working-ish, (to save and load) - this is my process: I save a list, within my save function - ds_map_add_list(_map, "Dialogue_flags", global.dialogue_flags)...
  7. Adry

    SOLVED Saving a nested list mayhem!

    Hi everyone! I'm completely new to the list function but I figured this would be a good way to store multiple dialogue flags to save.. Can anyone offer some insight? I have the saving function of: ds_map_add(_map, "Dialogue_flags", global.dialogue_flags); (p.s. the flag is set to 0 within my...
  8. FeetUpGaming

    collision_rectangle_list returning undefined objects

    Hey so i'm making a rectangle select sort of thing for my game and i cannot get collision_rectangle_list to work. ds_list_clear(global.select_list); var count = collision_rectangle_list(_x,_y,_ex,_ey,build_object,false,true,global.select_list,false); show_debug_message("Col_Rect_List Found...
  9. S

    GML Huge FPS drops when searching ds_lists?

    I have the code below in the Draw GUI event, where Target is an instance id, and has a instance variable of Inventory which is a ds_list. When this is executed I get HUGE fps drops, and I'm fairly certain it's because iterating through the whole ds_list every draw step is very memory consuming...
  10. M

    Destroy ds_grid / map / list, even if they are local?

    Hi There Just short question. It's not that clear in the GM Help. If i have a local ds_grid like this: var grid = ds_grid_create(...) Do I have to destroy it after use as well? Thanks a lot! kind regards mX273
  11. sinigrimi

    GMS 2 How to call a random key from ds_map?

    How do I call a random key from a ds_map structure? or will i have to create ds_list? a bunch of variables are created in ds_list, if for example I have 300 keys? I tried to do something with this, but my head is not working as it should var arts = global.artefacts; var arts_size =...
  12. sinigrimi

    still have questions about ds_list(I'm sorry that there are a lot of questions, I'm really a noob)

    but I have very, very many lines with creating objects. how can I effectively add them to ds_list. or maybe there are other options? I have a script in which there is the following: in the controller the following: in the scripts are switch systems in which everything is indicated in a...
  13. D

    GMS 2 Saving DS_LIST with nested DS_MAP?

    I'm relatively new to GMS2 and looking for advice on saving DS_LISTS that have ds_maps inside of them to an ini file. Adding the map to the list.. global.troops = ds_list_create(); entry = ds_map_create(); ds_map_add(entry, "type", "Knight"); ds_map_add(entry, "hp", 100)...
  14. E

    GML What is causing memory leak?

    Hello, i made a simple server for my online game, and the task manager is showing it is slowly increasing memory usage, when i open the server the memory usage is about 18.000kb and after around 10 hours, the server reaches 200.000kb or more. There's always around 40 players online. All the...
  15. 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...
  16. 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...
  17. 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.
  18. 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...
  19. 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...
  20. 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...
Top