Author Topic: Learning about brickgroups  (Read 686 times)

Hi, I'm wanting to understand what brickgroups are and how to properly use them; here is what I'm essentially wanting to do:
  • Load some bricks
  • Make a certain bunch of bricks be of a different brickgroup (the red ones highlighted in that image for example)
  • Be able to change the bricks in the other brickgroup, such as changing their rendering and collision

(click for larger)


I assume that I can't do:
Code: [Select]
serverDirectSaveFileLoad("saves/blah.bls", 3, "", 2));to load bricks with different brickgroups (but i could be wrong)

Would I use a for loop for each brick?
Could I name each brick the same name and use the for loop on them?

You would package fxDtsBrick::onLoadPlant(%this) I believe.

  • Load some bricks
serverDirectSaveFileLoad, combined with fxDtsBrick::onLoadPlant package if you want to change the bricks

  • Make a certain bunch of bricks be of a different brickgroup (the red ones highlighted in that image for example)
BrickGroup_<id>.add(brick);

  • Be able to change the bricks in the other brickgroup, such as changing their rendering and collision
%count = BrickGroup_<id>.getCount()
for(%i=0;%i<%count;%i++)
{
    BrickGroup_<id>.getObject(i).setCollision(0)
}
etc