Blockland Forums > Modification Help
Spawning new bricks = multiple problems?
Amade:
--- Quote from: Ipquarx on December 09, 2011, 04:18:48 PM ---Remove the $Server::BrickCount++, %brick.plant does that automatically as far as ive seen, resulting in double the brickcount then there should be.
--- End quote ---
I just checked and this is correct, that line should indeed not be there.
--- Quote from: Ipquarx on December 09, 2011, 04:18:48 PM ---Also, is there any way to prevent a brick from being placed in the same spot through script? I've been working on that problem but I cant figure it out.
--- End quote ---
Try checking the return of %brick.plant();, I think it will give error codes depending on what's wrong
soba:
--- Quote from: Ipquarx on December 09, 2011, 04:18:48 PM ---Also, is there any way to prevent a brick from being placed in the same spot through script? I've been working on that problem but I cant figure it out.
--- End quote ---
You mean when planting the brick, it doesen't plant it in the spot its temp brick spawns it in?
nvm
I can't ctrl+z the bricks once they are planted :(
Amade:
--- Quote from: soba on December 09, 2011, 04:39:05 PM ---You mean when planting the brick, it doesen't plant it in the spot its temp brick spawns it in?
nvm
I can't ctrl+z the bricks once they are planted :(
--- End quote ---
%client.undostack.push(%brick TAB "Plant");
This is the easy way, but will cause undo commands to break each brick one at a time.
soba:
--- Quote from: Amade on December 09, 2011, 04:52:46 PM ---%client.undostack.push(%brick TAB "Plant");
This is the easy way, but will cause undo commands to break each brick one at a time.
--- End quote ---
I wish for the whole minifig brick to get rid of all its body parts upon broken, if possible
also, only the left foot plants now
package MinifigBrick
{
function fxDTSbrick::PlantedTrustCheck(%brick)
{
Parent::PlantedTrustCheck(%brick);
if(%brick.GetDatablock().getName() $= brickMinifigV2Data)
{
%pos = %brick.position;
%rot = %brick.rotation;
%colorID = %brick.colorID;
%owner = %brick.client;
%brick.delete();
%LeftShoe = new fxDTSbrick()
{
datablock = "brickLeftShoeData";
isPlanted = 1;
position = %pos;
rotation = %rot;
colorID = %colorID;
client = %owner;
};
%LeftShoe.setTrusted(1);
%LeftShoe.plant();
if(%owner.brickGroup)
{
%owner.brickGroup.add(%LeftShoe);
}
return %LeftShoe;
%RightShoe = new fxDTSbrick()
{
datablock = "brickRightShoeData";
isPlanted = 1;
position = %pos;
rotation = %rot;
colorID = %colorID;
client = %owner;
};
%RightShoe.setTrusted(1);
%RightShoe.plant();
if(%owner.brickGroup)
{
%owner.brickGroup.add(%RightShoe);
}
return %RightShoe;
}
}
};
ActivatePackage(MinifigBrick);
I know that a % variable is replaced really easily, so I tried duplicating what the left shoe used and having it plant the right shoe with a different variable for each brick, no luck
Amade:
Take out the return lines, those will stop the function.