Skip to content

Build class

Chair6798 edited this page May 7, 2026 · 1 revision

BDLib.Build Class

The Build class is located in the BDLib namespace and is implemented as a static class.


Main Features

PlaceWall(Vector3 pos, Vector3 rot)

Places a brick wall at the specified position (pos) with the specified rotation (rot).

Both arguments are currently required.

The spawned wall is identical to the one created using the in-game building hammer.

Note

This function only works for the host player or in local/singleplayer mode.

Example

Build.PlaceWall(
    new Vector3(0, 10, 0),
    new Vector3(0, 90, 0)
);

LoadXMLBuilding(string XmlFilePath)

Generates a structure from walls using an XML file containing building data.


XML Format

Minimal Example

<?xml version="1.0"?>
<building>
    <wall
        posX="0"
        posY="0"
        posZ="0"
        rotX="0"
        rotY="0"
        rotZ="0">
    </wall>
</building>

This file places a single wall at coordinates 0, 0, 0.


Wall Attributes

Attribute Description
posX Wall X position
posY Wall Y position
posZ Wall Z position
rotX Wall X rotation
rotY Wall Y rotation
rotZ Wall Z rotation

Example: "BDLib" Text Structure

The following XML example generates a large "BDLib" text structure at height 30.

<?xml version="1.0"?>
<building>

    <!-- B -->
    <wall posX="0" posY="30" posZ="0" rotX="0" rotY="0" rotZ="0"></wall>
    <wall posX="0" posY="31" posZ="0" rotX="0" rotY="0" rotZ="0"></wall>
    <wall posX="0" posY="32" posZ="0" rotX="0" rotY="0" rotZ="0"></wall>
    <wall posX="0" posY="33" posZ="0" rotX="0" rotY="0" rotZ="0"></wall>
    <wall posX="0" posY="34" posZ="0" rotX="0" rotY="0" rotZ="0"></wall>

    <wall posX="1" posY="30" posZ="0" rotX="0" rotY="0" rotZ="0"></wall>
    <wall posX="2" posY="30" posZ="0" rotX="0" rotY="0" rotZ="0"></wall>

    <!-- Additional walls omitted for brevity -->

</building>

You may include as many <wall> elements as needed inside the <building> node.


Additional Functions

IsAvaiable()bool

Returns true if the class is ready for use.

Returns false if:

  • required components are not initialized yet;
  • or the game has not started yet.

Example

if (Build.IsAvaiable())
{
    Build.PlaceWall(pos, rot);
}