DreamFXLang
Diagnostics

DFX2xxx — Lexer and syntax

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

22 codes in this family (21 error, 1 warning). The message is the format string as the compiler holds it: %s, %d and %c are substituted at runtime.

DFX2000

errorraised byParser/DreamFXParser.cpp:1740

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

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

errorraised byParser/DreamFXLexer.cpp:399Parser/DreamFXParser.cpp:87

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

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

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

DFX2002

errorraised byParser/DreamFXParser.cpp:98

Expected a name but found %s.

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

errorraised byParser/DreamFXParser.cpp:394

Expected a number but found '%s'.

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

errorraised byParser/DreamFXParser.cpp:581

Expected a value but found %s.

Cause. A value was expected after =.

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

DFX2005

errorraised byParser/DreamFXParser.cpp:789

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

Cause. #EndRegion appeared with no open #Region.

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

DFX2006

errorraised byParser/DreamFXParser.cpp:799

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

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

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

DFX2007

errorraised byParser/DreamFXParser.cpp:460Parser/DreamFXParser.cpp:481Parser/DreamFXParser.cpp:859

Expected a version after '@'.

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

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

DFX2008

errorraised byParser/DreamFXParser.cpp:878Generation/DreamFXGenerator.cpp:973

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

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

warningraised byParser/DreamFXParser.cpp:963

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

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

errorraised byParser/DreamFXParser.cpp:1153

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

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

errorraised byParser/DreamFXParser.cpp:1483

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

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

errorraised byParser/DreamFXParser.cpp:1097

(built at runtime)

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

errorraised byParser/DreamFXParser.cpp:1650

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

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

Fix. Add Body = { ... }.

DFX2019

errorraised byParser/DreamFXParser.cpp:1677Parser/DreamFXParser.cpp:1694Parser/DreamFXParser.cpp:1702

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

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

Fix. Quote the value.

DFX2020

errorraised byParser/DreamFXParser.cpp:365

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

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

errorraised byParser/DreamFXParser.cpp:1754

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

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

errorraised byParser/DreamFXParser.cpp:1783

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

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

errorraised byParser/DreamFXParser.cpp:919

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

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

errorraised byParser/DreamFXParser.cpp:930

'disabled' can only prefix a module call, and '%s' is an assignment.

Cause. disabled prefixes a module call, and the statement it was written on is an assignment.

An assignment has nothing to disable: it is folded into the stack's own Set Parameters module alongside every other assignment in that stack, and turning that module off would silently drop all of them.

Fix. Delete the disabled and comment the line out instead, or move the assignment into a module call that can be parked as a whole.

DFX2025

errorraised byParser/DreamFXParser.cpp:1311Parser/DreamFXParser.cpp:1319Parser/DreamFXParser.cpp:1334

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

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

errorraised byParser/DreamFXParser.cpp:1447Parser/DreamFXParser.cpp:1455

Unknown Stage argument '%s'. Expected Iteration, DataInterface, NumIterations, ExecuteBehavior or Enabled.

Cause. A Stage name(...) header carries an argument the grammar does not know, or one whose value has the wrong shape. The four arguments are Iteration (an identifier naming an ENiagaraIterationSource entry: Particles, DataInterface, DirectSet), DataInterface (the bound grid's dotted name, as a string or bare identifiers), NumIterations (an integer) and Enabled (true/false). Everything is optional — a bare Stage name = { } is an enabled particles-iteration stage that runs once.

Fix. Spell the argument as the list above; a stage property beyond these four (execute behaviour, the state-iteration trio) has no text form yet and cannot be requested here.

On this page