[filter_adjacent_location] and [not] problems
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.
[filter_adjacent_location] and [not] problems
I am trying to filter for a not having cave wall hex straight south of the unit in my moveto event.
I can't seem to get it right. I've tried many times, read many wiki pages, and looked at a few forum topics, but I'm stuck.
Any idea?
I can't seem to get it right. I've tried many times, read many wiki pages, and looked at a few forum topics, but I'm stuck.
Any idea?
Code: Select all
[filter]
[filter_adjacent]
adjacent=s
[filter_location]
[not]
terrain=*Xu*,*Xo*
[/not]
[/filter_location]
[/filter_adjacent]
[/filter]
Code: Select all
[filter]
[filter_location]
[filter_adjacent_location]
adjacent=s
[not]
terrain=*Xu*,*Xo*
[/not]
[/filter_adjacent_location]
[/filter_location]
[/filter]
Code: Select all
[filter]
[filter_location]
[filter_adjacent_location]
[not]
adjacent=s
terrain=*Xu*,*Xo*
[/not]
[/filter_adjacent_location]
[/filter_location]
[/filter]
Code: Select all
[filter]
[filter_location]
[filter_adjacent_location]
adjacent=s
[not]
terrain=*Xu*,*Xo*
[/not]
[/filter_adjacent_location]
[/filter_location]
[/filter]
Code: Select all
[filter]
[not]
[filter_location]
[filter_adjacent_location]
adjacent=s
terrain=*Xu*,*Xo*
[/filter_adjacent_location]
[/filter_location]
[/not]
[/filter]
- beetlenaut
- Developer
- Posts: 2529
- Joined: December 8th, 2007, 3:21 am
- Location: Washington State
- Contact:
Re: [filter_adjacent_location] and [not] problems
You can only end a terrain code with an asterisk; it can't go a the beginning:
terrain=Xu*,Xo*
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: [filter_adjacent_location] and [not] problems
Other than the issue mentioned by beetlenaut, most of those filters you listed seem correct, other than the first and third one. The first one won't work unless there is a unit standing on the adjacent cave wall. The third one won't work because adjacent= is in a child filter. The second and fourth one appear to be the same. There's at least one other way to write it too, such as negating the terrain filter instead of using [not].
http://www.wesnoth.org/wiki/User:Sapient... "Looks like your skills saved us again. Uh, well at least, they saved Soarin's apple pie."
Re: [filter_adjacent_location] and [not] problems
test it
Code: Select all
terrain="Xu*,*^Xo"