Add a buildable piece¶
A buildable piece is anything a player places from the build window (B): a wall, a fence, a door, stairs, a piece of furniture. It is one Data Asset listed in the build book, which also lists the barricade kinds that every door and window offers. The tutorial Add a buildable piece follows these steps on an example.
Steps¶
- In
Content/ZombieSurvival/DataAssets/Building/Childs/, duplicate the closestDA_Buildable_*. A blank Data Asset of the classPDA_BuildableDefworks too, but fill every field. - Fill its fields (table below). Give it a unique
BuildId. - Add it to
BuildablesinDA_BuildBook_Default, in the same folder. The build window then lists it under its category. - To make it learned rather than known from the start, put it in
TeachesPiecesof a magazine, or inGrantedPiecesof an occupation or a trait.
The DA_Buildable_Move_<Id> of that folder are hidden pieces, one per
carried piece of furniture.
| Field | What it does |
|---|---|
DisplayName, Description, Icon |
Shown in the build window. A piece without an icon gets a row without a picture. |
BuildId |
A unique Name. The save-file key of every placed copy, and what a character's learned pieces are stored by. |
Category |
A Build.Category.* tag: Structure, Openings, Fences, Furniture or Metal. |
Mesh |
The static mesh placed in the world, also drawn as the ghost. |
Cost |
Items and counts, used up on placement. |
Tools |
The tools, carried and worn on placement: a hammer, or the blowtorch and the welding mask for metal. |
SkillTag, MinLevel |
The skill and the level it asks for. |
ActionDef, BaseDuration |
The timed action that places it (DA_Action_BuildPlace), and its time. |
XP |
The points placing it grants. |
Material |
Wood or Metal: which skill makes it solid, and which tool and odds dismantle it. |
Footprint, FootprintExtent |
The occupancy rule, and the half-size of the box the occupancy test uses. The rule is Edge (a wall, a fence, a door), Cell (a floor) or Free (stairs, furniture: the box alone). An empty extent uses the mesh's bounds. |
MaxHits |
Durability, before the builder's skill and the Construction strength game option: 1.0, 1.5 and 0.75 on the three presets. |
RefundRatio, DismantleTool |
The fraction of Cost dismantling can give back, and the tool it takes. |
PieceClass |
The Blueprint spawned. Empty for BP_Built (the shipped walls, floors and furniture), BP_BuiltOpenable for a piece that opens. |
LeafMesh, LeafOffset |
For an openable, the leaf and its place in the frame. Empty for the window frame. |
bBlocksVision, bVaultable |
Whether it cuts sight, and whether it can be climbed over. The wall frame does not cut sight. |
UpgradeTo, UpgradeCost |
The pieces it can become, and, on the target, what becoming it costs. |
bPlaceable |
Off for a piece that only comes from an upgrade or from a carried item, such as the door. |
FurnitureDef |
For a furniture piece, the PDA_FurnitureDef it is once placed. |
bKnownByDefault, LearnAtLevel |
Known from the start, or learned at a level of SkillTag. |
GridSnap |
Snapping step in uu: 300 to stay on the project grid, 50 for furniture. |
ZOffset |
Vertical offset from the snapped point. |
PlaceSound |
Played on placement. |
Placing takes 4 s and dismantling 3 s, and the Carpentry skill changes both times. Upgrading takes
3 s, dismantling metal 4 s and demolishing 8 s. Dismantling grants 5 points, and a placed piece
grants its own XP.
The occupancy test and demolition are tuned on AC_Building, a
Class Default of the survivor.
A door that comes from a frame¶
A door that comes from a frame is two pieces. The frame lists the door in UpgradeTo. The door has
bPlaceable off and carries the UpgradeCost.
A barricade kind¶
A barricade kind is a Data Asset of PDA_BarricadeSettings in DataAssets/Barricade/Childs/. Three
ship:
| Instance | What it is |
|---|---|
DA_Barricade_Default |
Planks: 1 plank and 2 nails per layer, a hammer required, 4 layers, 20 hits each. |
DA_Barricade_MetalSheet |
1 sheet metal, 300 hits. |
DA_Barricade_MetalBars |
3 metal bars, 400 hits. Sight and shots pass. |
- Duplicate the closest one.
- Set its
DisplayName(the menu reads Barricade (Metal sheet)), itsTypeandbBlocksVision, the material of a layer, the number of layers, the hits per layer andLayerMesh. - Set its
Tools,SkillTagandMinLevel, itsActionDefandActionSeconds(DA_Action_Weldfor metal), itsNoiseTagand itsXP. - Set
RemoveToolandRemoveYield, for taking it down. - Add it to
BarricadesinDA_BuildBook_Default. Every window and door then offers it.
Test it¶
- Open
Content/ZombieSurvival/Maps/L_Worldand press Play. - Press T and type
/give <ItemSaveId> [count]for the cost items and the tools. - Press B, pick the category, then the piece, then Place.
- Move the ghost, press X to turn it a quarter, and press Left mouse to set it down. B leaves placement. So does Esc, except in the editor's own Play, which it stops.
- For a barricade kind, right-click a door or a window: the context menu offers Barricade followed by the kind's name in brackets.
If it does not work¶
- The piece is not in the build window: it is missing from
Buildables. - The barricade kind is not offered on a door or a window, or a saved one does not come back: it is
missing from
Barricades.