Failed to load scenario (#@%$!)
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.
Failed to load scenario (#@%$!)
Why do we have as informative error messages as "Failed to load scenario"? Why doesn't or cannot the parser or engine tell us about the anomaly found? Why isn't there more in the log file? (And why is our log file messed with tons of errors from other campaigns?!)
Could we study and document the various cases in which this error (and others) happen? They seem to be typically those kinds of stupid errors, but hard to avoid and even harder to find.
I suspect all this is related to the usage of a preprocessor and to the various identifying data that must match. If I'm right, making a standard folder structure and file naming scheme, and getting of the preprocessor (for file inclusion) should help a lot: there would be a single id for campaigns and scenarios, playing all roles, and no folder or file names at all (except maybe maps).
Could we change the framework to prevent those annoying and depressive "events"?
Now, my case: this should be easy to find, because it is a very simple 1-scenario campaign made to study or try various kinds of things, from Wesnoth features to microAI code. I'm blocked (on this side of dev) for several days already, also because such #@%$! errors get on my nerves, so that I prefere trying to rest my mind or do something else, before retrying to solve it. But in this very case, nothing works.
* Checked innumerable times dirs and files, their existence and pathes.
* No special unit types, nore even units defined apart.
* No custom macros, utils, Lua code...
* No image, portrait, sound or such.
The scenario is in fact self-contained apart from standard macros like {DEFAULT_SCHEDULE}.
What could I do?
(I have already tried to search the forum: much interesting, but no help for me: all issues mentionned are already ok by me, or I am blind.)
PS: I cannot remove much (to try & isolate the source of the bug) since it is really a minimal scenario, and what I could remove should instead trigger real WML errors if it were wrong (I will in fact check that).
PPS: I wonder if my problem may be related to the fact that at times Wesnoth does not seem to re-load, even started from scratch (and noone seems to know why). Possibly I would have corrected the bug but the engine still works on old versions (and erasing the precompiled code or whatnot somehere does not help!).
Could we study and document the various cases in which this error (and others) happen? They seem to be typically those kinds of stupid errors, but hard to avoid and even harder to find.
I suspect all this is related to the usage of a preprocessor and to the various identifying data that must match. If I'm right, making a standard folder structure and file naming scheme, and getting of the preprocessor (for file inclusion) should help a lot: there would be a single id for campaigns and scenarios, playing all roles, and no folder or file names at all (except maybe maps).
Could we change the framework to prevent those annoying and depressive "events"?
Now, my case: this should be easy to find, because it is a very simple 1-scenario campaign made to study or try various kinds of things, from Wesnoth features to microAI code. I'm blocked (on this side of dev) for several days already, also because such #@%$! errors get on my nerves, so that I prefere trying to rest my mind or do something else, before retrying to solve it. But in this very case, nothing works.
* Checked innumerable times dirs and files, their existence and pathes.
* No special unit types, nore even units defined apart.
* No custom macros, utils, Lua code...
* No image, portrait, sound or such.
The scenario is in fact self-contained apart from standard macros like {DEFAULT_SCHEDULE}.
What could I do?
(I have already tried to search the forum: much interesting, but no help for me: all issues mentionned are already ok by me, or I am blind.)
PS: I cannot remove much (to try & isolate the source of the bug) since it is really a minimal scenario, and what I could remove should instead trigger real WML errors if it were wrong (I will in fact check that).
PPS: I wonder if my problem may be related to the fact that at times Wesnoth does not seem to re-load, even started from scratch (and noone seems to know why). Possibly I would have corrected the bug but the engine still works on old versions (and erasing the precompiled code or whatnot somehere does not help!).
- Pentarctagon
- Project Manager
- Posts: 5564
- Joined: March 22nd, 2009, 10:50 pm
- Location: Earth (occasionally)
Re: Failed to load scenario (#@%$!)
Can you upload your test add-on so that other people can see exactly what's going on?
99 little bugs in the code, 99 little bugs
take one down, patch it around
-2,147,483,648 little bugs in the code
take one down, patch it around
-2,147,483,648 little bugs in the code
Re: Failed to load scenario (#@%$!)
I would say that using campaign is additional layer of complexity already, just scenario would be enough.
Re: Failed to load scenario (#@%$!)
Just a sanity check - do you have the
Turning on engine logging with
[scenario]
tag with the right id=
to exactly match the [campaign]
tag's first_scenario=
?Turning on engine logging with
--log-debug=engine
might help, but there's no log message yet for the specific case of not having a scenario with the right id. That will be fixed in 1.14.10 and 1.15.3.
Last edited by octalot on November 28th, 2019, 7:03 pm, edited 1 time in total.
Reason: backported the fix to 1.14
Reason: backported the fix to 1.14
Re: Failed to load scenario (#@%$!)
Yes, I had checked already such things (as said), but another time does not do bad:
Code: Select all
# in _main.cfg :
first_scenario = "1_Test_Scenario"
# in 1_Test_Scenario.cfg :
id = "1_Test_Scenario"
I will quickly try and see if any helpful info pops out. Thank you!
EDIT: Was pretty quick. The only difference is that I have about 100 lines of info about registered colors, before the 33 lines of warnings and errors about other campaigns I have with
wesnoth -d
. The 2 last lines of the log are:
Code: Select all
20191107 20:04:17 error display: could not open image 'portraits/humans/transparent/lieutenant.png'
20191107 20:04:36 error general: Failed to load the scenario
Last edited by denispir on November 7th, 2019, 7:11 pm, edited 1 time in total.
Re: Failed to load scenario (#@%$!)
Could verify your scenario is loaded https://wiki.wesnoth.org/PreprocessorRef#.23warning
Re: Failed to load scenario (#@%$!)
Just tried: it is not, for sure (I wrote a very visible message).Ravana wrote: ↑November 7th, 2019, 7:09 pm Could verify your scenario is loaded https://wiki.wesnoth.org/PreprocessorRef#.23warning
EDIT: Indeed, this is just what the error means.
Last edited by denispir on November 9th, 2019, 9:02 am, edited 1 time in total.
Re: Failed to load scenario (#@%$!)
That means you dont have the [scenario] in _main.cfg.
- Pentarctagon
- Project Manager
- Posts: 5564
- Joined: March 22nd, 2009, 10:50 pm
- Location: Earth (occasionally)
Re: Failed to load scenario (#@%$!)
Again, if you would upload your add-on, it would be easier since we can look at what your entire code is.
99 little bugs in the code, 99 little bugs
take one down, patch it around
-2,147,483,648 little bugs in the code
take one down, patch it around
-2,147,483,648 little bugs in the code
Re: Failed to load scenario (#@%$!)
_main.cfg is the only file wesnoth loads for non-core addons. Preprocessor may insert other files into it, but you have not showed that this is the case.
Re: Failed to load scenario (#@%$!)
Sorry, I slipped on your first message because of the reason below, and then forget (I do several things in //).Pentarctagon wrote: ↑November 9th, 2019, 9:22 am Again, if you would upload your add-on, it would be easier since we can look at what your entire code is.
The reason I did not upload those files immediately is that they are literally saturated with comment because they may play another role, namely that of an example or skeleton for novice campaign authors. But I will do the job of removing all that this morning, and quote you again.
[This may be a solution actually, if also rename all that, then the engine will have to reload all.]
Re: Failed to load scenario (#@%$!)
It's crazy. I did it, I mean copy the WML file into another campaign name (just "Test") and erase all comments. Then I tried just for fun, and the new campaign works fine! I have not changed a single line of code!!! (nore preprocessor directives)Pentarctagon wrote: ↑November 9th, 2019, 9:22 am Again, if you would upload your add-on, it would be easier since we can look at what your entire code is.
But the really crazy thing is that: I thus thought that, as evoked above, the engine for some reason occasionnally fails to really re-load campaign files (even after erasing the whole cache dir). So what I did is simply remove the whole original campaign ("Test Campaing"), restart Wesnoth (the campaign actually disappeared from campaign menu), replace the campaing and retry: the engine still fails to load the scenario... I am pretty bluffed .
So, instead of uploading files stripped of comment, I need to upload the original ones (if you have comments about comments... ). See files attached.
- Attachments
-
- 1_Test_Scenario.cfg
- (9.21 KiB) Downloaded 206 times
-
- _main.cfg
- (7.92 KiB) Downloaded 211 times
Re: Failed to load scenario (#@%$!)
EDIT: Now, it works. I just stopped for a while, went out to buy a little bier, came back and now it works !!! It's not only the world of Wesnoth that contains mysterious magic . But it's pretty annoying blockage that lets us totally helpless. I have had similar problems, and mysterious disparition of the problems, 3 times now.denispir wrote: ↑November 10th, 2019, 9:54 amIt's crazy. I did it, I mean copy the WML file into another campaign name (just "Test") and erase all comments. Then I tried just for fun, and the new campaign works fine! I have not changed a single line of code!!! (nore preprocessor directives)Pentarctagon wrote: ↑November 9th, 2019, 9:22 am Again, if you would upload your add-on, it would be easier since we can look at what your entire code is.
But the really crazy thing is that: I thus thought that, as evoked above, the engine for some reason occasionnally fails to really re-load campaign files (even after erasing the whole cache dir). So what I did is simply remove the whole original campaign ("Test Campaing"), restart Wesnoth (the campaign actually disappeared from campaign menu), replace the campaing and retry: the engine still fails to load the scenario... I am pretty bluffed...
So, instead of uploading files stripped of comment, I need to upload the original ones (if you have comments about my comments...). See files attached.
By the way, I think my original error, the only one found and corrected days ago, was about having changed the preprocessor flag for my campaign being played (CAMPAIGN => TEST_CAMPAIGN) in only one place in _main. So, indeed the scenario file could not be found... then.
- Pentarctagon
- Project Manager
- Posts: 5564
- Joined: March 22nd, 2009, 10:50 pm
- Location: Earth (occasionally)
Re: Failed to load scenario (#@%$!)
Note also that in the scenario file,
#idfef
and #enddif
are not valid preprocessor directives.99 little bugs in the code, 99 little bugs
take one down, patch it around
-2,147,483,648 little bugs in the code
take one down, patch it around
-2,147,483,648 little bugs in the code