ALL IS NOT LOST, V21

Author Topic: ALL IS NOT LOST, V21  (Read 23645 times)

There was a script that generated maps into terrain with bricks, this is how it was done. if you want, i think it was truces scripting contest.
Hers the script, beware you need a really damn good PC to use it.

Code: [Select]
if(ForceRequiredAddon("Brick_Large_Cubes") == $Error::AddOn_NotFound)
return;

package p
{
function startGame()
{
Parent::startGame();
%f = "editor/newMission.ter";

if(!isObject(Terrain))
{
new TerrainBlock(Terrain)
{
terrainFile = %f;
};

%t = new Terraformer();

%t.terrainFile(1,%f);
%t.setTerrain(1);
%t.fBm(1,9,0,"Normal",%t.generateSeed());
%t.delete();
}

%p = pickSpawnPoint();
%u = mCeil(firstWord(%p) / 4) * 4;
%v = mCeil(getWord(%p,1) / 4) * 4;

for(%x = %u - 512; %x < %u + 512; %x += 4)
{
for(%y = %v - 512; %y < %v + 512; %y += 4)
{
%z = mCeil(getTerrainHeight(%x SPC %y) / 4) * 4;
%m = %z;

for(%w = %x - 4; %w < %x + 5; %w += 4)
{
for(%h = %y - 4; %h < %y + 5; %h += 4)
{
if(%w == %x && %h == %y)
continue;

%m = getMin(%m,mCeil(getTerrainHeight(%w SPC %h) / 4) * 4);
}
}

%c = getMax((%z - %m) / 4,1);

for(%i = 0; %i < %c; %i++)
{
%b = new fxDTSBrick()
{
dataBlock   = brick8xCubeData;
position    = %x SPC %y SPC %z - (%i * 4);
isBasePlate = 1;
isPlanted   = 1;
colorId     = (%i == 0) ? 2 : ((%i < 4) ? 8 : (getRandom(0,49) ? 6 : 1));
};

%b.plant();
LocalClientConnection.brickGroup.add(%b);
}
}
}

Terrain.delete();
}
};
activatePackage(p);

And note i DID not make that script.
That's not how I did it.

So how are you going to take care of the borders? I hope you don't decide to make a wall of 64x64 cubes.

I'm not going to do anything to the "borders".

I'm not going to do anything to the "borders".

People are just going to run right off the terrain.

People are just going to run right off the terrain.
It's not like people can actually play on a map like this without lagging.

There was a script that generated maps into terrain with bricks, this is how it was done. if you want, i think it was truces scripting contest.
Hers the script, beware you need a really damn good PC to use it.

Code: [Select]
if(ForceRequiredAddon("Brick_Large_Cubes") == $Error::AddOn_NotFound)
return;

package p
{
function startGame()
{
Parent::startGame();
%f = "editor/newMission.ter";

if(!isObject(Terrain))
{
new TerrainBlock(Terrain)
{
terrainFile = %f;
};

%t = new Terraformer();

%t.terrainFile(1,%f);
%t.setTerrain(1);
%t.fBm(1,9,0,"Normal",%t.generateSeed());
%t.delete();
}

%p = pickSpawnPoint();
%u = mCeil(firstWord(%p) / 4) * 4;
%v = mCeil(getWord(%p,1) / 4) * 4;

for(%x = %u - 512; %x < %u + 512; %x += 4)
{
for(%y = %v - 512; %y < %v + 512; %y += 4)
{
%z = mCeil(getTerrainHeight(%x SPC %y) / 4) * 4;
%m = %z;

for(%w = %x - 4; %w < %x + 5; %w += 4)
{
for(%h = %y - 4; %h < %y + 5; %h += 4)
{
if(%w == %x && %h == %y)
continue;

%m = getMin(%m,mCeil(getTerrainHeight(%w SPC %h) / 4) * 4);
}
}

%c = getMax((%z - %m) / 4,1);

for(%i = 0; %i < %c; %i++)
{
%b = new fxDTSBrick()
{
dataBlock   = brick8xCubeData;
position    = %x SPC %y SPC %z - (%i * 4);
isBasePlate = 1;
isPlanted   = 1;
colorId     = (%i == 0) ? 2 : ((%i < 4) ? 8 : (getRandom(0,49) ? 6 : 1));
};

%b.plant();
LocalClientConnection.brickGroup.add(%b);
}
}
}

Terrain.delete();
}
};
activatePackage(p);

And note i DID not make that script.

Dosent work.

Also where did you find that?

It's not like people can actually play on a map like this without lagging.

Well it's mostly simple square shapes. It would probably lag less than 20,000 trees placed.

yea guys! if you want to play on slopes you can just build it!

Pretty sweet code there. Fixed up the colorid's and ban it works. Just i doubled the size and i got a runtime error after ghosting the rest of the bricks lol.


I can see this being used as a nostalgia tool :D
Just make sure someone keeps some backups of the maps somewhere. We don't want to suddenly lose the Slopes for ever :c

brainfart
why dont we take the slopes
and make it a brick!
so you just place the slopes anywhere you want!
errr
dddd

Will this ever be released?

Make it place 1x1 and you are a god.