What syntax does [filter_location] use?

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
quantumfleet
Posts: 38
Joined: June 17th, 2011, 1:26 am

What syntax does [filter_location] use?

Post by quantumfleet »

So, I've been creating a scenario with a sighted event. The wiki says that name=sighted events are buggy and are to be avoided, so I did, and the wiki suggests using [filter_location] tags inside a moveto event instead, so I am trying to. But I can't seem to get the event to fire properly! The event fires everywhere the player travels, no matter what I try to do.

Code: Select all

[event]
name=moveto
[filter]
side=1
[filter_vision]
viewing_side=1
x,y=5-7,12-14
[/filter_vision]
[/filter]

. . .
[/event] 
I've tried replacing x,y= with x= & y=; I've tried various combinations of [filter_location] and [filter_vision], but the event fires no matter what the player can see.
Currently working on various ideas using 1.9.8.9
User avatar
Sapient
Inactive Developer
Posts: 4453
Joined: November 26th, 2005, 7:41 am
Contact:

Re: What syntax does [filter_location] use?

Post by Sapient »

That [filter_vision] means that side 1 can see the unit, which is a side 1 unit. This will always be true.

There are several options posted in the forums as possible sighted replacements, but none of them is totally perfect. Here is a link to a pretty simple example that combines sighted event with [filter_vision] and moveto:

http://forums.wesnoth.org/viewtopic.php ... 66#p443466

Also check the wiki article itself:
http://wiki.wesnoth.org/FilterWML#Filtering_Vision

As you can see, [filter_vision] does not accept x or y attributes.
http://www.wesnoth.org/wiki/User:Sapient... "Looks like your skills saved us again. Uh, well at least, they saved Soarin's apple pie."
quantumfleet
Posts: 38
Joined: June 17th, 2011, 1:26 am

Re: What syntax does [filter_location] use?

Post by quantumfleet »

So I'm fundamentally misunderstanding what the tag does? Ah well, I have a (relatively) quick workaround in mind. Thanks.
Currently working on various ideas using 1.9.8.9
Post Reply