[filter_adjacent_location] and [not] problems

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.
Post Reply
Ghite
Posts: 23
Joined: July 7th, 2013, 11:28 pm

[filter_adjacent_location] and [not] problems

Post by Ghite »

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?

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]
User avatar
beetlenaut
Developer
Posts: 2529
Joined: December 8th, 2007, 3:21 am
Location: Washington State
Contact:

Re: [filter_adjacent_location] and [not] problems

Post by beetlenaut »

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
User avatar
Sapient
Inactive Developer
Posts: 4453
Joined: November 26th, 2005, 7:41 am
Contact:

Re: [filter_adjacent_location] and [not] problems

Post by Sapient »

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."
Inanna
Posts: 1
Joined: November 29th, 2011, 5:19 pm

Re: [filter_adjacent_location] and [not] problems

Post by Inanna »

test it

Code: Select all

terrain="Xu*,*^Xo"
Post Reply