WML Error Messages and what they mean
Moderator: Forum Moderators
Forum rules
- Please use [code] BBCode tags in your posts for embedding WML snippets.
- To keep your code readable so that others can easily help you, make sure to indent it following our conventions.
WML Error Messages and what they mean
Since it happens rather often that some WML code outputs some error message, but it is not clear to everybody what these messages mean, here's a list of WML errors on loading and their reasons:
NOTE: This list is based on Battle for Wesnoth 1.9.9. While error messages may differ for newer/older versions, most of this list still applies.
Unknown Scenario: <id of a scenario>
-the
(NOTE: id's are case-sensitive! Id's have nothing to do with filenames!)
-the argument given in the
(NOTE: definitions are case-sensitive!)
-the actual path to your scenarios folder and the path you used within your _main.cfg don't match
(NOTE: again, case-sensitivity; and watch out for accidental whitespaces in your folder names, they're almost invisible in non-monospace font)
-whitespaces in the path to your scenarios folder. Even if the path is right, Wesnoth doesn't like whitespaces. Always use underscores.
-your scenario file has no .cfg ending
(NOTE: some programs tend to add a .txt extension without your knowledge)
-any other error message that hasn't "The program will now terminate" or something similar written in it generates this error after clicking 'Ok' at the first message. Removing the other problem removes the "Unknown Scenario". Remember: if the engine complains about your scenario, it can't be unknown anymore.
Macro/File <macro or path> is missing
-you called a macro that isn't defined
(NOTE: macros are case-sensitive)
-you called a path that isn't existing, likely there is a spelling error in this path
(NOTE: again, paths are case-sensitive)
-if <macro or path> contains font or charset, you saved one or more files as rich text. WML files need to be UTF-8 plain text.
-in your _main.cfg, you called e.g. the scenarios folder before the utils folder, so the macros you used in the first are not yet known by the engine.
Preprocessor symbol <macro> expects <number> arguments but has <number> arguments
-you called a macro with the wrong number of arguments. If a macro has X possible arguments, you always have to call it with X arguments!
If you want to leave one out, search for the macro definition and check how the argument is used. If it doesn't hurt that the argument is empty, use
-note that since whitespaces divide the arguments, you have to put brackets around a single argument that contains whitespaces. Otherwise every whitespace-seperated part of the argument will count as an argument on its own.
A map without a header is not supported
-your map path is invalid. The header is automatically added by the map editor.
Quoted string not terminated
-you have an unclosed quote somewhere. The number of quotes should always be even.
(NOTE: the error message doesn't necessarily point to the line that caused the error. If you forgot to terminate a quote, the next opening quote is counting as terminating, the terminating quote as opening and so on, till the last quote when the engine notices that there's one missing)
Found invalid closing tag <tag name> for tag <tag name>
-a tag is closed incorrectly, either because you mistyped the opening or terminating tag; or because of something like
Missing closing tag for tag <tag name>
-you didn't close a tag
Unexpected character after variable name (expected , or =) value '<something>'
-if the error message is "Unexpected character after variable name (expected , or =) value '
' ", then you have no equal sign (=) after a key. It has to look like or
-if the error message is "Unexpected character after variable name (expected , or =) value ']' ", then you forgot an opening square bracket in a tag
-if the error message is "Unexpected character after variable name (expected , or =) value '}' ", then you forgot an opening brace in a macro
Unterminated [element] tag, value '<something>'
-you forgot a terminating square bracket in a tag, but have <something> instead
Macro substitution not terminated
-you forgot to terminate a macro with a brace
The game map could not be loaded: Illegal tile in map: (something) 'something'
-you used a terrain type wesnoth doen't recognize. If you want to use costom terrain types from UMC or special terrain of a mainline campaign, you have to copy the terrain definition as well, and make Wesnoth read it by including the file in your _main.cfg.
NOTE: This list is based on Battle for Wesnoth 1.9.9. While error messages may differ for newer/older versions, most of this list still applies.
Unknown Scenario: <id of a scenario>
-the
next_scenario
key of the previous scenario and the id
key of the actual scenario don't match (if it's the first scenario, it's the first_scenario
key in your[campaign]
tag which has to match with the scenario id)(NOTE: id's are case-sensitive! Id's have nothing to do with filenames!)
-the argument given in the
define
key in your [campaign]
tag doesn't match the one following the #ifdef
when including your files(NOTE: definitions are case-sensitive!)
-the actual path to your scenarios folder and the path you used within your _main.cfg don't match
(NOTE: again, case-sensitivity; and watch out for accidental whitespaces in your folder names, they're almost invisible in non-monospace font)
-whitespaces in the path to your scenarios folder. Even if the path is right, Wesnoth doesn't like whitespaces. Always use underscores.
-your scenario file has no .cfg ending
(NOTE: some programs tend to add a .txt extension without your knowledge)
-any other error message that hasn't "The program will now terminate" or something similar written in it generates this error after clicking 'Ok' at the first message. Removing the other problem removes the "Unknown Scenario". Remember: if the engine complains about your scenario, it can't be unknown anymore.
Macro/File <macro or path> is missing
-you called a macro that isn't defined
(NOTE: macros are case-sensitive)
-you called a path that isn't existing, likely there is a spelling error in this path
(NOTE: again, paths are case-sensitive)
-if <macro or path> contains font or charset, you saved one or more files as rich text. WML files need to be UTF-8 plain text.
-in your _main.cfg, you called e.g. the scenarios folder before the utils folder, so the macros you used in the first are not yet known by the engine.
Preprocessor symbol <macro> expects <number> arguments but has <number> arguments
-you called a macro with the wrong number of arguments. If a macro has X possible arguments, you always have to call it with X arguments!
If you want to leave one out, search for the macro definition and check how the argument is used. If it doesn't hurt that the argument is empty, use
()
. That counts as argument, but does nothing. If the argument being empty would break the code, test it if necessary, look for the shortest way to make it syntactically correct without any gameplay effect.-note that since whitespaces divide the arguments, you have to put brackets around a single argument that contains whitespaces. Otherwise every whitespace-seperated part of the argument will count as an argument on its own.
A map without a header is not supported
-your map path is invalid. The header is automatically added by the map editor.
Quoted string not terminated
-you have an unclosed quote somewhere. The number of quotes should always be even.
(NOTE: the error message doesn't necessarily point to the line that caused the error. If you forgot to terminate a quote, the next opening quote is counting as terminating, the terminating quote as opening and so on, till the last quote when the engine notices that there's one missing)
Found invalid closing tag <tag name> for tag <tag name>
-a tag is closed incorrectly, either because you mistyped the opening or terminating tag; or because of something like
Code: Select all
[a]
[b]
[/a]
[/b]
-you didn't close a tag
Unexpected character after variable name (expected , or =) value '<something>'
-if the error message is "Unexpected character after variable name (expected , or =) value '
' ", then you have no equal sign (=) after a key. It has to look like
Code: Select all
key=value
Code: Select all
key,key2=value,value2
-if the error message is "Unexpected character after variable name (expected , or =) value '}' ", then you forgot an opening brace in a macro
Unterminated [element] tag, value '<something>'
-you forgot a terminating square bracket in a tag, but have <something> instead
Macro substitution not terminated
-you forgot to terminate a macro with a brace
The game map could not be loaded: Illegal tile in map: (something) 'something'
-you used a terrain type wesnoth doen't recognize. If you want to use costom terrain types from UMC or special terrain of a mainline campaign, you have to copy the terrain definition as well, and make Wesnoth read it by including the file in your _main.cfg.
Last edited by Ceres on March 18th, 2012, 8:30 pm, edited 12 times in total.
Co-Creator of The Fellowship of the Clay (BfW 1.10) ~~ Maintainer of the German Code of Conduct
How to isolate problematic WML code ~~ WML error messages and their reasons
How to isolate problematic WML code ~~ WML error messages and their reasons
Re: WML Error Messages and what they mean
Good thread.
That could probably be clarified a bit. What effects an empty argument has depends entirely on what the macro does with that argument: it might work as you'd expect or it might not, so you should only use an empty argument if you know (through example code, or by reading the macro definition and checking for yourself) that it's actually supported.Ceres wrote:-you called a mcaro with the wrong number of arguments. If a macro has X possible arguments, you always have to call it with X arguments! If you want to leave one out, use (). That counts as argument, but does nothing.
Re: WML Error Messages and what they mean
Thanks
Clarified it (hopefully).
Clarified it (hopefully).
Co-Creator of The Fellowship of the Clay (BfW 1.10) ~~ Maintainer of the German Code of Conduct
How to isolate problematic WML code ~~ WML error messages and their reasons
How to isolate problematic WML code ~~ WML error messages and their reasons
Re: WML Error Messages and what they mean
I read that “()” as “0” at first. I suggest you make it monospace.Ceres wrote:Preprocessor symbol <macro> expects <number> arguments but has <number> arguments [...] If it doesn't hurt that the argument is empty, use (). [...]
“I” > “It”.Ceres wrote:Unexpected character after variable name (expected , or =) value '<something>' [...] I has to look like [...]
I also recommend increasing the size of the error names to make them easier to find. In just bold they blend in somewhat.
-
- Inactive Developer
- Posts: 2461
- Joined: August 15th, 2008, 8:46 pm
- Location: Germany
Re: WML Error Messages and what they mean
Um, no. If the binary path is wrongCeres wrote:-the path to your folder and the path you used within[binary_path]
(...) don't match
-custom units are completely invisible except for the ellipse, the hitpoints bar and such
-custom sounds and music issue "not found" messages
But the campaign loads anyway.
Actually, I would recommend to get something working first without the art.
note: I didn't check the whole post.
projects (BfW 1.12):
A Simple Campaign: campaign draft for wml starters • Plan Your Advancements: mp mod
The Earth's Gut: sp campaign • Settlers of Wesnoth: mp scenario • Wesnoth Lua Pack: lua tags and utils
updated to 1.8 and handed over: A Gryphon's Tale: sp campaign
A Simple Campaign: campaign draft for wml starters • Plan Your Advancements: mp mod
The Earth's Gut: sp campaign • Settlers of Wesnoth: mp scenario • Wesnoth Lua Pack: lua tags and utils
updated to 1.8 and handed over: A Gryphon's Tale: sp campaign
-
- Posts: 1549
- Joined: June 18th, 2009, 1:45 am
Re: WML Error Messages and what they mean
Good work so far!
For 'Macro/File <macro or path> is missing', you might also want to write something about calling the macros before the scenarios. I've had something like this:
... fail on me before. Swapping utils and scenarios fixed it though. (1.9, though haven't tested it on the more recent releases.)
EDIT: Grammar fail.
For 'Macro/File <macro or path> is missing', you might also want to write something about calling the macros before the scenarios. I've had something like this:
Code: Select all
#ifdef CAMPAIGN_AWESOME
[binary_path]
path=data/add-ons/Awesome
[/binary_path]
{~add-ons/Awesome/scenarios}
{~add-ons/Awesome/utils}
#endif
EDIT: Grammar fail.
Last edited by monochromatic on July 25th, 2011, 8:36 pm, edited 1 time in total.
Re: WML Error Messages and what they mean
Another reason for “Macro/file <macro or path> is missing”:
-if <macro or path> contains
-if <macro or path> contains
font
or charset
, you saved one or more files as rich text. WML files need to be UTF-8 plain text.Re: WML Error Messages and what they mean
The same.monochromatic wrote:Good work so far!
Ceres wrote:NOTE: This list is based on Battle for Wesnoth 1.9.7. It may be that various error messages from older versions aren't appearing anymore in 1.9.7 and aren't listed.
I think "missing closing tag error" occurs on 1.8 and before, but no longer on 1.9.Ceres wrote:Missing closing tag for tag <tag name>
-you didn't close a tag
It seems more specified on 1.9 as you describe above.
Spoiler:
Fate of a Princess/feedback thread: "What is in own heart that is the most important, not who you are."
Drake Campaign: Brave Wings/feedback thread, Naga Campaign: Return of the Monster, Saurian Campaign: Across the Ocean
Northern Forces - now on 1.12 server
Drake Campaign: Brave Wings/feedback thread, Naga Campaign: Return of the Monster, Saurian Campaign: Across the Ocean
Northern Forces - now on 1.12 server
Re: WML Error Messages and what they mean
Thanks all
monochromatic&8680: Thank you, included.
Repost-edit: If no one has any more complaints or ideas, if you don't mind, could someone please stickify it?
My wrong then. Changed.Anonymissimus wrote:Um, no. If the binary path is wrongCeres wrote:-the path to your folder and the path you used within[binary_path]
(...) don't match
-custom units are completely invisible except for the ellipse, the hitpoints bar and such
-custom sounds and music issue "not found" messages
But the campaign loads anyway.
Actually, I would recommend to get something working first without the art.
monochromatic&8680: Thank you, included.
I removed a [/scenario] and got this error on 1.9.7. Maybe behaviour is different for different tags.SkyOne wrote:I think "missing closing tag error" occurs on 1.8 and before, but no longer on 1.9.
It seems more specified on 1.9 as you describe above.
Repost-edit: If no one has any more complaints or ideas, if you don't mind, could someone please stickify it?
Co-Creator of The Fellowship of the Clay (BfW 1.10) ~~ Maintainer of the German Code of Conduct
How to isolate problematic WML code ~~ WML error messages and their reasons
How to isolate problematic WML code ~~ WML error messages and their reasons