Is anyone else having a problem with the wolf advancement macro?

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
Makepeace_McEvoy
Posts: 3
Joined: July 22nd, 2022, 6:28 pm

Is anyone else having a problem with the wolf advancement macro?

Post by Makepeace_McEvoy »

So. I wrote a campaign (An Innocent Man). It has wolves in it. In fact, at first they're the only thing our hero can recruit. Therefore it's kind of important that they are allowed to advance. I therefore, obviously, included the wolf advancement macro, along with two other extra defines (the dwarvish runesmith and dwarvish arcanister ones).

The wolf advancement works fine all the way up to version 1.14. I am currently trying to fettle up the campaign for 1.16 (someone's kindly ported it already, but I want to update it myself). I am currently playtesting it, and I find the wolf advancement has stopped working. I have checked and the macro is not deprecated; in fact it's been rewritten to suit version 1.16. I can think of ways round, but I don't want to have to use them if I can just get this macro to work. Anyone else have this problem?
dwarftough
Posts: 484
Joined: August 4th, 2019, 5:27 pm

Re: Is anyone else having a problem with the wolf advancement macro?

Post by dwarftough »

There is now a macro you can use to do it, just insert

{ENABLE_WOLF_ADVANCEMENT}

inside your [campaign] tag that defines a campaign, something like

Code: Select all

[campaign]
id=some_id
name="Your campaign's name"
{ENABLE_WOLF_ADVANCEMENT}
...
[/campaign]
Co-founder and current maintainer of IsarFoundation, Afterlife Rated and overall Wesnoth Autohost Project
Developer and maintainer of my fork of World Conquest, Invincibles Conquest II
User avatar
beetlenaut
Developer
Posts: 2825
Joined: December 8th, 2007, 3:21 am
Location: Washington State
Contact:

Re: Is anyone else having a problem with the wolf advancement macro?

Post by beetlenaut »

When I tried it, I found that extra_defines doesn't work for wolves or anything else. It may be deprecated, and they just forgot to put it in the change log--the mainline campaigns don't use it anymore. However, the macro worked correctly (the way dwarftough demonstrated). Are you actually using the macro, or did you mean that you only tried extra_defines? Your post is unclear.
Campaigns: Dead Water,
The Founding of Borstep,
Secrets of the Ancients,
and WML Guide
Makepeace_McEvoy
Posts: 3
Joined: July 22nd, 2022, 6:28 pm

Re: Is anyone else having a problem with the wolf advancement macro?

Post by Makepeace_McEvoy »

Thank you both very much! The problem is clearly extra_defines, and if I just take that out it should all work happily.
User avatar
octalot
General Code Maintainer
Posts: 786
Joined: July 17th, 2010, 7:40 pm
Location: Austria

Re: Is anyone else having a problem with the wolf advancement macro?

Post by octalot »

There should already be a warning message about that in the logs. If you're porting to 1.16, it's worth checking the logs to see if there's anything else being reported.
User avatar
beetlenaut
Developer
Posts: 2825
Joined: December 8th, 2007, 3:21 am
Location: Washington State
Contact:

Re: Is anyone else having a problem with the wolf advancement macro?

Post by beetlenaut »

octalot wrote: September 12th, 2022, 11:21 am There should already be a warning message about that in the logs.
Yes, there is. (I was being lazy last night not checking them.) It's also mentioned on the page Compatibility-breaking changes. Neither is exactly obvious though, especially to new people, so I have modified the wiki as well.
Campaigns: Dead Water,
The Founding of Borstep,
Secrets of the Ancients,
and WML Guide
User avatar
Celtic_Minstrel
Developer
Posts: 2222
Joined: August 3rd, 2012, 11:26 pm
Location: Canada
Contact:

Re: Is anyone else having a problem with the wolf advancement macro?

Post by Celtic_Minstrel »

Just for the record, extra_defines itself is not deprecated. Putting the advancement macros in extra_defines is deprecated, however. I believe what happens when you actually do it is that it overwrites the contents of the macro with blank so that {ENABLE_WOLF_ADVANCEMENT} expands to nothing.
Author of The Black Cross of Aleron campaign and Default++ era.
Former maintainer of Steelhive.
User avatar
beetlenaut
Developer
Posts: 2825
Joined: December 8th, 2007, 3:21 am
Location: Washington State
Contact:

Re: Is anyone else having a problem with the wolf advancement macro?

Post by beetlenaut »

Celtic_Minstrel wrote: September 13th, 2022, 1:05 pm Just for the record, extra_defines itself is not deprecated. Putting the advancement macros in extra_defines is deprecated, however.
The wiki says that those advancements are the only recognized values for extra_defines. It sounds like you are saying that the key is not deprecated, but all its valid values are. If that's the case, leaving it as a "Removed Key" in the wiki is fine IMHO. Or, is there something else you can do with extra_defines?
Campaigns: Dead Water,
The Founding of Borstep,
Secrets of the Ancients,
and WML Guide
dwarftough
Posts: 484
Joined: August 4th, 2019, 5:27 pm

Re: Is anyone else having a problem with the wolf advancement macro?

Post by dwarftough »

extra_defines just executes #define macrostatement when the campaign in question is active. Even if the core game at the moment doesn't use it, it can be used still. For example, the Legend of the Invincibles campaign can be used as a dependency for other campaigns to include LotI's RPG system. But some elements of it only makes sense for LotI itself. If your campaign is not ready to enable them, you write extra_defines=NO_LOTI inside your campaign's definition.

Inside LotI such optional pieces of code are encircled by

Code: Select all

#ifndef NO_LOTI
...
#endif
Also extra_defines in LotI are used to specify the reduced item pool (for shorter campaigns), it's enabled by extra_defines=LOTI_LOW_DROPS

So, extra_defines is still useful, it can be used by configurable campaign dependencies. Just the core game itself stopped using it right now
Co-founder and current maintainer of IsarFoundation, Afterlife Rated and overall Wesnoth Autohost Project
Developer and maintainer of my fork of World Conquest, Invincibles Conquest II
User avatar
Celtic_Minstrel
Developer
Posts: 2222
Joined: August 3rd, 2012, 11:26 pm
Location: Canada
Contact:

Re: Is anyone else having a problem with the wolf advancement macro?

Post by Celtic_Minstrel »

beetlenaut wrote: September 13th, 2022, 1:40 pm
Celtic_Minstrel wrote: September 13th, 2022, 1:05 pm Just for the record, extra_defines itself is not deprecated. Putting the advancement macros in extra_defines is deprecated, however.
The wiki says that those advancements are the only recognized values for extra_defines. It sounds like you are saying that the key is not deprecated, but all its valid values are. If that's the case, leaving it as a "Removed Key" in the wiki is fine IMHO. Or, is there something else you can do with extra_defines?
No, your recent edit is incorrect. The list of values for extra_defines is not exhaustive. You can specify any value you want there, and it will be defined when the campaign is loaded.

For example, imagine that you are using a custom faction defined by another add-on. The add-on guards all its custom units behind a SAMPLE_ADDON_UNITS define. Putting SAMPLE_ADDON_UNITS in your campaign's extra_defines will thus allow you to use those units in your campaign.

Those values listed on the wiki were merely a set of sample values that (prior to 1.16) had a useful effect defined by mainline when placed in extra_defines. It is not a list of every valid value that can be used.
Author of The Black Cross of Aleron campaign and Default++ era.
Former maintainer of Steelhive.
User avatar
beetlenaut
Developer
Posts: 2825
Joined: December 8th, 2007, 3:21 am
Location: Washington State
Contact:

Re: Is anyone else having a problem with the wolf advancement macro?

Post by beetlenaut »

I have re-edited the wiki. Hopefully it is correct now and the OP's problem won't happen to anyone else. (I was misled by the previous language in the wiki and the error message in the log. An entry in the change log probably would have made it clear, but that seems to have been forgotten.)
Campaigns: Dead Water,
The Founding of Borstep,
Secrets of the Ancients,
and WML Guide
Post Reply