| Blockland Forums > Modification Help |
| Plant a brick on top of another? |
| (1/1) |
| Greek2me:
We have a project going on over at SS, but we aren't sure how to plant one brick on top of another. How is this done so that they are structurally connected? EDIT: This is the current code: https://etherpad.mozilla.org/ep/pad/view/ro.0MRCP6Rc-iy/latest |
| Treynolds416:
Psuedocode: --- Code: ---function isSupported(%pos,%brickData) { %bounds = %brickData.brickSize; //Would be a 3 component vector in this case, not sure what .brickSize actually returns //Check if there is another brick in the current space the new brick is about to occupy %minorBox = containerFindFirst($TypeMasks::Brick,%pos,getWord(%bounds,0) - 0.01,getWord(%bounds,1) - 0.01,getWord(%bounds,2) - 0.01); if(%minorBox != 0) return -1; //Now check if there is a brick directly above or below the space the new brick is about to occupy %majorBox = containerFindFirst($TypeMasks::Brick,%pos,getWord(%bounds,0),getWord(%bounds,1),getWord(%bounds,2) + 0.01); if(%majorBox != 0) return 1; return -1; } --- End code --- Based mostly on speculation, trying to write this from my iPhone without testing anything in BL |
| Greek2me:
Fixed. http://scatteredspace.com/forum/index.php?topic=2443.msg41912#msg41912 |
| Navigation |
| Message Index |