Accessing an array arg inside a script

Maxrocko

Member
script code
Code:
   arr = argument[0];
   var yy = array_length_2d(arr,0);
   var xx = array_height_2d(arr);
   var ds_grid_id = ds_grid_create(xx,yy);

   for (i = 0; i < xx; i++;)
       {
           for (j = 0; j < yy; j++;)
           {
               ds_grid_id[# i,j] = arr[i,j];
           }
       }
           return ds_rid_id;

INPUT ex:

ds_main_menu       = scr_menu_page(

   a[0,0] = "RESUME",      a[1,0] = script,                a[2,0] = scr_resume_game,
   a[0,1] = "SETTINGS",    a[1,1] = page_move,             a[2,1] = page.settings,
   a[0,2] = "EXIT",        a[2,1] = script,                a[2,2] = scr_exit_game
)
Gamemaker 1.4

Objective: I am inputting a 2d array into a script and trying to get that script to copy it to a ds_grid.

Issue: I feel like I am missing something... arr != my 2d array how would I access my 2d array in the script?

Please help....
 
Last edited:

YoSniper

Member
Before I try to tackle this, please edit your post using the [code] and [/code] tags around your code.

It will help to conserve spacing, nesting, and avoid things like those smiley faces.
 
Top