Dark Future exposes the following lifecycle event hooks that you can listen for using Codeware's custom events.
Lifecycle Hook
Event Name
Description
Init
DarkFuture.Main.MainSystemLifecycleInitEvent
Event that fires when Dark Future begins starting up all subsystems (either initially or when the game is loaded). Occurs before any of Dark Future's systems are initialized.
InitDone
DarkFuture.Main.MainSystemLifecycleInitDoneEvent
Event that fires when Dark Future is finished starting all subsystems (either initially or when the game is loaded).
Resume
DarkFuture.Main.MainSystemLifecycleResumeEvent
Event that fires when Dark Future begins resuming all subsystems. Occurs if the user toggled "Enable Dark Future" to On after having turned it Off.
There is an event that fires whenever a Basic Need (Nerve, Hydration, Nutrition, Energy) changes its value that you can listen for using Codeware's custom events.
Event
Event Name
Description
Need Value Change
DarkFuture.Needs.NeedValueChangedEvent
Fires when any Basic Need changes its value.
Here's an example of usage.
Consumables
Below is a quick list of all TweakDBIDs for new Consumables added by Dark Future, and their gameplay purpose, as well as consumables in the game that have had their functionality significantly changed.
In Dark Future, Narcotics and Cigarettes are new classifications of consumables similar to Food, Drinks, and Alcohol. Because they have distinct gameplay purposes and feed unique Addictions, they should be handled as their own types of consumables.
Other types of consumables that have more generalized gameplay uses are noted as "beneficial", below.
Item Name
TweakDBID
Notes
Vargas Black Label
DarkFutureItem.CigarettePackC
Cigarette.
Yeheyuan Filters
Items.GenericJunkItem23
Cigarette. (This item exists in the base game as a Junk Item; it was converted into a consumable.)
Morley Fusion
Items.GenericJunkItem24
Cigarette. (This item exists in the base game as a Junk Item; it was converted into a consumable.)
Mr. Whitey
Items.LowQualityFood6
Narcotic (no longer Food). Combat use allowed.
Mr. Whitey Mint
Items.MediumQualityFood11
Narcotic (no longer Food). Combat use allowed.
Mr. Whitey Crystal
Items.MediumQualityFood14
Narcotic (no longer Food). Combat use allowed.
Mr. Whitey Spiced
Items.MediumQualityFood15
Narcotic (no longer Food). Combat use allowed.
Black Lace Mk. 1
Items.BlackLaceV0
Narcotic. Combat use allowed.
Black Lace Mk. 2
Items.BlackLaceV1
Narcotic. Combat use allowed.
Emergency Cardioregulator
DarkFutureItem.NerveRestoreDrug
Narcotic. Combat use allowed.
Glitter
DarkFutureItem.Glitter
Narcotic. Combat use allowed.
Addiquit
DarkFutureItem.AddictionTreatmentDrug
Beneficial consumable. Helps cure Addictions.
Endotrisine
DarkFutureItem.EndotrisineDrug
Beneficial consumable. Cures Humanity Loss.
Immunosuppressant
DarkFutureItem.ImmunosuppressantDrug
Beneficial consumable. Cures Cyberpsychosis. Suppresses the Humanity Loss rate increase from cyberware.
Certain Food and Drinks that come from vending machines have both positive and (minor) negative gameplay effects, in order to encourage players to seek out higher-quality food at Food Vendors. The list of these "low quality" food and drink items that can negatively impact the player in Dark Future are listed below.
import DarkFuture.Needs.{
DFNeedType,
DFNeedValueChangedEventDatum,
NeedValueChangedEvent
}
/*
public enum DFNeedType {
None = 0,
Hydration = 1,
Nutrition = 2,
Energy = 3,
Nerve = 4
}
public struct DFNeedValueChangedEventDatum {
public let needType: DFNeedType;
public let newValue: Float;
}
*/
public class MyEventListener extends ScriptableService {
private cb func OnLoad() {
GameInstance.GetCallbackSystem().RegisterCallback(n"DarkFuture.Needs.NeedValueChangedEvent", this, n"OnNeedValueChangedEvent", true);
}
private cb func OnNeedValueChangedEvent(event: ref<NeedValueChangedEvent>) {
let data: DFNeedValueChangedEventDatum = event.GetData();
let needType: DFNeedType = data.needType; // Was this an update for Nerve, Hydration, Nutrition, or Energy?
let newValue: Float = data.newValue; // What was the new value for the need?
}
}