I've been trying to generate terrain in 3d for awhile and i just can't seem to get it to work.
My most recent attempt uses the following code:Create Event: execute code: global.ter = ds_grid_create(room_width,room_height) ee = random_range(20,30) {e = (ee*32)} slope = choose(-8,0,8) //initial generation for(b = 0;b < room_height;b+= 512){ for(a = 0;a < room_width;a += 32){ ds_grid_set(global.ter,a,b,e) e += slope slope += choose(-8,0,8)}} //filling in terrain a = 0 b = 0 for(a = 0;a < room_width;a += 32) n = ds_grid_get(global.ter,a,b) m = ds_grid_get(global.ter,a,b+512) s = (m/512) val = n+s for(set = 32;set < 480;set += 32){ ds_grid_set(global.ter,a,set,val) val += s} alarm[0] = 1 Alarm Event for alarm 0: execute code: for(j = 0;j < room_width;j += 32){ for(k = 0; k < 512;k += 32){ instance_create(j,k,obj_block)}}Obj_block:Create Event: execute code: z = ds_grid_get_disk_max(global.ter,x+16,y+16,16) if (!z =0) draw_set_alpha(1/z)Can anybody tell me how to fix this or give me an example or something? Because nothing i try has been working.
I wish people these days knew what google was......
tutorial link



Find content
Male
