Fallout 4

Extensibility
This article tells about how to fit custom ingestible items in survival mod Hardcore Mode ON with short abstract examples.

How it works
First you should know that mod use form lists and keywords, however form lists is used only for vanilla game items, so you should not edit them in any circumstances. Keywords is provided specially for items from other mods and carry same functionality as form lists.

Hunger/Thirst/Fatigue
There are six primary groups of keywords for describing your item to mod mechanic. Three groups are for decreasing player needs (hunger, thirst, fatigue) and three for increasing it. Name of keywords composed in a way you could understand what it is for without overheating your brain. As all forms in mod keywords has first prefix 'HMO', second prefix tells you for which of need this keyword for. '_F' is for Food and controls hunger need, '_B' is for Beverages and controls thirst need, '_S' is for Sleepless (fatigue) and controls sleep need. This three prefixes belongs to first keyword group and will decrease correspond need. Keywords from second group has prefixes that also begins with F, B and S letters but also contain 'R', 'DR' or 'RDR' letters. This 'R' letters if comes from word 'Return', means item with this keyword will return some portion of need immediately, increase it. 'DR' means 'Delayed Return', items with this keywords will return portion of need after a while. 'RDR' as you probably guess combine both effects.

For example prefix '_FR' means Food-Return, items with this keyword will immediately increase hunger; prefix '_BDR' means Beverage-Delayed_Return, items with this keyword will increase thirst after some time.
After prefix follows some symbolic word like 'FoodLight' or 'LightAlcohol' that could (or could not) point on what is for this keyword may be used. However it's just a tip and it's all up to you what keywords on which item to use.
For example melon has a lot of water in it and it's reasonable that eating melon will decrease your thirst, so despite that melon isn't beverage it can contain keyword with '_B' prefix.
The last part of keyword name is postfix which is a pair of numbers. For the first group of keywords first number is a minimum threshold, second number is percent threshold. Whichever is higher will be applied.
For example player thirst value is 60, and player consumes item that have keyword with postfix '_40_40', means item will restore flat 40 points of thirst or 40% of thirst, 40% from 60 is 24, 40 is higher than 24 so from thirst value will be substracted flat 40 points. Now if player has 120 point of thirst and consumes same item, 40% from 120 is 48, and 40 is not higher than 48 so from thirst value will be substracted 48 points.
For second group of keywords first number shows imminent return value, this value will be added to need immediately after consumption. Second number shows delayed return value, this value will be added to need after some time. Read Hardcore Mode [ON] in numbers to find out more about delayed returns.
You can use several keywords for one item in order to describe item's effects. However note that  magnitudes from same keywords not stacked, but values from same group of keywords does. Means if you add two 'HMO_B_Beverage_40_40' keywords you will not get double effect, only one of this keyword will take effect and your item will restor only 40/40% of thirst. But if you use 'HMO_B_BeverageSmall_20_20' and 'HMO_B_Beverage_40_40' result magnitude will be 60/60%.

Food spoilage
There is also keywords that determine spoilage time. When item spoils in will be removed from inventory and generic 'Spoiled food' item will be added to inventory. Add one or several spoilage keywords to an item if you want that item be spoilable. Spoilage time of different keywords stacked, but not for same keyword.

Example: if you add two HMO_SpoilTime_1d keywords spoilage time will not be equal two days but only one day. owever if you add HMO_SpoilTime_1d and HMO_SpoilTime_2d spoilage time will be equal three days.
Diseases
There are variety of diseases and they use different acqure mechanic, due to this for describing disease effects may be needed more work then justadding keywords.
Consumables may give or cure diseases. To make item give disease one of 'HMO_Disease_...' keywords should be added to item. Currently there only two keywords available, for food poisoning and parasites diseases. To make item cure desease one or several magic effects (MGEF) should be added to item effects. This effects may have effect duration, but not magnitude. For duration of effect player will get immunity to specific disease. There is magic effects that cures disease instantly, or in certain circumstances.

Instant cure magic effects:
  • HMO_PurgeEffects_CellsDecay - cures 'Cells Decay' disease instantly. Doesn't shown in PipBoy effects for duration of time.
  • HMO_PurgeEffects_FoodPoisoning - cures 'Food Poisoning' disease instantly. Doesn't shown in PipBoy effects for duration of time.
  • HMO_PurgeEffects_Parasites - cures 'Parasites' disease instantly. Doesn't shown in PipBoy effects for duration of time.
  • HMO_PurgeEffects_Insomnia - cures 'Insomnia' disease instantly. Doesn't shown in PipBoy effects for duration of time.
  • HMO_PurgeEffects_Leukemia - cures 'Leukemia' disease instantly. Doesn't shown in PipBoy effects for duration of time.
  • HMO_PurgeEffects_WoundInfection - cures 'Wound Infection' disease instantly. Shown in PipBoy effects for duration of time as 'Infection Resistance'.

Conditional cure magic effects:
  • HMO_Medicate_Insomnia - cures 'Insomnia' disease if player started a sleep before effects wore off. Shown in PipBoy effects for duration of time as 'Medicate Insomnia'.

List of keywords (for version 1.4)
Food:
  • HMO_F_FoodSnack_5_5 - Reduces Hunger level by 5 points or 5%, whichever is higher.
  • HMO_F_FoodLight_20_20 - Reduces Hunger level by 20 points or 20%, whichever is higher.
  • HMO_F_FoodMedium_40_40 - Reduces Hunger level by 40 points or 40%, whichever is higher.
  • HMO_F_FoodHeavy_80_80 - Reduces Hunger level by 80 points or 80%, whichever is higher.
  • HMO_FDR_HungerReturn_0_20 - Returns 20 points to Hunger level after a delay.

Beverage:
  • HMO_B_Beverage_40_40 - Reduces Thirst level by 40 points or 40%, whichever is higher.
  • HMO_B_BeverageSmall_20_20 - Reduces Thirst level by 20 points or 20%, whichever is higher.
  • HMO_BR_DeyhdratingFood_30_0 - Increases Thirst level by 30 points immediately. No delay.
  • HMO_BDR_LightAlcohol_0_20 - Returns 20 points to Thirst level after a delay.
  • HMO_BDR_ThirstReturn_0_40 - Returns 40 points to Thirst level after a delay.
  • HMO_BDR_StrongAlcohol_0_60 - Returns 60 points to Thirst level after a delay.

Sleep:
  • HMO_S_PsychoStim_20_20 - Reduces Fatigue level by 20 points or 20%, whichever is higher.
  • HMO_S_PsychoStim_40_40 - Reduces Fatigue level by 40 points or 40%, whichever is higher.
  • HMO_S_PsychoStim_80_80 - Reduces Fatigue level by 80 points or 80%, whichever is higher.
  • HMO_SR_SleepReturn_20_0 - Returns 20 points to Fatigue level immediately. No delay.
  • HMO_SR_SleepReturn_40_0 - Returns 40 points to Fatigue level immediately. No delay.
  • HMO_SR_SleepReturn_80_0 - Returns 80 points to Fatigue level immediately. No delay.
  • HMO_SDR_SleepReturn_0_20 - Returns 20 points to Fatigue level after a delay.
  • HMO_SDR_SleepReturn_0_40 - Returns 40 points to Fatigue level after a delay.
  • HMO_SDR_SleepReturn_0_80 - Returns 80 points to Fatigue level after a delay.

Spoilage:
  • HMO_SpoilTime_1d - item will spoils in 1 day.
  • HMO_SpoilTime_2d - item will spoils in 2 days.
  • HMO_SpoilTime_4d - item will spoils in 4 days.
  • HMO_SpoilTime_8d - item will spoils in 8 days.
  • HMO_SpoilTime_16d - item will spoils in 16 days.

Diseases:
  • HMO_Disease_FoodPoisoning_90p - will give 'Disease: Food Poisoning' with 90% base chance.
  • HMO_Disease_FoodPoisoning_5p - will give 'Disease: Food Poisoning' with 5% base chance.
  • HMO_Disease_FoodParasites_90p - will give 'Disease: Parasites' with 90% base chance.


Gratitude to SamusKnight2K for writing down keywords list and description for it.

Article information

Added on

Edited on

Written by

Wenderer