Blockland Forums > Modification Help
function to spawn bricks?
<< < (2/2)
Conan:
changing isPlanted after the brick is created will NOT have the desired effect - must call %brick.plant(); if you want it to change

brick.setTrusted(1) is required for any created bricks that stick around as not calling it will create a 1 stud/brick zone around the brick that you cannot plant/build in. havent experimented enough with it to figure out the details, but basically if you create a brick you have to call that if you're not going to delete the brick immediately due to some other reason (ex, trust check failing).

%brick.plant should be called AFTER adding it to the brickgroup i believe since a number of special bricks (like the spawn brick) interact with the brickgroup the brick is part of - namely, calling certain functions to make sure the brickgroup knows the spawn brick exists. same goes for named bricks: however, the format for named bricks is "_name" so if you're creating named bricks make sure to include an _ prefixing the name.

a brick's position is the center of the brick bounds. the brick grid works on the dimensions of 0.5 x 0.5 x 0.2 (the dimensions of a plate), and the global position 0 0 0 is in the center of a 2x2 stud area (eg not in the middle of a stud). putting invalid positions into a brick when creating it wont cause problems - the brick will just snap to the closest valid location from that position.
Navigation
Message Index
Previous page

Go to full version