Author Topic: Brickgroups?  (Read 1690 times)

I am in need of creating a script which includes bricks and by my guesses, brickgroups is orientated around bricks

Can anyone explain to me what a brickgroup is and how I can find out more about it?

A brick group is simply a normal simGroup that contains bricks. The default code looks at attributes such as name and bl_id to display the owner of bricks it contains to clients.

Creating a brick group:
Code: [Select]
%group = new simGroup()
{
     name = "Server";
     bl_id = 50;
};

mainBrickGroup.add( %group );

Adding a brick to a brick group:
Code: [Select]
%group.add( %brick );

Removing a brick from a brick group:
Code: [Select]
%group.remove( %brick );

okay, so I listed the objects within the mainbrickgroup



so if I was to type in BrickGroup_7893.listObjects() it'd return all the ID's of the bricks that have been planted? "Yes".

Right, so now when you put the stuff like name = "server"; into the SimGroup which you created, what other things can there be to change?

« Last Edit: June 30, 2012, 08:00:18 AM by Wordy »

What is needed in a brickgroup?
Just name and ID (If you need, make a new AIConnection to the brickgroup).
Code: [Select]
if(!isObject(BrickGroup_7893))
{
new SimGroup(BrickGroup_23462)
{
name = "Darren";
bl_id = 7893;
};
MainBrickGroup.add(BrickGroup_7893);
}

Now, if you're going to create a new AI Connection, do that:

Code: [Select]
%cl = new AIConnection()
{
name = "Server";
bl_id = 1337;
isAdmin = 1; //Only do that Admin Stuff if you're going to make the AI to use /cmds that is admin only
isSuperAdmin = 1;  //Do whatever you want with those...
isHost = 1; //Depends if you want...
};
if(!isObject(BrickGroup_1337))
{
new SimGroup(BrickGroup_1337)
{
name = "Server";
bl_id = 1337;
client = %cl;
};
MainBrickGroup.add(BrickGroup_1337);
}
// STUFF
%cl.schedule(100,delete); //If you want...

Now tell me, what are you planning to do with BrickGroups?

Btw, Port explained what you needed.
« Last Edit: June 30, 2012, 11:43:26 AM by Cat123 »

What is needed in a brickgroup?
Just name and ID (If you need, make a new AIConnection to the brickgroup).

None of those are necessary.

None of those are necessary.
Congratulations then :P

Creating a brick group:
Code: [Select]
%group = new simGroup()
{
     name = "Server";
     bl_id = 50;
};

mainBrickGroup.add( %group );
Then why did you added name and bl_id here?

take a guess, also i solved this way before you came into it cat; stop trying to confuse the forget out of me

locked