engine today ignores scenario changes
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.
engine today ignores scenario changes
Hello,
I have a puzzling issue: the engine does not take into account anymore scenario modifs (S1 in my case right now). This since this morning, while it worked yesterday. I tried or checked the obvious:
* The campaign file still defines the right folder for scenarios.
* I'm editing the right files, both _main and S1, in the right folder; anyway my editor stores work sessions, and shows file pathes.
* The same issue happens with Wesnoth started from GUI or terminal...
* ...and either restarting Wesnoth or using F5.
* It's the right Wesnoth version in all cases (an older one may search for game data elsewhere).
* It equally ignores modifs in all stages of the scenario: story text, prestart choice, start dialog, gold amount...
* ...but a change in the campaign file itself (difficulty text) is read!!!
This gave me a weird idea, namely to change both the scenario name and accordingly the value of first_scenario, in _main: the engine could not find it! (I checked again that the names match.) If I reason rightly, this actually means that, while it finds and rightly reprocesses _main, it searches the scenario elsewhere than defined in it: {~add-ons/campaign_name/scenarios}
Someone has an idea?
I have a puzzling issue: the engine does not take into account anymore scenario modifs (S1 in my case right now). This since this morning, while it worked yesterday. I tried or checked the obvious:
* The campaign file still defines the right folder for scenarios.
* I'm editing the right files, both _main and S1, in the right folder; anyway my editor stores work sessions, and shows file pathes.
* The same issue happens with Wesnoth started from GUI or terminal...
* ...and either restarting Wesnoth or using F5.
* It's the right Wesnoth version in all cases (an older one may search for game data elsewhere).
* It equally ignores modifs in all stages of the scenario: story text, prestart choice, start dialog, gold amount...
* ...but a change in the campaign file itself (difficulty text) is read!!!
This gave me a weird idea, namely to change both the scenario name and accordingly the value of first_scenario, in _main: the engine could not find it! (I checked again that the names match.) If I reason rightly, this actually means that, while it finds and rightly reprocesses _main, it searches the scenario elsewhere than defined in it: {~add-ons/campaign_name/scenarios}
Someone has an idea?
Re: engine today ignores scenario changes
It is id not name you would want to change.
Make sure you are not using save file.
Could try deleting cache.
Make sure you are not using save file.
Could try deleting cache.
Re: engine today ignores scenario changes
It does sound like it could be a cache bug. The way that the cache splits data in to different files is partially dependent on the set of
BTW, restarting Wesnoth doesn't necessarily rebuild the cache, unless you use the
#define
s that are active, so your [campaign]
tag is going to be in one cache file, and the part inside the #ifdef CAMPAIGN_MY_CAMPAIGN
is going to be in a different cache file.BTW, restarting Wesnoth doesn't necessarily rebuild the cache, unless you use the
--nocache
option.Re: engine today ignores scenario changes
I don't understand.
Thank you! I tried => same issue.
Right! As you guess, I changed the filename, not the scenario id. Ok, doing so lets the engine find and run the scenario with the new name, and the changes inside rightly appear (eg: new gold).
But this does not explain why I had to do that... There is stil the mystery that it does not read the scenario with its original name. Except for their id's and filenames, both scenarios are identical and placed in the same folder, so what may be the problem? In the meantime, I can move on with the wrong name, but I still want to solve the issue.
Re: engine today ignores scenario changes
What are the working and non-working filenames? Just wondering if there's something odd about them.
- lhybrideur
- Posts: 369
- Joined: July 9th, 2019, 1:46 pm
Re: engine today ignores scenario changes
I think he meant that the scenario is not reread if you load a savefile, only if you start the scenario from the beginning.
You can for example load scenario_name.gz even if it is not the first scenario of the campaign.
However, if you load scenario_name_turn_X.gz, it will not recompile the scenario so it won't see the changes you made in the code.
Re: engine today ignores scenario changes
Thank you lhybrideur! (funny alias, by the way)lhybrideur wrote: ↑October 31st, 2019, 12:41 pm I think he meant that the scenario is not reread if you load a savefile, only if you start the scenario from the beginning.
You can for example load scenario_name.gz even if it is not the first scenario of the campaign.
However, if you load scenario_name_turn_X.gz, it will not recompile the scenario so it won't see the changes you made in the code.
All right, I understand now. However, I always started the campaign from scratch (changes in scenario 1, + details in _main).
I have still no idea of the source of the error. (I suspect a weird, rare bug, appearing in special cases, that makes the engine reuse "precompiled" scenario files. What else?)