Blockland Forums > Modification Help

Checking if a brick is completely covered by another brick.

Pages: (1/2) > >>

otto-san:

I want to know if the the above brick to completely covers a brick below it.

I tried scratching my head for a bit and messing around with some world box vector math stuff, but I can't seem to get it quite right.

Treynolds416:

I found these in a posted console dump.
   virtual int getExposedAreaTop() {}
   virtual int getExposedAreaBottom() {}
Never used them before, tell me how they work.

If they don't work, you can try getWorldBox() and getWorldBoxCenter() to get the center point and vertex points. I've never used getWorldBox() either, so I'm not sure if it returns points or not

Greek2me:

Here's some useful functions:


Exposure:
%brick.getExposedAreaBottom() - ()
%brick.getExposedAreaEast() - ()
%brick.getExposedAreaNorth()
%brick.getExposedAreaSouth() - ()
%brick.getExposedAreaTop() - ()
%brick.getExposedAreaWest() - ()

%brick.iloveposed() - ()exposed = no bricks attached to one end

Up/Down Bricks
%brick.getUpBrick() - (int index)Returns up brick at given index.
%brick.getDownBrick() - (int index)Returns down brick at given index.
%brick.getNumDownBricks() - ()Returns number of bricks in downlist.
%brick.getNumUpBricks() - ()Returns number of bricks in uplist.

%brick.dumpDownList() - ()Dumps the downbrick list.
%brick.dumpUpList() - ()Dumps the upbrick list.

Path-to-Ground
%brick.getDistanceFromGround() - Returns number of connections away from the ground
%brick.hasFakePathToGround() - ()Returns true if brick is attached to a baseplate (considers blown-up bricks to be dead).
%brick.hasPathToGround() - ()Returns true if brick is attached to a baseplate.

%brick.willCauseChainKill() - () returns true if killing this brick will cause others to fall

otto-san:

I've already considered all those functions and none of them seem to be any help.

I was surprised getExposedArea didn't help. It just said 0 each time.



--- Quote from: Treynolds416 on April 28, 2012, 01:26:14 PM ---If they don't work, you can try getWorldBox() and getWorldBoxCenter() to get the center point and vertex points. I've never used getWorldBox() either, so I'm not sure if it returns points or not

--- End quote ---

--- Quote from: otto-san on April 28, 2012, 01:06:58 PM ---I tried scratching my head for a bit and messing around with some world box vector math stuff, but I can't seem to get it quite right.

--- End quote ---
derp

Greek2me:


--- Quote from: otto-san on April 28, 2012, 02:41:29 PM ---I've already considered all those functions and none of them seem to be any help.

I was surprised getExposedArea didn't help. It just said 0 each time.

--- End quote ---

Strange, they only seem to work on ghost bricks...

Pages: (1/2) > >>

Go to full version