R
Rizlad
Guest
I wrote a pseudo/test script to test how many surrounding walls there are and if there are the appropriate amount put items in corners and nooks of my generated map, it is putting items almost everywhere. o.o".
Please come to my aid Almighty Programming-Elders!
Floor-tile Script-
///scr_fill_room
poss = 0;
inst = instance_place(x-32,y,obj_cwall);
if inst != noone {
poss++;
}
inst = instance_place(x+32,y,obj_cwall);
if inst != noone {
poss++
}
inst = instance_place(x,y-32,obj_cwall);
if inst != noone {
poss++
}
inst = instance_place(x,y+32,obj_cwall);
if inst != noone {
poss++
}
if (poss >= 3) {
instance_create(x,y,choose(obj_rock,obj_torch));
}
if (poss = 2) {
instance_create(x,y,choose(obj_rock,obj_torch,obj_none,obj_barrel));
}
Please come to my aid Almighty Programming-Elders!
Floor-tile Script-
///scr_fill_room
poss = 0;
inst = instance_place(x-32,y,obj_cwall);
if inst != noone {
poss++;
}
inst = instance_place(x+32,y,obj_cwall);
if inst != noone {
poss++
}
inst = instance_place(x,y-32,obj_cwall);
if inst != noone {
poss++
}
inst = instance_place(x,y+32,obj_cwall);
if inst != noone {
poss++
}
if (poss >= 3) {
instance_create(x,y,choose(obj_rock,obj_torch));
}
if (poss = 2) {
instance_create(x,y,choose(obj_rock,obj_torch,obj_none,obj_barrel));
}
Last edited by a moderator: