Author Topic: add all bricks to brickgroup_#######  (Read 1383 times)

i need to be able to add all bricks on the server over to a certain brickgroup so it can be cleared later. any way via code to do this

Code: [Select]
for(%i = 0; %i < MainBrickGroup.getCount(); %i++)
{
%brickgroup = MainBrickGroup.getObject(%i);

if(%brickgroup.bl_id == 999999)
continue;

%count = %brickgroup.getCount();
for(%x = %count - 1; %x >= 0; %x--)
BrickGroup_999999.add(%brickgroup.getObject(%x));
}

looks like that would add them to one brickgroup from another, but won't remove it from the old brickgroup
would that end up in the server brickcount being larger than it should be?
what would happen when clearing the bricks from the brickgroup, would it still be in the other one?

looks like that would add them to one brickgroup from another, but won't remove it from the old brickgroup
would that end up in the server brickcount being larger than it should be?
what would happen when clearing the bricks from the brickgroup, would it still be in the other one?
objects can be in only one simgroup/scriptgroup at any given time. they can be in multiple simsets/scriptsets (???) at any given time, regardless of group status.

edit: to clarify, adding an object to a group immediately removes it from the one it was previously part of.
« Last Edit: July 11, 2017, 09:30:39 AM by Conan »

Change Ownership

It's not script based, but at least you can do it pretty quickly with no to minor lag. Of course, you need to do it on all brick groups manually.

One other solution would be to save the bricks with no ownership and then load them.

objects can be in only one simgroup/scriptgroup at any given time. they can be in multiple simsets/scriptsets (???) at any given time, regardless of group status.
lol scriptsets - but yes that is correct objects can be in more than 1 simset, but can only be in 1 simgroup, once you add the object to another simgroup it's automatically removed from it's last simgroup

i still dont get why simsets/simgroups and scriptgroups exist alongside each other. is there an underlying difference between the two types, in its implementation or functionality?

i still dont get why simsets/simgroups and scriptgroups exist alongside each other. is there an underlying difference between the two types, in its implementation or functionality?

Script groups receive the onAdd and onRemove callbacks while sim groups do not.

Script groups receive the onAdd and onRemove callbacks while sim groups do not.

ScriptGroups (should?) also support the class and superClass fields, like ScriptObjects but unlike SimGroups.

ScriptGroups (should?) also support the class and superClass fields, like ScriptObjects but unlike SimGroups.

I actually didn't know this. I've always presumed that it'll work as I've used ScriptObject all the time a it suited the best.