It's a little too complex because I don't know what the functions do.
Can I please have a standalone code that places 4x4f bricks in a flat plane when I stand or walk into a non-generated area?
I'll walk you through the core process
//from the tick function, called constantly on a loop
for(%c=0; %c<terragen.adventurercount; %c++)
{
if(isobject(%b = terragen.adventurer[%c]))
{
%gpos = terragen_getgridpos(terragen_getplayerpos(%b));
%xi = getword(%gpos, 0);
%yi = getword(%gpos, 1);
for(%a=$terragen::radius*-1; %a<=$terragen::radius; %a++)
{
for(%b=$terragen::radius*-1; %b<=$terragen::radius; %b++)
{
%x = %xi + %a;
%y = %yi + %b;
if(!terragen.plangrid[%x, %y])
{
terragen_addgridbricks(%x, %y); //adding mega meat...
}
}
}
}
else
terragen_remove(%c);
}
This loops through all players, and for each player it does another loop to determine if any grid spaces in a certain radius of them have not been set. This will be the core of what you want.
Once you have determined that a grid space needs something on it, generate that grid space
The function terragen_addgridbricks(%x, %y) is alot more complicated than you need to worry about, because it also adds numerous little details and smoothing and stuff. Basically once you know the xy coordinate, it should be pretty straightforward to figure it out on your own.