Author Topic: Build in Mining mod  (Read 3607 times)

the code you want to change is in servercmdstartDig()

when creating the bricks you need to give it the Center Point of the brick, and then align to the grid.  The 4xCubeData bricks are 4x4 studs by 4 bricks tall which works out to 2 units by 2.4 units.  so the center of that is 1,1,1.2

Once thats done, you should be able to build.

go from this:
Code: [Select]
   for(%x = -5.5; %x <= 5.5; %x++)
        for(%y = -5.5; %y <= 5.5; %y++)
        {
           Dig_PlaceCement(%x*2 SPC %y*2 SPC 0, "brick4xCubeData");
           Dig_PlaceCement(%x*2 SPC %y*2 SPC 10, "brick4xCubeData");
        }

to something like this:
Code: [Select]
   for(%x = -5; %x <= 5; %x++)
        for(%y = -5; %y <= 5; %y++)
        {
           Dig_PlaceCement(%x*2 SPC %y*2 SPC 1.2, "brick4xCubeData");
           Dig_PlaceCement(%x*2 SPC %y*2 SPC 11.2, "brick4xCubeData");
        }

I cant test this right now - but that should allow you to build on the center platform.  but it will also screw up the rest of the bricks -- so use at your own risk until the rest of the code is adjusted.



Edit:  Mabye i should make my own infinite mining server....

-Snip-

Negative, this does not work.
I'd say nice try though...

Negative, this does not work.
I'd say nice try though...
That code only takes care of the roof and floor cement, not the 8x cubes in between or the dirt.
I would just make an offset in placeCement and placeDirt.

Negative, this does not work.
I'd say nice try though...
I guess I got the coordinates wrong then.. i'll have to actually test it rather than write scripts from memory.


That code only takes care of the roof and floor cement, not the 8x cubes in between or the dirt.
I would just make an offset in placeCement and placeDirt.
Thats the goal - like I said in my previous post, the changes were only a start until the rest of the code was adjusted.
« Last Edit: May 14, 2010, 06:45:52 PM by Red_Guy »

I think it's like what Jaydee and M had said.
It needs to plant the bricks... I just don't know enough to code that. Even after staring at the Trench Mod and the Creep mod... I still don't understand the .plant() script...

EDIT: Ok, suffice to say either.

1. I don't know enough programming to get this to work.
-or-
2. I've stared at this code a little to long tonight, and I'm tired...


So I'll look at it again 2morrow...
« Last Edit: May 14, 2010, 10:05:46 PM by Tanis_Atreides »

Code: [Select]
%err = %brick.plant();

if(%err) return;


that is what they meant

ok found the problem.  The previous idea that the bricks werent on the grid was wrong -- they are.

just add: setTrusted(1);   to all the spots where bricks are created.

in Dig_PlaceCement()  change:
Code: [Select]
    if(mAbs(getWord(%pos, 0)) == 5 && mAbs(getWord(%pos, 1)) == 5 && getWord(%pos, 2) == 0)
        %brick.setItem("DiggingPickaxeItem");
    $server::BrickCount++;

to:
Code: [Select]
    if(mAbs(getWord(%pos, 0)) == 5 && mAbs(getWord(%pos, 1)) == 5 && getWord(%pos, 2) == 0)
        %brick.setItem("DiggingPickaxeItem");
    %brick.setTrusted(1);
    $server::BrickCount++;

in Dig_PlaceDirt()
change:
Code: [Select]
    $Dig_host_brickgroup.add(%brick);
    $Dig_placedDirt[%pos] = 1;
    $server::BrickCount++;

to:
Code: [Select]
     %brick.setTrusted(1);
    $Dig_host_brickgroup.add(%brick);
    $Dig_placedDirt[%pos] = 1;
    $server::BrickCount++;


......... HOWEVER.
if you DO build on this, and then undo something.. whatever you built on will also die because theres no ground underneath -- so use at your own risk.

Ok, that got it to work... But I'm guessing there's no way to fix the "Undo" problem...
And the first brick you place, you can't remove it with the hammer...


yep thats right.  no way to fix the undo problem

yep thats right.  no way to fix the undo problem

Ok, what if there was a gun or something that placed a brick... If said brick was then destroyed, would the same problem occur?

Ok, what if there was a gun or something that placed a brick... If said brick was then destroyed, would the same problem occur?
Hitting the undo button is the same as wanding a brick. All bricks attached to the wanded brick will be killed unless they have a path to a solid non-brick object. Since the mining mod deletes the only solid non-brick object, there isn't any way around the problem.

Is there some way to block people from using undo?

I don't personally think so...


So I think my whole plan for what I want to do is not achievable...

You can build in Mining Mod. Its just the default bricks are placed un-normaly with the brick grid.
Example:
Code: (Example) [Select]
   Mining Mod Brick 4x4 Cube Placement Height; 10.03331
   Brick Gun 4x4 Cube Height; 10.0
This is why you end up with a "Floating Brick" or a "Overlaping Brick" when trying to build in Mining Mod.

You can build in Mining Mod. Its just the default bricks are placed un-normaly with the brick grid.
Example:
Code: (Example) [Select]
   Mining Mod Brick 4x4 Cube Placement Height; 10.03331
   Brick Gun 4x4 Cube Height; 10.0
This is why you end up with a "Floating Brick" or a "Overlaping Brick" when trying to build in Mining Mod.

Is it possible to get rid of the, ".03331" so it's just 10.0?
so that you can use the brick gun...