I dont understand why the filter do not work properly
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.
I dont understand why the filter do not work properly
If i have this code. It works as expected, the meny only appers around the Empire_barracks unit.
but as long as I change it to this.
The menu never appears around the unit, even if it has 0 ,4, or 5 moves or whatever number of moves.
The idea is that the menu do not appear if the unit has 0 moves left, but for some reason it makes it so it never appears under any condition. I tried and tried and i got to a clueless spot.
thanks
Code: Select all
[set_menu_item]
id=menu_barracks
description=_"~Barracks menu"
image=themes/units.png
[show_if]
[not]
[have_unit]
x,y=$x1,$y1
[/have_unit]
[/not]
[have_location]
[filter]
side=$side_number
type=Empire_Barracks
[/filter]
[and]
x=$x1
y=$y1
radius=1
[/and]
[/have_location]
[/show_if]
Code: Select all
[set_menu_item]
id=menu_barracks
description=_"~Barracks menu"
image=themes/units.png
[show_if]
[not]
[have_unit]
x,y=$x1,$y1
[/have_unit]
[/not]
[have_location]
[filter]
side=$side_number
type=Empire_Barracks
[not]
[wml_filter]
moves=0
[/wml_filter]
[/not]
[/filter]
[and]
x=$x1
y=$y1
radius=1
[/and]
[/have_location]
[/show_if]
The idea is that the menu do not appear if the unit has 0 moves left, but for some reason it makes it so it never appears under any condition. I tried and tried and i got to a clueless spot.
thanks
Re: I dont understand why the filter do not work properly
[wml_filter] -> [filter_wml]