GML [SOLVED] trouble with ds_list, crash the information

Discussion in 'Programming' started by Kasra_n, Jun 25, 2019.

  1. Kasra_n

    Kasra_n Member

    Joined:
    Jun 19, 2019
    Posts:
    26
    i have 2 pictures first show the code and the second shows the debug result:
    upload_2019-6-25_11-34-49.png
    so as you see the ds_list dont store all the 400 cells of my array i create [20, 20] array and it stores [20, 0], but why ? is storing in ds_list have a limit ? cuz i know it make a copy inside the node of the list
     
  2. Kasra_n

    Kasra_n Member

    Joined:
    Jun 19, 2019
    Posts:
    26
    also i tryed to change my initializing code to something like bellow:
    Code:
    for(var i = 0; i < global.lln; i++)
    {
        ds_list_insert(global.dsm, i, 0);
    }
    
    //contain_loading_time
    for(var i = 0; i < global.lln; i++)
    {
        for(var j = 0; j <= global.mcs; j++)
        {
            info[j, global.mcs] = 0;
            ds_list_replace(global.dsm, i, info);
        }
    }
    but finally when i use:
    Code:
    temp = ds_list_find_value(global.dsm, n);
    temp[f, g] = 10; // compile error
    it says trying to index a variable that is not array :/ pretty confused, cant implementing with gml
     
  3. Simon Gust

    Simon Gust Member

    Joined:
    Nov 15, 2016
    Posts:
    3,182
    Usually it works when you set the last cell of an array. May also be because you do not use the @ accessor when you pull the array from the list (temp).
    temp[@ f, g] = 10;
     
    Kasra_n likes this.

Share This Page

  1. This site uses cookies to help personalise content, tailor your experience and to keep you logged in if you register.
    By continuing to use this site, you are consenting to our use of cookies.
    Dismiss Notice