The preprocessor does not process usage of defines if the define is defined in a file that gets processed LATER than the usage of said define.
Numbered Steps to Reproduce Problem:
Make 2 files, such as "A.dm" and "Z.dm"
Put the definition of a define in Z.dm
use said define in A.dm
DM will give a compilation error, stating undefined var on the usage of the define in A.dm
Code Snippet (if applicable) to Reproduce Problem:
File "A.dm":
/mob
name = TEST
File "Z.dm":
#define TEST "TEST"
Expected Results:
No compile errors, the usage of "TEST" will properly get handled.
Actual Results:
The preprocessor skips the usage of "TEST" in A.dm and as such a compilation error occurs.
Does the problem occur:
Every time? Or how often? Every time.
In other games? N/A
In other user accounts? Yes
On other computers? Yes
When does the problem NOT occur?
Ensuring #define statements are in a place where they are at the top of the file tree.
Did the problem NOT occur in any earlier versions? If so, what was the last version that worked? Untested
Workarounds:
Ensure #define statements are in a place where they are at the top of the file tree.
This isn't a bug, it's actually common in languages that use preprocessors. Just be glad DM handles file includes for you, in other languages you have to actually include files as you need them (the purpose of the dme).
Most programmers using pre-processors include them in a file that will always be at the top of the tree, that's just how they're done if you want to use them subsequently.