DreamFXLang
Diagnostics

DFX2xxx — Lexer and syntax

Every DFX2xxx diagnostic, with its severity, verbatim message, cause and fix.

DFX2xxx --- Lexer and syntax

The block between the generated markers is written by .skill/gen-diagnostics.ps1. Everything below a marker is written by hand and survives a regeneration.

DFX2000

Severity error

Message

Unknown document type '%s'. Expected System, Emitter, Module or DynamicInput.

Raised by Source/DreamFX/Private/Parser/DreamFXParser.cpp:2016

Cause. The first word of the file is not one of the four document kinds.

Fix. Write System, Emitter, Module or DynamicInput, matching the file extension.

DFX2001

Severity error

Message

Expected '{' to open a raw block but found '%s'.

Raised by Source/DreamFX/Private/Parser/DreamFXLexer.cpp:410, Source/DreamFX/Private/Parser/DreamFXParser.cpp:101

Cause. A construct that takes a raw block was not followed by {.

Fix. Add the brace. hlsl and Body are always hlsl { ... } / Body = { ... }.

DFX2002

Severity error

Message

Expected a name but found %s.

Raised by Source/DreamFX/Private/Parser/DreamFXParser.cpp:112

Cause. An identifier was expected -- a module name, an input name, an emitter name.

Fix. Check for a stray punctuation mark before the position reported.

DFX2003

Severity error

Message

Expected a number but found '%s'.

Raised by Source/DreamFX/Private/Parser/DreamFXParser.cpp:425

Cause. A number was expected, inside a vector literal, a box() or a curve key.

Fix. Vector components and curve times are numbers only; a parameter reference cannot appear there.

DFX2004

Severity error

Message

Expected a value but found %s.

Raised by Source/DreamFX/Private/Parser/DreamFXParser.cpp:612

Cause. A value was expected after =.

Fix. Something is missing on the right-hand side, or the previous statement is missing its ;.

DFX2005

Severity error

Message

'#EndRegion' has no matching '#Region'.

Raised by Source/DreamFX/Private/Parser/DreamFXParser.cpp:941

Cause. #EndRegion appeared with no open #Region.

Fix. Delete it, or add the opening #Region "...".

DFX2006

Severity error

Message

Unknown directive '#%s'. Expected Region or EndRegion.

Raised by Source/DreamFX/Private/Parser/DreamFXParser.cpp:951

Cause. The only directives are #Region and #EndRegion.

Fix. Check the spelling. #Region is a comment device (L5) and never reaches the asset.

DFX2007

Severity error

Message

Expected a version after '@'.

Raised by Source/DreamFX/Private/Parser/DreamFXParser.cpp:1010, Source/DreamFX/Private/Parser/DreamFXParser.cpp:491, Source/DreamFX/Private/Parser/DreamFXParser.cpp:512

Cause. @ introduces an R7 version pin and must be followed by a version.

Fix. Write ModuleName@1.2, or drop the @.

DFX2008

Severity error

Message

Module '%s' was given a positional argument. Module inputs must be written as 'Name = Value'.

Raised by Source/DreamFX/Private/Parser/DreamFXParser.cpp:1029, Source/DreamFXEditor/Private/Generation/DreamFXGenerator.cpp:1233

Cause. A module call was given a bare value. Niagara addresses module inputs by name, and the order they appear in the stack UI is not the order they are declared in.

Fix. Write Name = Value for every argument. dfx schema <Module> lists the names.

DFX2010

Severity warning

Message

'#Region \"%s\"' was never closed with '#EndRegion'.

Raised by Source/DreamFX/Private/Parser/DreamFXParser.cpp:1104

Cause. A #Region ran to the end of the block without an #EndRegion. Harmless -- regions are text -- but usually means a section was moved and its closer left behind.

Fix. Add the #EndRegion.

DFX2013

Severity error

Message

'%s' is a system-scope stack and must be written at the top level of a .dfs, not inside an emitter.

Raised by Source/DreamFX/Private/Parser/DreamFXParser.cpp:1310

Cause. SystemSpawn and SystemUpdate belong to the system, not to an emitter (L1).

Fix. Move the block to the top level of the .dfs, beside the Emitter blocks.

DFX2015

Severity error

Message

'from' must be followed by a quoted path to a .dfe source file.

Raised by Source/DreamFX/Private/Parser/DreamFXParser.cpp:1726

Cause. from takes a quoted path to a .dfe.

Fix. Quote it. The extension is optional; the path resolves relative to this file first.

DFX2016

Severity error

Message

(built at runtime)

Raised by Source/DreamFX/Private/Parser/DreamFXParser.cpp:1254

Cause. A Defaults = { … } block contained something other than an assignment. A default says what reading a parameter produces when nothing set it, so a module call has nothing to mean there.

Fix. Move the module call into one of the stacks (ParticleSpawn, ParticleUpdate, …). Only <type> Namespace.Name = value; belongs in Defaults.

DFX2018

Severity error

Message

A Module or DynamicInput must declare a 'Body = { }' block.

Raised by Source/DreamFX/Private/Parser/DreamFXParser.cpp:1914

Cause. A .dfm with no Body declares inputs and generates a module that does nothing.

Fix. Add Body = { ... }.

DFX2019

Severity error

Message

Header argument '%s' must be a quoted string.

Raised by Source/DreamFX/Private/Parser/DreamFXParser.cpp:1942, Source/DreamFX/Private/Parser/DreamFXParser.cpp:1961, Source/DreamFX/Private/Parser/DreamFXParser.cpp:1970, Source/DreamFX/Private/Parser/DreamFXParser.cpp:1978

Cause. Header arguments (Name=, Root=) are quoted strings.

Fix. Quote the value.

DFX2020

Severity error

Message

Unknown curve key attribute '%s'. Expected Interp, Tangent, Arrive or Leave.

Raised by Source/DreamFX/Private/Parser/DreamFXParser.cpp:396

Cause. A curve key's attribute list accepts only Interp, Arrive and Leave (plan 3.5).

Fix. Check the spelling. Tangents are only honoured when Interp makes them meaningful.

DFX2021

Severity error

Message

File declares '%s' but its extension is '%s'. Rename the file to '%s' or change the declaration.

Raised by Source/DreamFX/Private/Parser/DreamFXParser.cpp:2030

Cause. The declared document kind and the file extension disagree.

Fix. Rename the file or change the declaration -- the extension is what the build enumerates by.

DFX2022

Severity error

Message

Unexpected '%s' after the end of the document. A DreamFX file declares exactly one top-level object.

Raised by Source/DreamFX/Private/Parser/DreamFXParser.cpp:2059

Cause. Content followed the closing brace of the top-level object. Usually a duplicated block or one brace too few somewhere above.

Fix. One file, one top-level object. The position reported is where the extra content starts, not where the imbalance is.

DFX2023

Severity error

Message

'%s' is a module call, so it cannot be given a type. Types are written only on assignments.

Raised by Source/DreamFX/Private/Parser/DreamFXParser.cpp:1070

Cause. A type was written in front of a module call. Types annotate assignments, where L2 has to know what a new attribute is; a module call's types come from its schema.

Fix. Drop the type.

DFX2024

Severity error

Message

A Defaults declaration cannot be disabled; defaults are not executed stack nodes.

Raised by Source/DreamFX/Private/Parser/DreamFXParser.cpp:1248

Cause. disabled was applied to a declaration inside Defaults. Defaults register parameter values; they are not executed stack nodes. Executable stack assignments and module calls do support disabled.

Fix. Remove disabled from the default declaration, or remove the declaration itself if the parameter is no longer needed.

DFX2025

Severity error

Message

Unknown OnEvent argument '%s'. Expected Source, Event, Mode, SpawnNumber, MaxEventsPerFrame, UpdateAttributeInitialValues, RandomSpawnNumber or MinSpawnNumber.

Raised by Source/DreamFX/Private/Parser/DreamFXParser.cpp:1468, Source/DreamFX/Private/Parser/DreamFXParser.cpp:1476, Source/DreamFX/Private/Parser/DreamFXParser.cpp:1491

Cause. An OnEvent(...) header carries an argument the parser does not know, an argument is missing its value, or a required argument (Source, Event) was left out entirely.

The header is not a module call — its arguments configure the handler itself (which emitter's events it listens to and how it spends them), so the accepted set is fixed: Source (emitter name in this system), Event (the event name, quoted), Mode (SpawnedParticles or EveryParticle), SpawnNumber, MaxEventsPerFrame, UpdateAttributeInitialValues, RandomSpawnNumber, MinSpawnNumber. Modules that react to the event go inside the block, not in the header.

Fix. Spell the argument as listed above (matching ignores case), give every argument a value of the right shape — Source and Mode are identifiers, Event a name or string, the numbers integers, the flags true/false — and always write at least Source and Event:

OnEvent(Source = Sparks, Event = "LocationEvent", Mode = SpawnedParticles, SpawnNumber = 1) = {
    ReceiveLocationEvent();
}

DFX2026

Severity error

Message

Unknown Stage argument '%s'. Expected a stage iteration, enabled, dispatch or particle-state option; see the Stage language reference.

Raised by Source/DreamFX/Private/Parser/DreamFXParser.cpp:1690, Source/DreamFX/Private/Parser/DreamFXParser.cpp:1698

Cause. A Stage name(...) header contains an unknown argument or an argument whose value has the wrong type. Stage options cover iteration, enablement, execution behavior, direct dispatch, thread groups and particle-state filtering.

Fix. Use the argument names and value types in the Stage reference. A bare Stage name = { } uses engine defaults; parameter bindings must name a parameter of the corresponding type.

DFX2027

Severity error

Message

Group(...) takes a quoted name: Group(\"Name\") { ... }.

Raised by Source/DreamFX/Private/Parser/DreamFXParser.cpp:839

Cause. A Group(...) declaration has an unquoted or missing name.

Fix. Write a quoted name, for example Group("Sparks") { ... }.

DFX2028

Severity error

Message

Group(...) requires a non-empty name.

Raised by Source/DreamFX/Private/Parser/DreamFXParser.cpp:847

Cause. A Group(...) declaration uses an empty name.

Fix. Give the group a non-empty name so its emitters can be organized consistently.

On this page