Skip to content

Add a food, a fishing table or a forage table

A food is an item with a food definition. The definition makes it go stale and rotten, cook or burn, poison, and go into the cooking pot. Ponds and forage spots give the items you list on them.

Steps

  1. Create the item as in Add an item, with Category Food or Drink, bConsumable, HungerRestore and ThirstRestore.
  2. In Content/ZombieSurvival/DataAssets/Food/Childs/, create a Data Asset of the class PDA_FoodDef, named DA_Food_<Name>, and fill its fields (table below).
  3. Set the item's FoodDef to it.
  4. Add the item to DataAssets/Items/Childs/DA_ItemRegistry_Default.
  5. Add the item to a loot table, or to ExcludedItems in DA_LootSettings_Default if it only comes from the wilds.
Field What it does
FreshHours, StaleHours Game hours before it goes stale, then rotten.
bCookable, CookMinutes One Cook on a lit heat source adds CookMinutes. Past BurnFactor times them it burns. BurnFactor is one value for every food, in DA_FoodSettings_Default.
RawRisk Poisoning risk when eaten raw, for a cookable food.
RotRisk Poisoning risk when rotten.
ToxicRisk Poisoning risk, always.
bIngredient It may go into the cooking pot.

The state of a food is kept in its stack and saved with it: age, cooking, half eaten, the ingredients of a pot. Food in the world ages from the first day. A food created later (cooked, caught, picked) ages from its creation. A powered fridge, which is a furniture definition with bCools, keeps food longer.

DA_FoodSettings_Default, in the same folder, holds the numbers shared by every food: the fridge rate, the freshness factors, the burnt value, the poisoning dose and recovery, water, the fishing and foraging chances, and the campfire fuel minutes.

Fishing

A pond is a Blueprints/Interactables/BP_WaterSource placed in the map.

Setting What it does
FishItems, FishWeights The catch.
Rod, Bait The gear. One bait is used per cast.

Foraging

A forage spot is a Blueprints/Interactables/BP_ForageSpot placed in the map.

Setting What it does
ForageItems, ForageWeights What a search may find.
ForageRegrowHours A search finds something once per ForageRegrowHours. Then the spot grows back.

The fishing and foraging chances grow with the Outdoors skill and follow the Nature abundance game option.

Test it

  1. Open Content/ZombieSurvival/Maps/L_World and press Play.
  2. Press T, type /give <ItemSaveId> and press Enter.
  3. Press Tab and right-click the food's row. The item menu offers Eat, Eat half, Cook and Add to pot, as the food allows. A drink (ThirstRestore above HungerRestore) reads Drink and Drink half.
  4. For Cook, stand next to a lit heat source.
  5. For fishing or foraging, place a BP_WaterSource or a BP_ForageSpot in the map, press Play, and use it from its right-click menu (Fish, Forage) with the gear in your bag. Pine Hollow already has a pond at the forest edge and three forage bushes.