Add a piece of furniture¶
A furniture definition turns a mesh into a piece of furniture: a container, a workbench, something a survivor picks up, carries and sets down, or something to dismantle for materials. It applies to the meshes of a map you dress, to the containers of a spawn plan, and to the build window if you want players to make the piece.
Steps¶
- In
Content/ZombieSurvival/DataAssets/Furniture/Childs/, duplicate aDA_Furniture_*, or create a Data Asset of the classPDA_FurnitureDef. - Fill its fields (table below). Give it a unique
FurnitureId. - Add it to
AllinDA_FurnitureRegistry, in the same folder. - Add its mesh to
ByMeshin the same registry if the meshes of a map, or the containers of a spawn plan, should become this furniture. - For a movable piece, create its carried item and its placement piece (below).
- To let players build it as well, add a buildable piece to
DA_BuildBook_DefaultwhoseFurnitureDefpoints at it.
| Field | What it does |
|---|---|
FurnitureId |
A unique Name: the key the save stores for a piece created during play. |
DisplayName, Mesh |
Its name, which a container shows in the loot window, and its mesh. |
ContainerKind |
A name makes it a container when it is created during play. Empty for furniture that holds nothing. |
bMovable, MoveTool, MoveSkill, MoveMinLevel |
Whether it can be picked up, and what that takes. |
CarriedItem, PlaceDef |
The item it becomes in the bag, and the hidden piece used to set it down again. |
bDismantlable, DismantleTool, Material, DismantleYield |
Whether it can be dismantled, with which tool, on which skill, and for what. Wood goes with Carpentry, Metal with Mechanics. |
Workstation |
A PDA_WorkstationDef, if it is a workbench. |
FootprintExtent |
Half the size of its box, for the occupancy test. |
bCools |
Makes it a fridge: powered, it keeps food longer. |
For its own picture and name in the loot window, a container kind needs a row in ContainerKinds of
DA_UIStyle. Without a row it shows the generic picture and its own
DisplayName.
A movable piece¶
A movable piece needs two more assets. Duplicate a shipped pair.
- Its carried item,
DA_Item_Furniture_<Id>inDataAssets/Items/Childs/: category Furniture,MaxStack4, andFurnitureDefpointing back at the furniture. Register it inDA_ItemRegistry_Default. - Its placement piece,
DA_Buildable_Move_<Id>inDataAssets/Building/Childs/:bPlaceableoff, Free footprint,GridSnap50, no cost, no tool, no skill,ActionDefset toDA_Action_FurniturePlace, andFurnitureDefset. - On the furniture, name the carried item in
CarriedItemand the placement piece inPlaceDef.
Picking up and setting down take 2 s each.
Furniture placed in a map¶
A piece placed in a map takes its definition from BP_Furniture.PlacedDef. The editor tool
EUB_FurnitureTool sets it for you: Convert Level or Convert Selected turns every static
mesh actor whose mesh is in ByMesh into a BP_Furniture, as Build a house
shows.
A container of the spawn plan needs nothing. It receives its furniture through its mesh when it is created.
Test it¶
- Open
Content/ZombieSurvival/Maps/L_Worldand drag your mesh in as a static mesh actor, near the North quarter start point. The editor loads that quarter by default. - Right-click it, Scripted Actor Actions > Convert Selected. It becomes a
BP_Furniture. - Right-click it again, Scripted Actor Actions > Assign Save Ids, then Validate Save Ids, and save the map.
- Press Play. Right-click the furniture: the context menu offers Pick up and Dismantle as its definition allows.
- Pick it up. In the bag, left-click its row to start placing it, press X to turn it and Left mouse to set it down.
If it does not work¶
- A piece created during play is not rebuilt on load: it is missing from
All. - A container or a map mesh stays plain, with no furniture behind it: its mesh is missing from
ByMesh.