Please help me with the filter.
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.
Please help me with the filter.
Hello. I'm sorry for a rather trivial question, but testing it with my current setup is particularly troublesome.
I am trying to write an [if] trigger, which triggers when there are zero units in the designated area.
I tried with [have_location], however it does not work:
How to write it correctly? Could [have_unit] work here?
I am trying to write an [if] trigger, which triggers when there are zero units in the designated area.
I tried with [have_location], however it does not work:
Code: Select all
[have_location]
x=13-14,14-15
y=24,22
radius=1
[and]
[filter]
side=1
[/filter]
[/and]
count=0
[/have_location]
Re: Please help me with the filter.
I would use
[have_unit]
with a [filter_location]
inside.Re: Please help me with the filter.
Looks like confusion can happen because of radius.
For testing setup I suggest viewtopic.php?t=56440
For testing setup I suggest viewtopic.php?t=56440
- beetlenaut
- Developer
- Posts: 2814
- Joined: December 8th, 2007, 3:21 am
- Location: Washington State
- Contact:
Re: Please help me with the filter.
The "count" above means the number of locations that must match this location filter, which is not what you want. I'm doubtful that "count=0" is even allowed. Instead, put the keys inside a [not] tag to reverse the filter.
Campaigns: Dead Water,
The Founding of Borstep,
Secrets of the Ancients,
and WML Guide
The Founding of Borstep,
Secrets of the Ancients,
and WML Guide
Re: Please help me with the filter.
Count=0 should work still, but [not][have_unit] would reflect your intentions better.
- Celtic_Minstrel
- Developer
- Posts: 2166
- Joined: August 3rd, 2012, 11:26 pm
- Location: Canada
- Contact:
Re: Please help me with the filter.
The filter you wrote triggers only when there is a unit of side 1 in the designated area. The
count=0
does nothing, as it only has meaning in [filter_adjacent]
or [filter_adjacent_location]
.I think changing the
[and]
to [not]
and deleting side=1
should work, but I'm not quite sure how if that combines correctly with the radius.