Help filtering menu item based on sides unit & location

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.
vghetto
Posts: 755
Joined: November 2nd, 2019, 5:12 pm

Re: Help filtering menu item based on sides unit & location

Post by vghetto »

Celtic_Minstrel wrote: November 8th, 2019, 2:29 am In a location filter, an empty [filter] tag means "match only locations with units on them", so an empty [filter] tag in a [not] tag inverts that to "match only locations with no unit on them".
User avatar
lhybrideur
Posts: 369
Joined: July 9th, 2019, 1:46 pm

Re: Help filtering menu item based on sides unit & location

Post by lhybrideur »

AFAIR empty filter check if a unit exist there.

so the
terrain=C*
[not]
[filter]
[/filter]
[/not]

test that there is no unit on you C* terrain and the
[filter_adjacent_location]
terrain=K*
[filter]
[/filter]
[/filter_adjacent_location]

test that there is a unit on your K* terrain
User avatar
Legend_Rider
Posts: 35
Joined: June 20th, 2018, 4:51 pm

Re: Help filtering menu item based on sides unit & location

Post by Legend_Rider »

vghetto wrote: January 25th, 2021, 8:09 pm
Celtic_Minstrel wrote: November 8th, 2019, 2:29 am In a location filter, an empty [filter] tag means "match only locations with units on them", so an empty [filter] tag in a [not] tag inverts that to "match only locations with no unit on them".
lhybrideur wrote: January 26th, 2021, 2:34 pm AFAIR empty filter check if a unit exist there.

so the
terrain=C*
[not]
[filter]
[/filter]
[/not]

test that there is no unit on you C* terrain and the
[filter_adjacent_location]
terrain=K*
[filter]
[/filter]
[/filter_adjacent_location]

test that there is a unit on your K* terrain
Ok, that makes sense now!
Thanks a bundle! :D
Post Reply