Author Topic: Making a brick invisible.  (Read 1943 times)

Is there a colour that sets the brick invisible, I done %brick.setColor(-1); it worked but gives a console error and any colour that doesn't exist just starts at 0 again and gives a console error.

I think -1 would be a paint can colour that doesn't exist.

Have you tried using a hex code or something similar?

I just had an idea to edit the function giving the error so that it doesn't.

The brick color that currently works best for invis is 255 255 255 1.

From Space Guy's Trapbrick mod:
PLEASE NOTE THAT ALL CODE TAKEN FROM THIS MOD FALLS UNDER SPACE GUY'S SPECIAL LISCENSE THINGY MABOBBER SO BASICLY ITS COPYRIGHTED, SO PLEASE DONT USE WITHOUT HIS PERMISSION OR I MIGHT GET IN TROUBLE FOR IT. USE AT YOUR OWN RISK:
lines:917-919, from explosion trap brick, all rights reserved 2007 Space Guy:
Code: [Select]
  %item.spawnbrick.setcolor(63);//ALL RIGHTS RESERVED 2007 SPACE GUY INC.
  %item.spawnbrick.setcolliding(0);// PLEASE DONT SUE ME
  %item.spawnbrick.setraycasting(0);// USE AT OWN RISK

Thanks, rkynick, but that was the issue MrPickle was trying to deal with in the first place: color 63 is not invisible on everyone's color mods.

There's no way to set a bricks colour to one that isn't in the current paint set.

Sure there is.  <brick>.setColor(-1); works just fine (minus the error), but it's not in any color set.

Sure there is.  <brick>.setColor(-1); works just fine (minus the error), but it's not in any color set.

Yeah but, invisible isn't technically a colour. You can't set a hex value of the colour or something like that.

There's no way to set a bricks colour to one that isn't in the current paint set.

I was replying to your quote.

In the example setColor(1);, "1" isn't a color either, but it refers to a color in the current paint set.  setColor(-1) provides the same sort of reference, but there's no defined color for -1.  So, yes you can set a brick's color to one that isn't in the current color set, if you're talking about setColor(), which we have been since the beginning of the topic.

There's no way to set a bricks colour to one that isn't in the current paint set.

I was replying to your quote.

In the example setColor(1);, "1" isn't a color either, but it refers to a color in the current paint set.  setColor(-1) provides the same sort of reference, but there's no defined color for -1.  So, yes you can set a brick's color to one that isn't in the current color set, if you're talking about setColor(), which we have been since the beginning of the topic.

Yes I know, I was saying you can't set it to a colour. I know the numbers represent the colours in the table, and -1 is out of that so it sets it invisible because there's no colour for it. That's what I was saying.

Well, in theory, -1 could represent "0 0 0 0" or "255 255 255 0" or any combination of RGB values in between.

-1 changes the bricks colour to "RGB 0" but gives a console error.

Ok this didn't work:

Code: [Select]
function getColorIDTable(%color){
if(%color $= -1){
%c = "0.000000 0.000000 0.000000 0.000000";
return %c;
}
parent::getColorIDTable(%color);
}

It is in a package.
« Last Edit: November 13, 2007, 11:52:06 AM by MrPickle »

getColorIDTable() is only used by scripting and mods (i.e. Skis), not the actual brick rendering system.

Tried anything like color 72 or something which won't exist higher than the last color of the palette?

getColorIDTable() is the function giving me the error.

Any colour that doesn't exist gives me the same error and just start from 0 again.