Author Topic: Spawn bricks with an ownership  (Read 841 times)

I have something that spawns bricks behind it and whatever I try it wont add the id. please help.
« Last Edit: June 14, 2011, 01:20:44 AM by cciamlazy »


example code?

console errors?

I don't really have a code cause i deleted it but I need to have to spawn with an id so i can clear it.

You mean the brick has no owner? We don't get what you're trying to do.

well it cant really tell what it will be but yes it needs a brick ownership.

I'll assume he has code which spawns a brick (no idea why, how, or for what reason) but it appears to be under "no ownership." He's trying to get ownership on it, but cannot figure out how.

If I'm wrong, correct me.

Just a tip for the future, don't be so vague. The more straight-forward the question the better response you'll get. If you don't know what you are trying to do, you can't ask questions and therefore you shouldn't be making topics; unless you're trying to ask for ideas, in which case they shouldn't be posted here. ;)

If you're "borrowing" code or viewing the code and cannot figure out what it does (I suspect it might be this) post the bit of code you don't understand and simply ask, "What does this do?"

I have something that spawns bricks behind it and whatever I try it wont add the id. please help.
Okay, so you have something (a plane maybe?) that as it moves, bricks are planted behind it, but they have no owner. You need the bricks to be owned by the person (driving the plane?).

Try adding the bricks to the person's brickgroup and see what happens. You'd do that like so:
%client.brickGroup.add(%brick);

Code: [Select]
%brick = new fxDTSBrick()
{
  position = position here;
  client = %client;
};
%brick.plant();
isn't it

Code: [Select]
%brick = new fxDTSBrick()
{
  position = position here;
  client = %client;
};
%brick.plant();
isn't it
Sure, if you don't mind not getting a brick.


With pretty much everything that has an actual physical object, you NEED a datablock. In this case, that's any fxDtsBrickData object. Let's use brick2x2fData...

Code: [Select]
%brick = new fxDtsBrick()
{
   datablock = brick2x2fData;
   position = "0 0 10";
   angleID = 0; //Not actually needed here because this brick is the same all four ways, but this is how to turn it.
   client = %client;
   isPlanted = 1;
};
%brick.plant();
%client.brickgroup.add(%brick);

lol

that was silly of me