Help filtering menu item based on sides unit & location
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.
Re: Help filtering menu item based on sides unit & location
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
- Posts: 369
- Joined: July 9th, 2019, 1:46 pm
Re: Help filtering menu item based on sides unit & location
AFAIR empty filter check if a unit exist there.
so the
test that there is no unit on you C* terrain and the
test that there is a unit on your K* terrain
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
- Legend_Rider
- Posts: 35
- Joined: June 20th, 2018, 4:51 pm
Re: Help filtering menu item based on sides unit & location
vghetto wrote: ↑January 25th, 2021, 8:09 pmCeltic_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".
Ok, that makes sense now!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
Thanks a bundle!