ok how does new fxDTSBrick work

Author Topic: ok how does new fxDTSBrick work  (Read 792 times)

see title
sorta like this except I know the syntax already works I'm just replacing things in someone else's code
new fxDTSBrick
{
 client = %cl
 ownership = %cl.bl_id
}
it looks sorta like that except with a bunch more variables I currently don't care about because they work and I'm not touching them.
So, the question here is, what can I replace %cl with if I want to replace %cl.bl_id with, say, 999998? I want to have all bricks created by this belong to a specific ID so I can easily clear them. (Like how public bricks are under either 888888 or 999999, I can't remember which.)

please note that I have no real knowledge of Torque in specific (all I've done and plan to do is modify other addons to make them do something a BIT different), but I have worked in Gamemaker and a few other languages in varying amounts.
« Last Edit: December 29, 2016, 09:24:26 AM by SuperSuit12 »

You'll need a semicolon because you're creating an object.

The only thing you really need inside the brackets is the name of the datablock of the brick you want to create, and then the position. You can also set its color with colorID, which is the paint ID.
After its created you should call .plant() and setTrusted(true) on it and add it to a brickgroup.

set the client to -1,
bricks don't have an "ownership" variable so remove that,
insert the brick into BrickGroup_999998 after creating it and before calling plant()

you create the brick group like this:

if(!isObject(BrickGroup_999998))
{
   new SimGroup(BrickGroup_999998)
   {
      client = -1;
      name = "BL_ID: 999998";
      bl_id = 999998;
   };

   MainBrickGroup.add(BrickGroup_999998);
}

Dangit, I goofed in re-writing that part. It was stackBL_ID, not ownership. Oops.
I said the syntax was probably wrong and that that wasn't exactly what I was using. You've probably answered my question (client is -1 for a nonexistent user) but here's the original code I'm trying to modify. Ghost made this, not me, I'm trying to mess with the mining system to make it belong to a specific user and not just anyone who goes mining.
Code: [Select]
%newBr = new fxDTSbrick()
{
position = %pos;
rotation = %rot;
scale = "1 1 1";
datablock = %db;

angleID = %ang;
colorID = %col;
printID = 0;
colorFXID = 0;
shapefxID = 0;

isBasePlate = true;
isPlanted = true;
//this is what I'm changing, client and stackBL_ID
client = %cl;
stackBL_ID = %cl.bl_id;
};

man this is harder than I thought but I think I about have it figured out
Ghost is already inserting it into a Brick Group (%BG) and that's my issue. I'll try creating a new brickgroup.

EDIT: okay, I've got it putting bricks into a brickgroup, but it's making a new one and deleting the old one every time.
« Last Edit: December 29, 2016, 01:18:54 PM by SuperSuit12 »