It wouldn't be laggy server-side at all, it'd just be a simple loop.You might see what exactly this does:fxDtsBrick::getUpBrick(%brick, %index) - Returns up brick at given index.
Make sure you recurse all the way up the structure before you start killing things, that might help.
function testTopple(%obj) { if(%obj.getClassName() $= "fxDTSBrick") { for(%i = 0; %i < %obj.getNumUpBricks(); %i++) { %obj.getUpBrick(%i).fakeKillBrick("0 0 0", 15); } } }
I may just be too tired to think, but this is the code I have right now.Code: [Select]function testTopple(%obj) { if(%obj.getClassName() $= "fxDTSBrick") { for(%i = 0; %i < %obj.getNumUpBricks(); %i++) { %obj.getUpBrick(%i).fakeKillBrick("0 0 0", 15); } } }
for(%a=0; %a<buildbot_SavingSO.brickcount; %a++) { if(%a >= $buildbot::maxdup) { buildbot_SavingSO.brickcount = %a; break; } %homebrick = buildbot_SavingSO.brick[%a]; if(%a) //don't want to get bricks below first one. { for(%b=0; %b<%homebrick.getnumdownbricks(); %b++) { %testbrick = %homebrick.getdownbrick(%b); if(buildbot_SavingSO.brickid[%testbrick] $= "") { buildbot_SavingSO.brick[buildbot_SavingSO.brickcount] = %testbrick; buildbot_SavingSO.brickid[%testbrick] = true; buildbot_SavingSO.brickcount++; } } } for(%b=0; %b<%homebrick.getnumupbricks(); %b++) { %testbrick = %homebrick.getupbrick(%b); if(buildbot_SavingSO.brickid[%testbrick] $= "") { buildbot_SavingSO.brick[buildbot_SavingSO.brickcount] = %testbrick; buildbot_SavingSO.brickid[%testbrick] = true; buildbot_SavingSO.brickcount++; } } }
It won't be laggy unless it's a massive structure, and note that there's a limit to the amount of fake killed bricks that will have physics applied to them.