Blockland Forums > Modification Help

Toppling entire structures with fakeKillBrick.

Pages: (1/3) > >>

otto-san:

Correct me if I'm wrong, but shouldn't there be a way to fake kill entire structures, possibly from the baseplate upwards? If there is a way, would it be laggy at all? I mean, certainly, if there are a good amount of bricks, I mean just in general.

Amade:

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.

otto-san:


--- Quote from: Amade on August 29, 2011, 08:51:57 PM ---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.

--- End quote ---
ah yes i had known about getUpBrick but hadn't known what exactly the arguments were.


okay, I think I understand fairly well, I'll try that out. thanks!

edit:
the way i'm doing it is doing is doing a loop for getNumUpBricks and doing fakekill on each object getUpBrick is returning. it's only of course doing the bricks that are literally right atop the brick. that was expected, though.

what can i do to completely topple it efficiently, or am i missing something

Mr. Wallet:

Make sure you recurse all the way up the structure before you start killing things, that might help.

otto-san:


--- Quote from: Mr. Wallet on August 29, 2011, 10:54:17 PM ---Make sure you recurse all the way up the structure before you start killing things, that might help.

--- End quote ---
I may just be too tired to think, but this is the code I have right now.


--- Code: ---function testTopple(%obj) { if(%obj.getClassName() $= "fxDTSBrick") { for(%i = 0; %i < %obj.getNumUpBricks(); %i++) { %obj.getUpBrick(%i).fakeKillBrick("0 0 0", 15); } } }
--- End code ---


Pages: (1/3) > >>

Go to full version