Author Topic: Correct way to delete a brick? Lots of lag?  (Read 950 times)

Alright, so at first I was deleting 800-1000 bricks with .killBrick();
I'd loop through all the ones that I had built and then call this on each of them. The weird thing? About 10 seconds later, I'd get a massive lag spike (without the lag at the top right corner but I'm host, soooo).
I had no idea what was causing this until...

I tried then to delete the 800-1000 bricks with .delete();
Now the lag was instantaneous right as I entered the command

Destroying the same amount with the admin wand yields no lag. What am I doing wrong?
Note: There are no GSF bricks, they are all just regular bricks and plates, with one or two, lights, emitters, etc out of all the 800-1000 bricks.

I would imagine that the admin wand doesn't delete all of the bricks on the same tick. Try making some kind of system where they delete in chunks on a schedule instead of all at once.

I would imagine that the admin wand doesn't delete all of the bricks on the same tick. Try making some kind of system where they delete in chunks on a schedule instead of all at once.
BrickGroup_10103.chainDeleteAll();


You can also put the ones you want to delete in a new simGroup(){}; and chaindelete from that

BrickGroup_10103.chainDeleteAll();


You can also put the ones you want to delete in a new simGroup(){}; and chaindelete from that

I shall try this. Do I have to add it to the mainBrickGroup? They get removed from the other fake AIClient SimGroup when I add them to the new one, correct?
« Last Edit: July 19, 2013, 11:33:48 PM by DYLANzzz »

No, you should be able to just do YourSimGroup.chainDeleteAll();

If not (or if you would like more customization or different actions), you can use my SimGroup::chainMethodCall function.

http://forum.blockland.us/index.php?topic=231470.0

I shall try this. Do I have to add it to the mainBrickGroup? They get removed from the other fake AIClient SimGroup when I add them to the new one, correct?
what?
Simgroups have a default command called "ChainDeleteAll"
Just put anything you want deleted in a simgroup and simgroup.chaindeleteAll();simgroup.delete();
That'll delete everything in that group quickly and lag-free

what?
Simgroups have a default command called "ChainDeleteAll"
Just put anything you want deleted in a simgroup and simgroup.chaindeleteAll();simgroup.delete();
That'll delete everything in that group quickly and lag-free
Alright, everything worked, thanks guys.

And Greek, I may end up using that, thanks for positing (for a chainKillBrickAll)

Alright, everything worked, thanks guys.

And Greek, I may end up using that, thanks for positing (for a chainKillBrickAll)

Please use this updated version: http://forum.blockland.us/index.php?topic=237487.0