engine today ignores scenario changes

The place to post your WML questions and answers.

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.
Post Reply
denispir
Posts: 184
Joined: March 14th, 2013, 12:26 am

engine today ignores scenario changes

Post by denispir »

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?
User avatar
Ravana
Forum Moderator
Posts: 3004
Joined: January 29th, 2012, 12:49 am
Location: Estonia
Contact:

Re: engine today ignores scenario changes

Post by Ravana »

It is id not name you would want to change.

Make sure you are not using save file.

Could try deleting cache.
User avatar
octalot
General Code Maintainer
Posts: 786
Joined: July 17th, 2010, 7:40 pm
Location: Austria

Re: engine today ignores scenario changes

Post by octalot »

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 #defines 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.
denispir
Posts: 184
Joined: March 14th, 2013, 12:26 am

Re: engine today ignores scenario changes

Post by denispir »

Ravana wrote: October 30th, 2019, 3:57 pm Make sure you are not using save file.
I don't understand.
Ravana wrote: October 30th, 2019, 3:57 pm Could try deleting cache.
Thank you! I tried => same issue.
Ravana wrote: October 30th, 2019, 3:57 pm It is id not name you would want to change.
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.
User avatar
octalot
General Code Maintainer
Posts: 786
Joined: July 17th, 2010, 7:40 pm
Location: Austria

Re: engine today ignores scenario changes

Post by octalot »

What are the working and non-working filenames? Just wondering if there's something odd about them.
User avatar
lhybrideur
Posts: 369
Joined: July 9th, 2019, 1:46 pm

Re: engine today ignores scenario changes

Post by lhybrideur »

denispir wrote: October 30th, 2019, 5:23 pm
Ravana wrote: October 30th, 2019, 3:57 pm Make sure you are not using save file.
I don't understand.
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.
denispir
Posts: 184
Joined: March 14th, 2013, 12:26 am

Re: engine today ignores scenario changes

Post by denispir »

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.
Thank you lhybrideur! (funny alias, by the way)
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?)
Post Reply