Skip to content

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

  1. In Content/ZombieSurvival/DataAssets/Furniture/Childs/, duplicate a DA_Furniture_*, or create a Data Asset of the class PDA_FurnitureDef.
  2. Fill its fields (table below). Give it a unique FurnitureId.
  3. Add it to All in DA_FurnitureRegistry, in the same folder.
  4. Add its mesh to ByMesh in the same registry if the meshes of a map, or the containers of a spawn plan, should become this furniture.
  5. For a movable piece, create its carried item and its placement piece (below).
  6. To let players build it as well, add a buildable piece to DA_BuildBook_Default whose FurnitureDef points 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.

  1. Its carried item, DA_Item_Furniture_<Id> in DataAssets/Items/Childs/: category Furniture, MaxStack 4, and FurnitureDef pointing back at the furniture. Register it in DA_ItemRegistry_Default.
  2. Its placement piece, DA_Buildable_Move_<Id> in DataAssets/Building/Childs/: bPlaceable off, Free footprint, GridSnap 50, no cost, no tool, no skill, ActionDef set to DA_Action_FurniturePlace, and FurnitureDef set.
  3. On the furniture, name the carried item in CarriedItem and the placement piece in PlaceDef.

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

  1. Open Content/ZombieSurvival/Maps/L_World and drag your mesh in as a static mesh actor, near the North quarter start point. The editor loads that quarter by default.
  2. Right-click it, Scripted Actor Actions > Convert Selected. It becomes a BP_Furniture.
  3. Right-click it again, Scripted Actor Actions > Assign Save Ids, then Validate Save Ids, and save the map.
  4. Press Play. Right-click the furniture: the context menu offers Pick up and Dismantle as its definition allows.
  5. 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.