Access SimSet(SimGroup?) of bricks on the server

Author Topic: Access SimSet(SimGroup?) of bricks on the server  (Read 1797 times)

Is it possible to access the SimSet of bricks (Or is it SimGroup? whatever), on the server in an event, without the ClassName of the event being fxDTSBrick?

This is an output event.

On a connected note, is there a way to plant a brick and then call getGroup() on it?

If you're talking about the bricks themselves, they're located in brick groups. The bricks are added to the owner's brick group, for example mine is: BrickGroup_2143. All the brick groups are stored in MainBrickGroup.
If you meant the data blocks those are in DatablockGroup.

You can type /getID on the brick after placing it and it will print the ID in the chat and from there you can call getGroup on it.

If you're talking about the bricks themselves, they're located in brick groups. The bricks are added to the owner's brick group, for example mine is: BrickGroup_2143. All the brick groups are stored in MainBrickGroup.
If you meant the data blocks those are in DatablockGroup.

You can type /getID on the brick after placing it and it will print the ID in the chat and from there you can call getGroup on it.

Re-read his post.

@OP, I'm sure there is a way, I just don't have the time to tinker and find out, maybe some one else knows.

@OP, I'm sure there is a way, I just don't have the time to tinker and find out, maybe some one else knows.

I've been doing a bit of tinkering trying to force a brick to be placed, but I seem to be missing something.  The code below places what appears to be a brick but cant be wrenched/hammered etc.
Code: [Select]
%hackyBrick = new fxDTSBrick()
{
datablock = brick1x1x4Data;
isPlanted = true;
client = %client;

position = "0 0 2";
rotation = "0 0 0";
angleId = true;

colorID = 0;
colorFxID = 0;
shapeFxID = 0;

printID = 0;
};

you need to call %hackybrick.plant(); (which returns an integer if planting is successful - 0 means no error, rest can be figured out through trace/searching) then after adding it to a brickgroup do %hackybrick.setTrusted(1); if you want trust checks to work when building on it

FYI

A SimGroup is like a SimSet except when you add objects to one, if those objects are in a different SimGroup, they will be removed from their previous SimGroup, so SimObjects may only exist in one SimGroup at a time, whereas SimObjects may exist in several SimSets simultaneously

99% of the time you are just going to want to use SimSets

If you're talking about the bricks themselves, they're located in brick groups. The bricks are added to the owner's brick group, for example mine is: BrickGroup_2143. All the brick groups are stored in MainBrickGroup.
then after adding it to a brickgroup do %hackybrick.setTrusted(1);
Is there a function to add it to MainBrickGroup?  It successfully plants but when I hammer it I get
Code: [Select]
ERROR: SimGroup::getTrustFailureMessage(MissionCleanup [12635]) - brickgroup is not in the main brick group
BackTrace: ->HammerImage::onFire->HammerImage::onHitObject->GameConnection::sendTrustFailureMessage->SimGroup::getTrustFailureMessage

You need to add it to one of the groups within mainBrickGroup.

may be helpful information:
BrickGroup_888888 is the public brickgroup, if you want to get a client's brickgroup, %client.brickgroup works. i think getBrickGroupFromObject(%obj) is a function as well, but it's been a while and i may be wrong on that

%group.add(%obj); is all you gotta do to add an object

may be helpful information:
BrickGroup_888888 is the public brickgroup, if you want to get a client's brickgroup, %client.brickgroup works. i think getBrickGroupFromObject(%obj) is a function as well, but it's been a while and i may be wrong on that

%group.add(%obj); is all you gotta do to add an object
%client.brickgroup is exactly what I need right now.  Sweet.

You need to add it to one of the groups within mainBrickGroup.
Added it to BrickGroup_19639 and everything seems to work!

Thanks for all the help guys!!
Edit: Holy stuff it actually works.
« Last Edit: January 13, 2017, 01:41:35 PM by DaBlocko »

btw, if you want to make a brickgroup, just create a simGroup and add it to mainBrickGroup

example:
%bg = new SimGroup(Brickgroup_helloWorld) {
    name = "name shows up in clear bricks list and in header of wrenched bricks";
    bl_id = something;
//other params can be found if you call dump(); on a client's brickgroup
};
« Last Edit: January 19, 2017, 04:41:57 PM by Conan »

btw, if you want to make a brickgroup, just create a simGroup and add it to mainBrickGroup

example:
%bg = new Brickgroup(Brickgroup_helloWorld) {
    name = "name shows up in clear bricks list and in header of wrenched bricks";
    bl_id = something;
//other params can be found if you call dump(); on a client's brickgroup
};

Brickgroup is not a class; just use SimGroup or ScriptGroup. Ex:

%bg = new ScriptGroup(BrickGroup_Hello) {
   name = "";
   bl_id = 15144;
};

Brickgroup is not a class; just use SimGroup or ScriptGroup. Ex:

%bg = new ScriptGroup(BrickGroup_Hello) {
   name = "";
   bl_id = 15144;
};

woops, mistake. you're absolutely right of course. fixed.