Author Topic: Brick use reduction script.  (Read 7538 times)

Ooh i was thinking about the possibility of this after some gameplay at trecnh wars stuff.
Good idea! :D

Just add a simple option to ignore evented bricks. So if you have a wall of 1x1 bricks and one of them is evented, the script will leave that brick as is and just join together the rest.

Just add a simple option to ignore evented bricks. So if you have a wall of 1x1 bricks and one of them is evented, the script will leave that brick as is and just join together the rest.
^yes

I had a loving great idea to make this a lot easier to make, and a smaller script too...
Instead of say making this code over and over again for each brick combo to check for:
Code: [Select]
if(%northsouth.dataBlock $= "brick1x4Data" && isrot(%brick) && isrot(%northsouth))
{
if(getword(%brick.position,1) > getword(%northsouth.position,1))
makebrick("brick1x6Data",addvec(%brick.position,1,-1),%brick.color,0,%brick.client);
else
makebrick("brick1x6Data",addvec(%brick.position,1,1),%brick.color,0,%brick.client);
%brick.delete();
%northsouth.delete();
}
if(%eastwest.dataBlock $= "brick1x4Data" && !isrot(%brick) && !isrot(%eastwest))
{
if(getword(%brick.position,0) > getword(%eastwest.position,0))
makebrick("brick1x6Data",addvec(%brick.position,0,-1),%brick.color,1,%brick.client);
else
makebrick("brick1x6Data",addvec(%brick.position,0,1),%brick.color,1,%brick.client);
%brick.delete();
%eastwest.delete();
}

I could simply loop though a list of things are replace certain feilds there with the correct values, and make a function to add things to the list easily.
The result is like this:
Code: [Select]
addbrickreductioncheck_2dstr("brick1x2Data","brick1x8Data",2,"brick1x10Data");
addbrickreductioncheck_2dstr("brick1x2Data","brick1x6Data",1.5,"brick1x8Data");
addbrickreductioncheck_2dstr("brick1x2Data","brick1x4Data",1,"brick1x6Data");
addbrickreductioncheck_2dstr("brick1x2Data","brick1x2Data",0.5,"brick1x4Data");
addbrickreductioncheck_2dstr("brick1x3Data","brick1x3Data",0.75,"brick1x6Data");
addbrickreductioncheck_2dstr("brick1x4Data","brick1x4Data",1,"brick1x8Data");
addbrickreductioncheck_2dstr("brick1x6Data","brick1x6Data",1.5,"brick1x12Data");
addbrickreductioncheck_2dstr("brick1x8Data","brick1x8Data",2,"brick1x16Data");

I just made this whole process a hell of a lot easier, and the script a lot smaller.


Just add a simple option to ignore evented bricks. So if you have a wall of 1x1 bricks and one of them is evented, the script will leave that brick as is and just join together the rest.
Already done.
« Last Edit: April 16, 2011, 03:12:19 PM by DrenDran »

Dude your a life saver ive been needed one of these!


I love you clanmaster

Gee, this thread is just great for my ego, anyway, I'm gonna go host this on my server to test it, and hopefully get some suggestions too.

Simple er would be to add new options in the wrench menu,like:

Ignore Brick Reduction

or something.

Well, I've been testing it out, for example on the default save "sirrus milatary base" it reduces about 2500 bricks, and doesn't look too different after.
Should I release a beta here, today?



I ran it on some of the default builds, and here is how many bricks were reduced:

Afghan - 195
Sirrus - 2424
Maze - 40
Festung - 1405
CTF - 240
Crysta - 2071
Arch - 132

Hmm, but now some lovey brick walls are now very flat walls. ;)

Hey, you should make it not touch a certain color of bricks that's very obscure, so you could color your relayed bricks that color as to avoid any mess-ups.