but I can not figure out to make it load then create the grid its loaded into the room
so far here is the code (along with the world generation scripts im using also)
World saving script
global.worldname = get_string("Name your world!",working_directory)
directory_create(global.worldname)
global.world_p1 = ds_grid_write(global.dsGridObjects)
global.world_p2 = ds_grid_write(global.dsGridObjects2)
global.world_p3 = ds_grid_write(global.dsGridObjects3)
file = file_text_open_write(global.worldname + "\worldsave.w")
file_text_write_string(file,global.world_p1)
file_text_close(file)
file2 = file_text_open_write(global.worldname + "\worldsave_p2.w")
file_text_write_string(file2,global.world_p2)
file_text_close(file2)
file3 = file_text_open_write(global.worldname + "\worldsave_p3.w")
file_text_write_string(file3,global.world_p3)
file_text_close(file3)Stone layer generation script
w = floor(room_width/16);
h = floor(room_height/16);
global.dsGrid_objects = ds_grid_create(w,h);
ds_grid_set_region(global.dsGrid_objects,0,0,w,h,1);
for (grid_x=0;grid_x<=w;grid_x+=1)
{
for (grid_y=21;grid_y<=h;grid_y+=1)
{
if (ds_grid_get(global.dsGrid_objects,grid_x,grid_y)==1)
{
global.grid_choice = choose(stone_block)
instance_create(grid_x*16,grid_y*16, global.grid_choice);
};
};
};
instance_destroy()Dirt and sand layer generation scripts
w = floor(room_width/16);
h = floor(336/16);
global.dsGrid_objects3 = ds_grid_create(w,h);
ds_grid_set_region(global.dsGrid_objects3,0,0,w,h,1);
for (grid_x=0;grid_x<=w;grid_x+=1)
{
for (grid_y=13;grid_y<=h;grid_y+=1)
{
if (ds_grid_get(global.dsGrid_objects3,grid_x,grid_y)==1)
{
global.grid_choice = choose(dirt_block, sand_block)
instance_create(grid_x*16,grid_y*16, global.grid_choice);
};
};
};
instance_destroy()Grass layer generation script
w = floor(room_width/16);
h = floor(208/16);
global.dsGrid_objects2 = ds_grid_create(w,h);
ds_grid_set_region(global.dsGrid_objects2,0,0,w,h,1);
for (grid_x=0;grid_x<=w;grid_x+=1)
{
for (grid_y=12;grid_y<=h;grid_y+=1)
{
if (ds_grid_get(global.dsGrid_objects2,grid_x,grid_y)==1)
{
global.grid_choice = choose(grass_block)
instance_create(grid_x*16,grid_y*16, global.grid_choice);
};
};
};
instance_destroy()Please help ive been trying for quite a while to do this please











