-
Notifications
You must be signed in to change notification settings - Fork 0
Build class
Chair6798 edited this page May 7, 2026
·
1 revision
The Build class is located in the BDLib namespace and is implemented as a static class.
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.
Build.PlaceWall(
new Vector3(0, 10, 0),
new Vector3(0, 90, 0)
);Generates a structure from walls using an XML file containing building data.
<?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.
| 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 |
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.
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.
if (Build.IsAvaiable())
{
Build.PlaceWall(pos, rot);
}