Skip to content

ships.Function.validateLoadout

github-actions[bot] edited this page Aug 26, 2026 · 74 revisions

@elite-dangerous-almanac/core / ships / validateLoadout

Function: validateLoadout()

validateLoadout(input): LoadoutValidation

Defined in: src/ships/loadout-validation.ts:304

Validate a resolved fitted build without importing any catalogue.

Parameters

input

LoadoutValidationInput

Hull layout and resolved module classifications, and optionally what the assembled ship weighs.

Returns

LoadoutValidation

Structural validity, operational completeness, and diagnostics.

Remarks

Every rule but one reads the structure alone. The exception is thrusterMassExceeded: state LoadoutValidationInput.mass and the fitted thrusters' ValidationModule.thrusterMaxMass, and a ship too heavy for its own thrusters is reported, because above that rating the thruster curve contributes nothing and the ship does not move at all.

The rating is weighed against each ThrusterLoad the input can state, and the lightest load that is already too heavy is the one reported. A ship that cannot move dry or unladen is an error — it cannot leave a pad, where the tank is always full. One that only fails laden is a warning, and leaves the build both valid and complete: the hold is the one load a pilot chooses.

Example

import { validateLoadout } from '@elite-dangerous-almanac/core/ships/loadout-validation';

const result = validateLoadout({ shipSymbol: 'CustomHull', slots: [], modules: [] });
result.valid; // -> true: no impossible fit was claimed
result.complete; // -> true: the supplied layout has no required mounts

const overloaded = validateLoadout({
    shipSymbol: 'CustomHull',
    slots: [],
    mass: { dry: 60.6, fuel: 25 },
    modules: [
        {
            slot: 'MainEngines',
            symbol: 'Int_Engine_Size2_Class1',
            requiresKnownSlot: false,
            fitError: null,
            thrusterMaxMass: 72,
        },
    ],
});
overloaded.valid; // -> false
overloaded.issues[0]?.code; // -> 'thrusterMassExceeded'
overloaded.issues[0]?.params?.load; // -> 'unladen': it is the full tank that sinks it

Throws

If input.slots is not an array.

Throws

If a figure in input.mass, or a module's thrusterMaxMass, is present and is not a finite number of zero or more.

API

Guides
astro
Classes (1)
ProceduralSystem

Properties

Accessors

Methods

Interfaces (16)
Type Aliases (3)
Variables (11)
Functions (37)
Subpath modules (3)
commodities
Interfaces (1)
Type Aliases (1)
Variables (3)
Functions (3)
equipment
Interfaces (6)
Type Aliases (8)
Variables (3)
Functions (10)
Subpath modules (2)
i18n
Interfaces (1)
Type Aliases (1)
Functions (17)
materials
Enumerations (2)
Interfaces (2)
Type Aliases (2)
Variables (9)
Functions (9)
ships
Classes (3)
BuildMetrics

Methods

LoadoutEditError

Constructors

Properties

Methods

ShipLoadout

Accessors

Methods

Interfaces (125)
Type Aliases (44)
Variables (10)
Functions (85)
Subpath modules (8)

Clone this wiki locally