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¶
- Create the item as in Add an item, with
CategoryFood or Drink,bConsumable,HungerRestoreandThirstRestore. - In
Content/ZombieSurvival/DataAssets/Food/Childs/, create a Data Asset of the classPDA_FoodDef, namedDA_Food_<Name>, and fill its fields (table below). - Set the item's
FoodDefto it. - Add the item to
DataAssets/Items/Childs/DA_ItemRegistry_Default. - Add the item to a loot table, or to
ExcludedItemsinDA_LootSettings_Defaultif 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¶
- Open
Content/ZombieSurvival/Maps/L_Worldand press Play. - Press T, type
/give <ItemSaveId>and press Enter. - 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 (
ThirstRestoreaboveHungerRestore) reads Drink and Drink half. - For Cook, stand next to a lit heat source.
- For fishing or foraging, place a
BP_WaterSourceor aBP_ForageSpotin 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.