https://wiki.wesnoth.org/api.php?action=feedcontributions&user=Markhorne&feedformat=atomThe Battle for Wesnoth Wiki - User contributions [en]2024-03-28T16:12:53ZUser contributionsMediaWiki 1.31.16https://wiki.wesnoth.org/index.php?title=FilterWML&diff=24826FilterWML2008-03-29T04:30:09Z<p>Markhorne: /* Filtering Weapons */</p>
<hr />
<div>{{WML Tags}}<br />
== Filtering in WML ==<br />
<br />
A ''filter'' is a special WML block.<br />
Filters are used to describe a set of units, hexes, or weapons.<br />
Filters are defined as matching something if all the keys in the filter match that thing.<br />
For example, if a unit filter contains two keys,<br />
a unit must match both of the keys in order to match the filter.<br />
<br />
== Filtering Units ==<br />
<br />
Filters are often used in action tags (see [[EventWML]]).<br />
In this case the phrase "standard unit filter" is used in place of the set of standard keys.<br />
Sometimes a filter is used to find the first unit that matches the filter;<br />
for example, the '''[recall]''' tag recalls that unit.<br />
<br />
Standard unit filters are also used in the tags '''[filter]''' and '''[filter_second]'''.<br />
These are subtags of '''[event]''' which describe when the event should trigger.<br />
Most event names (see [[EventWML]]) have units related to them called "primary unit" and "secondary unit".<br />
In order for an event to be triggered, ''primary unit'' must match the filter contained in '''[filter]''',<br />
and ''secondary unit'' must match the filter contained in '''[filter_second]'''.<br />
<br />
See [[StandardUnitFilter]] for details.<br />
<br />
== Filtering Locations ==<br />
<br />
As you have seen, standard unit filter can contain a location filter.<br />
Several actions, such as '''[terrain]''', also use location filters.<br />
Location filters are represented on this site by the phrase "standard location filter".<br />
<br />
See [[StandardLocationFilter]] for details.<br />
<br />
== Filtering Weapons ==<br />
<br />
Sometimes weapons are filtered on in WML. See also [[EventWML]], [[EffectWML]], [[AnimationWML]].<br />
<br />
These keys are used as filter input for weapon filters.<br />
<br />
* '''range''': a range to filter<br />
** '''melee''': only melee weapons pass <br />
** '''ranged''': only ranged weapons pass <br />
* '''name''': filter on the attack's name.<br />
See '''data/units/''' or http://wesnoth.slack.it/unitlist.cgi<br />
to find the name of a particular unit's attack.<br />
* '''type''': filter on the attack's type.<br />
Values are 'blade', 'pierce', 'impact', 'fire', 'cold', and 'arcane'.<br />
* '''special''': filter on the attack's special power.<br />
For values see [[AbilitiesWML]].<br />
<br />
== Filtering Terrains ==<br />
<br />
Use '''[filter_location]''' within '''[filter]''' , for example:<br />
<br />
[event]<br />
:[filter]<br />
::[filter_location]<br />
::terrain=Ch <br />
::[/filter_location]<br />
:[/filter]<br />
[/event]<br />
<br />
At some places the terrains can be filtered with a <br />
match list. The list is a comma separated list and matching will stop<br />
at the first matched [[TerrainCodesWML|terrain string]]. There's one special character<br />
''!'' which inverts the meaning of a match. Terrain strings can <br />
use the wildcard * to match zero or more following letters, characters<br />
behind the * are not allowed and the result is undefined.<br />
<br />
Eg: <br><br />
ww* matches ww, www, wwW but not WWW <br><br />
!, ww returns false if ww found and true if not <br><br />
!, ww, wa, !, aa returns false if ww or wa found and true if aa found and false if none found.<br />
<br />
For a list of terrain types and their string codes see [[TerrainCodesWML|TerrainCodesWML]].<br />
<br />
== See Also ==<br />
<br />
* [[UnitWML]]<br />
* [[EventWML]]<br />
* [[ReferenceWML]]<br />
<br />
[[Category: WML Reference]]</div>Markhornehttps://wiki.wesnoth.org/index.php?title=FilterWML&diff=24825FilterWML2008-03-29T04:27:47Z<p>Markhorne: /* Filtering Terrains */</p>
<hr />
<div>{{WML Tags}}<br />
== Filtering in WML ==<br />
<br />
A ''filter'' is a special WML block.<br />
Filters are used to describe a set of units, hexes, or weapons.<br />
Filters are defined as matching something if all the keys in the filter match that thing.<br />
For example, if a unit filter contains two keys,<br />
a unit must match both of the keys in order to match the filter.<br />
<br />
== Filtering Units ==<br />
<br />
Filters are often used in action tags (see [[EventWML]]).<br />
In this case the phrase "standard unit filter" is used in place of the set of standard keys.<br />
Sometimes a filter is used to find the first unit that matches the filter;<br />
for example, the '''[recall]''' tag recalls that unit.<br />
<br />
Standard unit filters are also used in the tags '''[filter]''' and '''[filter_second]'''.<br />
These are subtags of '''[event]''' which describe when the event should trigger.<br />
Most event names (see [[EventWML]]) have units related to them called "primary unit" and "secondary unit".<br />
In order for an event to be triggered, ''primary unit'' must match the filter contained in '''[filter]''',<br />
and ''secondary unit'' must match the filter contained in '''[filter_second]'''.<br />
<br />
See [[StandardUnitFilter]] for details.<br />
<br />
== Filtering Locations ==<br />
<br />
As you have seen, standard unit filter can contain a location filter.<br />
Several actions, such as '''[terrain]''', also use location filters.<br />
Location filters are represented on this site by the phrase "standard location filter".<br />
<br />
See [[StandardLocationFilter]] for details.<br />
<br />
== Filtering Weapons ==<br />
<br />
Sometimes weapons are filtered on in WML. See also [[EventWML]], [[EffectWML]], [[AnimationWML]].<br />
<br />
These keys are used as filter input for weapon filters.<br />
<br />
* '''range''': a range to filter<br />
** '''melee''': only melee weapons pass <br />
** '''ranged''': only ranged weapons pass <br />
* '''name''': filter on the attack's name.<br />
See '''data/units/''' or http://wesnoth.slack.it/unitlist.cgi<br />
to find the name of a particular unit's attack.<br />
* '''type''': filter on the attack's type.<br />
Values are 'blade', 'pierce', 'impact', 'fire', 'cold', and 'arcane'.<br />
* '''special''': filter on the attack's special power.<br />
For values see [[AbilitiesWML]].<br />
<br />
=== Filtering Terrains ===<br />
<br />
Use '''[filter_location]''' within '''[filter]''' , for example:<br />
<br />
[event]<br />
:[filter]<br />
::[filter_location]<br />
::terrain=Ch <br />
::[/filter_location]<br />
:[/filter]<br />
[/event]<br />
<br />
At some places the terrains can be filtered with a <br />
match list. The list is a comma separated list and matching will stop<br />
at the first matched [[TerrainCodesWML|terrain string]]. There's one special character<br />
''!'' which inverts the meaning of a match. Terrain strings can <br />
use the wildcard * to match zero or more following letters, characters<br />
behind the * are not allowed and the result is undefined.<br />
<br />
Eg: <br><br />
ww* matches ww, www, wwW but not WWW <br><br />
!, ww returns false if ww found and true if not <br><br />
!, ww, wa, !, aa returns false if ww or wa found and true if aa found and false if none found.<br />
<br />
For a list of terrain types and their string codes see [[TerrainCodesWML|TerrainCodesWML]].<br />
<br />
== See Also ==<br />
<br />
* [[UnitWML]]<br />
* [[EventWML]]<br />
* [[ReferenceWML]]<br />
<br />
[[Category: WML Reference]]</div>Markhornehttps://wiki.wesnoth.org/index.php?title=FilterWML&diff=24824FilterWML2008-03-29T04:01:33Z<p>Markhorne: /* Filtering Terrains */</p>
<hr />
<div>{{WML Tags}}<br />
== Filtering in WML ==<br />
<br />
A ''filter'' is a special WML block.<br />
Filters are used to describe a set of units, hexes, or weapons.<br />
Filters are defined as matching something if all the keys in the filter match that thing.<br />
For example, if a unit filter contains two keys,<br />
a unit must match both of the keys in order to match the filter.<br />
<br />
== Filtering Units ==<br />
<br />
Filters are often used in action tags (see [[EventWML]]).<br />
In this case the phrase "standard unit filter" is used in place of the set of standard keys.<br />
Sometimes a filter is used to find the first unit that matches the filter;<br />
for example, the '''[recall]''' tag recalls that unit.<br />
<br />
Standard unit filters are also used in the tags '''[filter]''' and '''[filter_second]'''.<br />
These are subtags of '''[event]''' which describe when the event should trigger.<br />
Most event names (see [[EventWML]]) have units related to them called "primary unit" and "secondary unit".<br />
In order for an event to be triggered, ''primary unit'' must match the filter contained in '''[filter]''',<br />
and ''secondary unit'' must match the filter contained in '''[filter_second]'''.<br />
<br />
See [[StandardUnitFilter]] for details.<br />
<br />
== Filtering Locations ==<br />
<br />
As you have seen, standard unit filter can contain a location filter.<br />
Several actions, such as '''[terrain]''', also use location filters.<br />
Location filters are represented on this site by the phrase "standard location filter".<br />
<br />
See [[StandardLocationFilter]] for details.<br />
<br />
== Filtering Weapons ==<br />
<br />
Sometimes weapons are filtered on in WML. See also [[EventWML]], [[EffectWML]], [[AnimationWML]].<br />
<br />
These keys are used as filter input for weapon filters.<br />
<br />
* '''range''': a range to filter<br />
** '''melee''': only melee weapons pass <br />
** '''ranged''': only ranged weapons pass <br />
* '''name''': filter on the attack's name.<br />
See '''data/units/''' or http://wesnoth.slack.it/unitlist.cgi<br />
to find the name of a particular unit's attack.<br />
* '''type''': filter on the attack's type.<br />
Values are 'blade', 'pierce', 'impact', 'fire', 'cold', and 'arcane'.<br />
* '''special''': filter on the attack's special power.<br />
For values see [[AbilitiesWML]].<br />
<br />
=== Filtering Terrains ===<br />
<br />
Use '''[filter_location]''' within '''[filter]''' , for example:<br />
<br />
[event]<br />
:[filter]<br />
::[filter_location]<br />
::terrain=Ch <br />
::[/filter_location]<br />
:[/filter]<br />
[/event]<br />
<br />
At some places the terrains can be filtered with a <br />
match list. The list is a comma separated list and matching will stop<br />
at the first matched [[TerrainCodesWML|terrain string]]. There's one special character<br />
''!'' which inverts the meaning of a match. Terrain strings can <br />
use the wildcard * to match zero or more following letters, characters<br />
behind the * are not allowed and the result is undefined.<br />
<br />
Eg: <br><br />
ww* matches ww, www, wwW but not WWW <br><br />
!, ww returns false if ww found and true if not <br><br />
!, ww, wa, !, aa returns false if ww or wa found and true if aa found and false if none found.<br />
<br />
== See Also ==<br />
<br />
* [[UnitWML]]<br />
* [[EventWML]]<br />
* [[ReferenceWML]]<br />
<br />
[[Category: WML Reference]]</div>Markhornehttps://wiki.wesnoth.org/index.php?title=FilterWML&diff=24823FilterWML2008-03-29T04:00:18Z<p>Markhorne: /* Filtering Terrains */</p>
<hr />
<div>{{WML Tags}}<br />
== Filtering in WML ==<br />
<br />
A ''filter'' is a special WML block.<br />
Filters are used to describe a set of units, hexes, or weapons.<br />
Filters are defined as matching something if all the keys in the filter match that thing.<br />
For example, if a unit filter contains two keys,<br />
a unit must match both of the keys in order to match the filter.<br />
<br />
== Filtering Units ==<br />
<br />
Filters are often used in action tags (see [[EventWML]]).<br />
In this case the phrase "standard unit filter" is used in place of the set of standard keys.<br />
Sometimes a filter is used to find the first unit that matches the filter;<br />
for example, the '''[recall]''' tag recalls that unit.<br />
<br />
Standard unit filters are also used in the tags '''[filter]''' and '''[filter_second]'''.<br />
These are subtags of '''[event]''' which describe when the event should trigger.<br />
Most event names (see [[EventWML]]) have units related to them called "primary unit" and "secondary unit".<br />
In order for an event to be triggered, ''primary unit'' must match the filter contained in '''[filter]''',<br />
and ''secondary unit'' must match the filter contained in '''[filter_second]'''.<br />
<br />
See [[StandardUnitFilter]] for details.<br />
<br />
== Filtering Locations ==<br />
<br />
As you have seen, standard unit filter can contain a location filter.<br />
Several actions, such as '''[terrain]''', also use location filters.<br />
Location filters are represented on this site by the phrase "standard location filter".<br />
<br />
See [[StandardLocationFilter]] for details.<br />
<br />
== Filtering Weapons ==<br />
<br />
Sometimes weapons are filtered on in WML. See also [[EventWML]], [[EffectWML]], [[AnimationWML]].<br />
<br />
These keys are used as filter input for weapon filters.<br />
<br />
* '''range''': a range to filter<br />
** '''melee''': only melee weapons pass <br />
** '''ranged''': only ranged weapons pass <br />
* '''name''': filter on the attack's name.<br />
See '''data/units/''' or http://wesnoth.slack.it/unitlist.cgi<br />
to find the name of a particular unit's attack.<br />
* '''type''': filter on the attack's type.<br />
Values are 'blade', 'pierce', 'impact', 'fire', 'cold', and 'arcane'.<br />
* '''special''': filter on the attack's special power.<br />
For values see [[AbilitiesWML]].<br />
<br />
=== Filtering Terrains ===<br />
<br />
Use [filter_location] within [filter] , for example:<br />
<br />
[event]<br />
:[filter]<br />
::[filter_location]<br />
::terrain=Ch <br />
::[/filter_location]<br />
:[/filter]<br />
[/event]<br />
<br />
At some places the terrains can be filtered with a <br />
match list. The list is a comma separated list and matching will stop<br />
at the first matched [[TerrainCodesWML|terrain string]]. There's one special character<br />
''!'' which inverts the meaning of a match. Terrain strings can <br />
use the wildcard * to match zero or more following letters, characters<br />
behind the * are not allowed and the result is undefined.<br />
<br />
Eg: <br><br />
ww* matches ww, www, wwW but not WWW <br><br />
!, ww returns false if ww found and true if not <br><br />
!, ww, wa, !, aa returns false if ww or wa found and true if aa found and false if none found.<br />
<br />
== See Also ==<br />
<br />
* [[UnitWML]]<br />
* [[EventWML]]<br />
* [[ReferenceWML]]<br />
<br />
[[Category: WML Reference]]</div>Markhorne