Author Topic: Water bricks change back to water fx when you load the next time.  (Read 1419 times)

So I'm trying to set my water bricks to undulo because I prefer that effect over the water fx.

When finally all my water bricks are set to undulo I save. The next time I load my build all my water bricks are set back to water fx. This completely ruins the water illusion I am trying to create because all my bricks under the water are undulo.

I need some kind of script to prevent water bricks to switch to water fx on load.

This will work as long as it's executed after Brick_Large_Cubes.

Code: [Select]
function brick8xWaterData::onPlant(%data, %brick)
{
   %brick.setColliding(0);
   %brick.setRayCasting(0);

   //if we've planted directly on top of an identical water brick, hide it
   if(!isObject($LoadingBricks_Client))
   {
      %count = %brick.getNumDownBricks();
      for(%i = 0; %i < %count; %i++)
      {        
         %downBrick = %brick.getDownBrick(%i);

         if(!isObject(%downBrick.physicalZone))
            continue;

         if(%downBrick.getDataBlock().brickSizeX != %data.brickSizeX ||
            %downBrick.getDataBlock().brickSizeY != %data.brickSizeY ||
            %downBrick.getDataBlock().brickSizeZ != %data.brickSizeZ )
            continue;

         %pos = %brick.getPosition();
         %downBrickPos = %downBrick.getPosition();

         %xDelta = mAbs(getWord(%pos, 0) - getWord(%downBrickPos, 0));
         %yDelta = mAbs(getWord(%pos, 1) - getWord(%downBrickPos, 1));

         if(  %xDelta > 0.05  ||
              %yDelta > 0.05  )
            continue;

         %downBrick.setRendering(0);
      }
   }
}

Do I just put that in with the water bricks?

This will work as long as it's executed after Brick_Large_Cubes.

Code: [Select]
function brick8xWaterData::onPlant(%data, %brick)
{
   %brick.setColliding(0);
   %brick.setRayCasting(0);

   //if we've planted directly on top of an identical water brick, hide it
   if(!isObject($LoadingBricks_Client))
   {
      %count = %brick.getNumDownBricks();
      for(%i = 0; %i < %count; %i++)
      {       
         %downBrick = %brick.getDownBrick(%i);

         if(!isObject(%downBrick.physicalZone))
            continue;

         if(%downBrick.getDataBlock().brickSizeX != %data.brickSizeX ||
            %downBrick.getDataBlock().brickSizeY != %data.brickSizeY ||
            %downBrick.getDataBlock().brickSizeZ != %data.brickSizeZ )
            continue;

         %pos = %brick.getPosition();
         %downBrickPos = %downBrick.getPosition();

         %xDelta = mAbs(getWord(%pos, 0) - getWord(%downBrickPos, 0));
         %yDelta = mAbs(getWord(%pos, 1) - getWord(%downBrickPos, 1));

         if(  %xDelta > 0.05  ||
              %yDelta > 0.05  )
            continue;

         %downBrick.setRendering(0);
      }
   }
}
I'm pretty sure this just hides the brick below and not set the water brick's shape effect to 1.

Tool_WaterFX

You could always use the water fx can and set it so that the bricks you would put undulo on instead have the water fx on them and therefor match the water.

I'm pretty sure this just hides the brick below and not set the water brick's shape effect to 1.
Yup, he doesn't want them to be automatically assigned a shape fx. Which is what the unmodified code found in Brick_Large_Cubes does.

Tool_WaterFX

You could always use the water fx can and set it so that the bricks you would put undulo on instead have the water fx on them and therefor match the water.

The effect works better with undulo bricks which is why I want to set the water bricks to undulo but they always revert back to water.



https://www.youtube.com/watch?v=wRzG-bzDgMQ&feature=gp-n-y&google_comment_id=z122xndrylyqhb5c223kd1ualofuul51i

This video demonstrates how it looks when water is set to undulo and it looks much better with undulo and not water fx.
« Last Edit: February 11, 2016, 04:52:48 AM by Lord Tony® »

I like the waterFX better for flags and calm water, but I could see why something like this would be useful

it frustrates me that water fx isn't on the paint can

which also means there would need to be 4 more colors which would be amazing

it frustrates me that water fx isn't on the paint can

which also means there would need to be 4 more colors which would be amazing
not to mention it would be 10 high which would be so much neater

it frustrates me that water fx isn't on the paint can
Ikr. Someone should release a paint-can item specifically for this.

/useWaterFX to equip it??

Ikr. Someone should release a paint-can item specifically for this.

/useWaterFX to equip it??
http://orbs.daprogs.com/rtb/forum.returntoblockland.com/dlm/viewFile6684.html?id=3298

Can't you just like name all of the waterbricks and make a button that does onActivate -> namedBrick -> setShapeFX [Undulo]

http://orbs.daprogs.com/rtb/forum.returntoblockland.com/dlm/viewFile6684.html?id=3298

Can't you just like name all of the waterbricks and make a button that does onActivate -> namedBrick -> setShapeFX [Undulo]

I could but I don't want to keep doing that every time I load. Also eventually I'll hit the quota limit.
« Last Edit: February 11, 2016, 10:09:08 AM by Lord Tony® »

I could but I don't want to keep doing that every time I load. Also eventually I'll hit the quota limit.
To fix the quota limit name the first couple 100 bricks 'water1', the next 'water2' etc etc and make them change shape fx like 500ms after eachother. I understand a script would work a lot better though.

I could but I don't want to keep doing that every time I load. Also eventually I'll hit the quota limit.
This will work as long as it's executed after Brick_Large_Cubes.

Code: [Select]
function brick8xWaterData::onPlant(%data, %brick)
{
   %brick.setColliding(0);
   %brick.setRayCasting(0);

   //if we've planted directly on top of an identical water brick, hide it
   if(!isObject($LoadingBricks_Client))
   {
      %count = %brick.getNumDownBricks();
      for(%i = 0; %i < %count; %i++)
      {       
         %downBrick = %brick.getDownBrick(%i);

         if(!isObject(%downBrick.physicalZone))
            continue;

         if(%downBrick.getDataBlock().brickSizeX != %data.brickSizeX ||
            %downBrick.getDataBlock().brickSizeY != %data.brickSizeY ||
            %downBrick.getDataBlock().brickSizeZ != %data.brickSizeZ )
            continue;

         %pos = %brick.getPosition();
         %downBrickPos = %downBrick.getPosition();

         %xDelta = mAbs(getWord(%pos, 0) - getWord(%downBrickPos, 0));
         %yDelta = mAbs(getWord(%pos, 1) - getWord(%downBrickPos, 1));

         if(  %xDelta > 0.05  ||
              %yDelta > 0.05  )
            continue;

         %downBrick.setRendering(0);
      }
   }
}