How do i detect the Sub catergory of a brick?

Author Topic: How do i detect the Sub catergory of a brick?  (Read 2163 times)

So last week i opend a topic about detecting if it were hitting a certain brick type but now i need to check if it is hitting the certain type of brick heres the code

Code: [Select]
function serverCmdLight(%client, %brick)
{
%player = %client.player;

    if(!isObject(%object = getWord(containerRaycast(%player.getEyePoint(), vectorAdd(%player.getEyePoint(), vectorScale(%player.getEyeVector(), 7)), $TypeMasks::FxBrickObjectType),0)))
        return;

    if(%object.getDatablock() == ScrapElectronicsBrickData.getID())
{
%client.backPack["ScrapElectronics"]++;
%client.backPack["Weight"] += 2;
echo(%client.backPack["ScrapElectronics"]);
}
There is nothing wrong with this code i just need to know what i change getDatablock() to

Dump a brick datablock, and see what you can find.

?? i already can find out if its hitting a brick type i need to see if its a brick sub category

Yeah, get a brick datablock, and do .dump(); on it. That'll give you a list of variables and functions it has so you can find out how to get its category and subcategory.

?? i already can find out if its hitting a brick type i need to see if its a brick sub category
Basically the datablock has the info of the category, ui name, and the place sub category.

Im also looking for how i would make a brick disapear for a certain amount of time how would i do this?

and also is it possible to replace change a bricks model?

EDIT: I tryed %brick.setRendering(0); but it dosnt work
« Last Edit: July 15, 2015, 07:13:54 PM by SuperFlaminninja³ »

and also is it possible to replace change a bricks model?
what?


P.S Dog humper
Leave that for non-serious boards like the Off-Topic.

What do you mean by changing a brick's model?

Lol


Like a brick that is a "Dog" and when you click the "Dog" it changes to a diffrent brick model lets say it has you in it
( ͡° ͜ʖ ͡°)

...
kind of considering not helping him because of that



try looking at the default chest/doors

...
kind of considering not helping him because of that



try looking at the default chest/doors
Lol ok i will leave that to off topic, Thanks any help with others?

I'm kinda confused on what you're really trying to find. What are you looking for?

I'm kinda confused on what you're really trying to find. What are you looking for?
Forget about the brick models i dont need that, I need this

Im also looking for how i would make a brick disapear for a certain amount of time how would i do this?

EDIT: I tryed %brick.setRendering(0); but it dosnt work

Forget about the brick models i dont need that, I need this


%brick.disappear(time);

In future cases, do this:
Dump a brick datablock, and see what you can find.