Skip to main content

Nightmarefuel

Based on game build 714014 | Last updated: 2026-03-06

Overview

Nightmarefuel defines the prefabricated item used in-game as Nightmare Fuel—a stackable, non-rotting inventory item. It serves as a high-efficiency fuel source (FUELTYPE.NIGHTMARE), a repair material (MATERIALS.NIGHTMARE), and is initialized with a waterproofer component set to zero effectiveness (used for pristine state optimization). The entity supports network synchronization, physics, floatability, and hauntable properties. This prefab is typically used as a component in item prefabs but is itself a full entity definition.

Usage example

local item = Prefab("nightmarefuel")
local inst = CreateEntity()
inst.entity:AddTransform()
inst.entity:AddAnimState()
inst.entity:AddNetwork()
-- ... (full setup as in source) ...
inst:AddComponent("fuel")
inst.components.fuel.fueltype = FUELTYPE.NIGHTMARE
inst.components.fuel.fuelvalue = TUNING.LARGE_FUEL
inst:AddComponent("repairer")
inst.components.repairer.repairmaterial = MATERIALS.NIGHTMARE
inst.components.repairer.finiteusesrepairvalue = TUNING.NIGHTMAREFUEL_FINITEUSESREPAIRVALUE

Dependencies & tags

Components used: stackable, inspectable, fuel, repairer, waterproofer, inventoryitem, transform, animstate, network, floatable, hauntablelaunch, physics, inventoryitem
Tags: Adds waterproofer in pristine state (for optimization), checked implicitly via tag usage.

Properties

PropertyTypeDefault ValueDescription
fueltypeFUELTYPEFUELTYPE.NIGHTMAREType of fuel this item provides when burned.
fuelvaluenumberTUNING.LARGE_FUELEnergy value contributed when used as fuel.
repairmaterialMATERIALSMATERIALS.NIGHTMAREMaterial type used for repair operations.
finiteusesrepairvaluenumberTUNING.NIGHTMAREFUEL_FINITEUSESREPAIRVALUERepair points consumed per use from a finite stock.
maxsizenumberTUNING.STACK_SIZE_SMALLITEMMaximum stack size for this item.
effectivenessnumber0Waterproofer effectiveness; set to 0 here (pristine state only).

Main functions

None. This file defines a prefab factory function (fn) that instantiates and configures an entity, not a reusable component class with methods. The component properties (e.g., fuel.fuelvalue, repairer.finiteusesrepairvalue) are assigned directly during setup.

Events & listeners

None identified. The prefab does not register or fire any custom events.

<!-- --> End of documentation.