Author Topic: 2x2Cube Print  (Read 1534 times)

Ok, well, me and my friend have been working on a minecraft brick, however, hes having trouble getting all the bricks to work at once

"I place one brick the other deletes, and blockland considers the print bricks to be floating no matter if they are touching any bricks or on the ground"

datablock fxDTSBrickData(brickSideFacePrintData)
{
   AlwaysShowWireframe = 1;
   minecraftbrick = 1;
   brickFile = "./SideFace.blb";
   category = "Special";
   subCategory = "";
   uiName = "";
   iconName = "";
        hasPrint = 1;
   printAspectRatio = "2x2f";
};

datablock fxDTSBrickData(brickTopFacePrintData)
{
   AlwaysShowWireframe = 1;
   minecraftbrick = 1;
   brickFile = "./TopFace.blb";
   category = "Special";
   subCategory = "";
   uiName = "";
   iconName = "";
   
        hasPrint = 1;
   printAspectRatio = "2x2f";
};

datablock fxDTSBrickData(brickBottomFacePrintData)
{
   AlwaysShowWireframe = 1;
   minecraftbrick = 1;
   brickFile = "./BottomFace.blb";
   category = "Special";
   subCategory = "";
   uiName = "";
   iconName = "";
   
        hasPrint = 1;
   printAspectRatio = "2x2f";
};
datablock fxDTSBrickData(brickMinecraftData)
{
   brickFile = "./main.blb";
   category = "Special";
   subCategory = "Minecraft";
   uiName = "Minecraft Brick";
   iconName = "";
};
function FxDTSBrick::CreateMinecraftBrick(%this)
{
   if($MinecraftBrickCount $= "")
   {
      $MinecraftBrickCount = 0;
   }
   //0 0 -1 90.0002
   //1 0 0 0
   //0 0 1 90.0002
   //30 0 1 180
   %ID = $MinecraftBrickCount;
   for(%i=0;%i<4;%i++)
   {
      switch(%i)
      {
         case 0:
            %rot = "0 0 -1 90.0002";
         case 1:
            %rot = "1 0 0 0 ";
         case 2:
            %rot = "0 0 1 90.0002";
         case 3:
            %rot = "30 0 1 180";
         default:
            %rot = 0;
      }
      %brick = new fxDTSbrick()
      {
         minecraftid = %id;
         minecraftbrick = 1;
         minecraftside = %i;
         client=%this.client;
         dataBlock="brickSideFacePrintData";
         isPlanted=1;
         position=%this.getposition();
         rotation=%rot;
         scale="1 1 1";
         colorID = %this.getColorId();
         colorFXID = %this.getColorFXId();
         printid = %this.client.lastprint2x2f;
      };
      %this.client.brickgroup.add(%brick);
      %brick.plant();
      %brick.setTrusted(1);
      $Server::BrickCount++;
      %sides = %sides SPC %brick;
   }
   %brick=new fxDTSbrick()
   {
      minecraftid = %id;
      minecraftbrick = 1;
      minecraftside = %i;
      client=%this.client;
      dataBlock="brickTopFacePrintData";
      isPlanted=1;
      position=%this.getposition();
      rotation=0;
      scale="1 1 1";
      colorID = %this.getColorId();
      colorFXID = %this.getColorFXId();
      printid = %this.client.lastprint2x2f;
   };
   %this.client.brickgroup.add(%brick);
   %brick.plant();
   %brick.setTrusted(1);
   $Server::BrickCount++;
   %sides = %sides SPC %brick;
   %brick=new fxDTSbrick()
   {
      minecraftid = %id;
      minecraftbrick = 1;
      minecraftside = %i;
      client=%this.client;
      dataBlock="brickBottomFacePrintData";
      isPlanted=1;
      position=%this.getposition();
      rotation=0;
      scale="1 1 1";
      colorID = %this.getColorId();
      colorFXID = %this.getColorFXId();
      printid = %this.client.lastprint2x2f;
   };
   %sides = %sides SPC %brick;
   %this.client.brickgroup.add(%brick);
   %brick.plant();
   %brick.setTrusted(1);
   $Server::BrickCount++;
   %this.client.undoStack.head--;
   %this.client.undoStack.val[%this.client.undoStack.head] = %brick TAB "PLANT";
   %this.client.undoStack.head++;
   %this.killbrick();
   $MinecraftBricks[%id] = %sides;
   $MinecraftBrickCount++;
}
package Minecraft
{
   function brickBottomFacePrintData::onPlant(%this,%obj)
   {

      Parent::onPlant(%this,%obj);
   }
   function brickTopFacePrintData::onPlant(%this,%obj)
   {

      Parent::onPlant(%this,%obj);
   }
   function FxDTSBrick::onPlant(%this,%obj)
   {
      if(%obj.getdatablock().getname() $= "brickMinecraftData")
      {
         %obj.schedule(10,createminecraftbrick);
      }
      Parent::onPlant(%this,%obj);
   }
   function FxDTSBrick::onDeath(%this,%obj)
   {
      if(%obj.getDatablock().minecraftbrick == 1)
      {
         %id = %obj.minecraftid;
         for(%i=0;%i<getWordCount($MinecraftBricks[%id]);%i++)
         {
            %brick = getword($Minecraftbricks[%obj.minecraftid],%i);
            if(isObject(%brick))
            {
               %brick.delete();
            }
         }
         $Minecraftbrickcount--;
      }
      Parent::onDeath(%this,%obj);
   }
   function fxDTSBrick::setPrint(%this,%printid)
   {
      
      Parent::setPrint(%brick,%printid);
   }
};
ActivatePackage(Minecraft);

There's already a 2x2 cube print brick, just use that.

There's already a 2x2 cube print brick, just use that.
I was thinking to say that, but didn't knew if one exists.

nono, each side is supposed to be a seperate print
« Last Edit: March 16, 2011, 06:38:34 PM by soba »

nono, each side is supposed to be a seperate print
Cannot be done.

For something like the grass block you could make a second brick which is 2x2x(4 plates), then a 2x2f but with the texture on all sides. Then you can print the bottom one like "dirt" and the top one like "grass". Messing with the UV values would make it line up with other blocks still. If you're making a mod from this you'd need a special control to treat the two print bricks as one block only for the purposes of digging/placing, though.
« Last Edit: March 16, 2011, 07:05:55 PM by Space Guy »

I don't know if this is off-topic, but wouldn't 4x Cubes fit better for Minecrafty stuff?

3x seems to fit the width of a player best but you can't get an exact cube height from it - the best is a half plate too short or too tall.

I don't know if this is off-topic, but wouldn't 4x Cubes fit better for Minecrafty stuff?
Well...
2x2 = Too small
4x4 = Too big

3x3 = ???

Well...
2x2 = Too small
4x4 = Too big

3x3 = ???
3 is prime. ew.


So is 2 :cookieMonster:
I was going to say "prime and odd" but I didn't want to sound redundant... >.>'


yes it can
Print bricks cannot have a different printer texture per side. Unless he's importing his own textures into BLB (which, granted, I don't have any experience doing), intuition says it cannot be done.

Print bricks cannot have a different printer texture per side. Unless he's importing his own textures into BLB (which, granted, I don't have any experience doing), intuition says it cannot be done.
Yeah, well if you had read the code he's actually creating separate face bricks and then planting them.