filter_adjacent in resistance tag not working

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.
newfrenchy83
Code Contributor
Posts: 202
Joined: October 6th, 2017, 12:57 pm

Re: filter_adjacent in resistance tag not working

Post by newfrenchy83 »

I'm not asking for the number of units counted but if it's normal for you that all [filter_adjacent] in the same ability must meet the conditions, because if no conditions overlap like [filter_adjacent]race=elf and [filter_adjacent]race=human then the ability has no chance of working
User avatar
lhybrideur
Posts: 454
Joined: July 9th, 2019, 1:46 pm

Re: filter_adjacent in resistance tag not working

Post by lhybrideur »

you should use

Code: Select all

[filter_adjacent]
   race=human,elf
[/filter_adjacent]
or

Code: Select all

[filter_adjacent]
   race=human
   [or]
      race=elf
   [/or]
[/filter_adjacent]
then, shouldn't you?
Because filters are "added" (&) iirc.
newfrenchy83
Code Contributor
Posts: 202
Joined: October 6th, 2017, 12:57 pm

Re: filter_adjacent in resistance tag not working

Post by newfrenchy83 »

lhybrideur wrote: June 10th, 2025, 11:13 am you should use

Code: Select all

[filter_adjacent]
   race=human,elf
[/filter_adjacent]
or

Code: Select all

[filter_adjacent]
   race=human
   [or]
      race=elf
   [/or]
[/filter_adjacent]
then, shouldn't you?
Because filters are "added" (&) iirc.
If filter_adjacent are 'added', then what is the point of being able to put several in the same ability?
gnombat
Posts: 892
Joined: June 10th, 2010, 8:49 pm

Re: filter_adjacent in resistance tag not working

Post by gnombat »

newfrenchy83 wrote: June 10th, 2025, 11:58 am If filter_adjacent are 'added', then what is the point of being able to put several in the same ability?
Isn't it just a general rule that listing multiple filters (of any type) is equivalent to combining them with [and]?

See the example in Writing complex filters: "...a simple rule: [and] tags are not needed when they contain one single criterion or a single block..."

Of course, not every combination of filters will actually make sense. Some combinations of filters will simply match nothing.
newfrenchy83
Code Contributor
Posts: 202
Joined: October 6th, 2017, 12:57 pm

Re: filter_adjacent in resistance tag not working

Post by newfrenchy83 »

Do you think this makes sense in this specific case?
gnombat
Posts: 892
Joined: June 10th, 2010, 8:49 pm

Re: filter_adjacent in resistance tag not working

Post by gnombat »

newfrenchy83 wrote: June 10th, 2025, 12:33 pm Do you think this makes sense in this specific case?
Wouldn't it be confusing to make a different rule just for one specific case that works differently from the way filters work everywhere else?
Soliton
Site Administrator
Posts: 1731
Joined: April 5th, 2005, 3:25 pm
Location: #wesnoth-mp

Re: filter_adjacent in resistance tag not working

Post by Soliton »

The wiki edits are confusing...

[filter_adjacent] in an ability is definitely not from 1.19.10. It's much, much older. This was added in two places and only one was converted to a note that might be explaining a bugfix?

I don't really understand what
if a unit does not match [filter_adjacent] it is not invalidated if the other units match the standard filters as well as the direction and number conditions
might mean. It repeats [filter_adjacent] in the paragraph about [filter_adjacent] which is confusing. What other units is it talking about? Invalidated means the filter does not match? "the direction and number conditions" are the additional attributes [filter_adjacent] accepts over a SUF?

What is the point of putting multiple [filter_adjacent] in an ability? Presumably no point other than it can be done so the engine has to do something.
"If gameplay requires it, they can be made to live on Venus." -- scott
newfrenchy83
Code Contributor
Posts: 202
Joined: October 6th, 2017, 12:57 pm

Re: filter_adjacent in resistance tag not working

Post by newfrenchy83 »

This relates to my question, what is the point of having several [filter_adjacent] if they all have to match for the ability to be active, if the correspondence is necessary for only one of them, I would understand but there it is useless
User avatar
Ravana
Forum Moderator
Posts: 3313
Joined: January 29th, 2012, 12:49 am
Location: Estonia
Contact:

Re: filter_adjacent in resistance tag not working

Post by Ravana »

Why you are talking about multiple? The example that fails only uses one.
newfrenchy83
Code Contributor
Posts: 202
Joined: October 6th, 2017, 12:57 pm

Re: filter_adjacent in resistance tag not working

Post by newfrenchy83 »

Ravana wrote: June 12th, 2025, 11:04 am Why you are talking about multiple? The example that fails only uses one.
as i told you before, if you are not using wesnoth 1.19.10 or later, then you need to put [filter_adjacent] in [filter]
User avatar
Ravana
Forum Moderator
Posts: 3313
Joined: January 29th, 2012, 12:49 am
Location: Estonia
Contact:

Re: filter_adjacent in resistance tag not working

Post by Ravana »

Soliton confirmed that [filter_adjacent] was supported before 1.19.10 too.
newfrenchy83
Code Contributor
Posts: 202
Joined: October 6th, 2017, 12:57 pm

Re: filter_adjacent in resistance tag not working

Post by newfrenchy83 »

Ravana wrote: June 12th, 2025, 3:40 pm Soliton confirmed that [filter_adjacent] was supported before 1.19.10 too.
supported but bugged
User avatar
Ravana
Forum Moderator
Posts: 3313
Joined: January 29th, 2012, 12:49 am
Location: Estonia
Contact:

Re: filter_adjacent in resistance tag not working

Post by Ravana »

That contradicts what you said before. If it is so completely bugged then it was never supported at all.
newfrenchy83
Code Contributor
Posts: 202
Joined: October 6th, 2017, 12:57 pm

Re: filter_adjacent in resistance tag not working

Post by newfrenchy83 »

Ravana wrote: June 12th, 2025, 4:36 pm That contradicts what you said before. If it is so completely bugged then it was never supported at all.
It's soliton who claims it was supported before 1.19.10 despite its inability to work outside of [filter], not me
User avatar
Ravana
Forum Moderator
Posts: 3313
Joined: January 29th, 2012, 12:49 am
Location: Estonia
Contact:

Re: filter_adjacent in resistance tag not working

Post by Ravana »

Last page you gave me impression [filter_adjacent] is completely broken before {{DevFeature1.19|10}}. But in https://wiki.wesnoth.org/index.php?titl ... ldid=74392 you said it still worked before as well by removing the dev feature marker.
Post Reply