Blockland Forums > Modification Help
Spawning a brick directly above another
Amade:
--- Quote from: otto-san on October 08, 2011, 12:58:52 AM ---Shouldn't you set the brick to trusted before planting it or does it not make a difference?
--- End quote ---
I can't imagine it would matter.
Space Man:
Thanks Amade that works for the z.
Would it be possible to do the same for x and y too.
(i tried with bricksizex * 0.2 but it didnt seems to work like bricksizez * 0.2)
otto-san:
--- Quote from: Space Man on October 08, 2011, 06:21:36 AM ---Thanks Amade that works for the z.
Would it be possible to do the same for x and y too.
(i tried with bricksizex * 0.2 but it didnt seems to work like bricksizez * 0.2)
--- End quote ---
yes
--- Code: ---function fxDTSbrick::UpDuplicate(%this)
{
%xsize = %this.getDatablock().brickSizeX * 0.2;
%pos = vectorAdd(%this.getPosition(), %xsize SPC "0 0");
%brick = new FxDTSbrick()
{
datablock = %this.getDatablock();
position = %pos;
rotation = %this.rotation;
colorID = %this.colorID;
scale = "1 1 1";
angleID = %this.angleID;
colorFxID = %this.colorFxID;
shapeFxID = %this.shapeFxID;
isPlanted = 1;
client = %this.client;
};
%brick.plant();
%brick.setTrusted(1);
if(isObject(%this.getGroup()))
{
%this.getGroup().add(%brick);
}
$Server::BrickCount++;
return %brick;
}
--- End code ---
Space Man:
thank you all.
Amade:
In the line %xsize = %this.getDatablock().brickSizeX * 0.2; you need to change that 0.2 to a 0.5 if you're not using the Z axis, or it won't line up right (especially for larger bricks).