Author Topic: Planting a brick regardless of plant errors  (Read 1770 times)

That wont let me place at all?!
At all or only when force planting?

At all or only when force planting?
at all, no plant animation is played, and nothing happens to the brick

Code: [Select]
Parent::servercmdPlantbrick(%brick);
function serverCmdFPToggle(%client) {
if(isObject(%client.player))
{
      if(%client.isForcePlacing){
         %client.chatmessage("<color:ffffff>ForcePlace is on!");
         %client.isForcePlacing = 0;}
      else {
         %client.chatmessage("<color:ffffff>ForcePlace is off!");
         %client.isForcePlacing = 1;}
   }
}

package forcePlant {
function serverCmdPlantBrick(%client)
{
if(%client.isForcePlanting)
{
%temp = %client.player.tempBrick;
%temp.setName("CopyBrick");
%brick = new fxDTSBrick(CopiedBrick:CopyBrick)
{
isPlanted = 1;
}.setName("");
%tempBrick.setName("");
%brick.setTrusted(1);
%brick.plant();
return;
}
Parent::servercmdPlantbrick(%client);
}
};
activatePackage(forcePlant);


This lets me plant bricks, but not force plant

This lets me plant bricks, but not force plant
Oh, duh. I left that line alone from your code. Didn't notice.

Code: [Select]
function serverCmdFPToggle(%client) {
if(isObject(%client.player))
{
      if(%client.isForcePlacing){
         %client.chatmessage("<color:ffffff>ForcePlace is on!");
         %client.isForcePlacing = 0;}
      else {
         %client.chatmessage("<color:ffffff>ForcePlace is off!");
         %client.isForcePlacing = 1;}
   }
}

package forcePlant {
function serverCmdPlantBrick(%client)
{
if(%client.isForcePlanting)
{
%temp = %client.player.tempBrick;
%temp.setName("CopyBrick");
%brick = new fxDTSBrick(:CopyBrick)
{
isPlanted = 1;
};
%tempBrick.setName("");
%brick.setTrusted(1);
%brick.plant();
return;
}
Parent::servercmdPlantbrick(%client);
}
};
activatePackage(forcePlant);
This works for me (I fixed a small issue but it should have still planted). Are you sure you're toggling FP on?

Oh, duh. I left that line alone from your code. Didn't notice.

Code: [Select]
-snip-This works for me (I fixed a small issue but it should have still planted). Are you sure you're toggling FP on?
on and off are swapped
Also, This doesn't work for me...
I can place bricks normally, but not floating or inside other bricks...
« Last Edit: November 02, 2012, 07:46:08 PM by MARBLE MAN »

on and off are swapped
Also, This doesn't work for me...
I can place bricks normally, but not floating or inside other bricks...
Oh, duh. You're setting %client.forcePlacing = 1; in serverCmdFPToggle and checking %client.forcePlanting in serverCmdPlantBrick. The reason it worked for me was because I manually set the value.

Oh, duh. You're setting %client.forcePlacing = 1; in serverCmdFPToggle and checking %client.forcePlanting in serverCmdPlantBrick. The reason it worked for me was because I manually set the value.
* MARBLE MAN has just died after doing this:
package forcePlant {
function serverCmdPlantBrick(%client)
{
if(%client.isForcePlanting)
{
%temp = %client.player.tempBrick;
%brick = new fxDTSBrick(NewBrick)
{
angleID = %temp.getAngleID();
client = %temp.getClient();
ColorFXID = %temp.getColorFXID();
colorID = %temp.getColorID();
datablock = %temp.getDatablock();
isBasePlate = "0";
isPlanted = "1";
position = %temp.getPosition();
printID = %temp.getPrintID();
rotation = %temp.getRotation();
scale = %temp.getScale();
shapeFXID = %temp.getShapeFXID();
stackBL_ID = %client.blid;
}.setName("");
%brick.setTrusted(1);
%brick.plant();
return %brick;
}
Parent::servercmdPlantbrick(%client);
}
};
activatePackage(forcePlant);


and it still wouldn't have worked XC
Thanks though for pointing that out
« Last Edit: November 02, 2012, 07:58:06 PM by MARBLE MAN »

* MARBLE MAN has just died after doing this:
Why would you do that after I told you my way worked?

Anyway, in case you didn't figure it out:
Code: [Select]
function serverCmdFPToggle(%client) {
if(isObject(%client.player))
{
      if(%client.isForcePlanting){
         %client.chatmessage("<color:ffffff>ForcePlant is now off!");
         %client.isForcePlanting = 0;}
      else {
         %client.chatmessage("<color:ffffff>ForcePlant is now on!");
         %client.isForcePlanting = 1;}
   }
}

package forcePlant {
function serverCmdPlantBrick(%client)
{
if(%client.isForcePlanting)
{
%temp = %client.player.tempBrick;
%temp.setName("CopyBrick");
%brick = new fxDTSBrick(:CopyBrick)
{
isPlanted = 1;
};
%tempBrick.setName("");
%brick.setTrusted(1);
%brick.plant();
return;
}
Parent::servercmdPlantbrick(%client);
}
};
activatePackage(forcePlant);

Why would you do that after I told you my way worked?

Anyway, in case you didn't figure it out:

lol, thanks :D

Why would you do that after I told you my way worked?

Anyway, in case you didn't figure it out:
Code: [Select]
-codesnip-
Correct me if I'm wrong, but, doesn't this cause the bricks that you plant to have no owner, or, be outside of the main brickgroup?

Correct me if I'm wrong, but, doesn't this cause the bricks that you plant to have no owner, or, be outside of the main brickgroup?
It does. It wasn't supposed to be 'ready to go' code, that's just giving him the answer. I figured I'd give him just enough so that he wouldn't be frustrated.