Set Menu Item [filter_location]
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.
Set Menu Item [filter_location]
Hello!
I have a menu item, and I only want it to be shown in deep water terrain 'Wog' surrounded only by deep water 'Wog' as well. I'm having trouble doing it.
I just can't seem to get it right. Can someone help me?
I won't even mind showing how I did it because it simply doesn't work any way I try.
Does anyone know how to do it?
I have a menu item, and I only want it to be shown in deep water terrain 'Wog' surrounded only by deep water 'Wog' as well. I'm having trouble doing it.
I just can't seem to get it right. Can someone help me?

Does anyone know how to do it?
-
- Posts: 1456
- Joined: August 26th, 2018, 11:46 pm
- Location: A country place, far outside the Wire
Re: Set Menu Item [filter_location]
I assume [show_if] and [filter_adjacent_locations] (with count=) will be involved, maybe [have_location] or [have_unit] depending on what you want to do.
Probably want to ask in the WML forum.
Probably want to ask in the WML forum.
Speak softly, and carry Doombringer.
Re: Set Menu Item [filter_location]
Oh God!

Set Menu Item [filter_location] - WML FORUM THIS TIME
I have a menu item, and I only want it to be shown in deep water terrain 'Wog' surrounded only by deep water 'Wog' as well. I'm having trouble doing it.
I just can't seem to get it right. Can someone help me?
I won't even mind showing how I did it because it simply doesn't work any way I try.
Does anyone know how to do it?
I just have no idea how to do it! I also tried to do it by putting a condition in the command (if, then, else, have_unit, adjacent_location), but it didn't work! It almost gave me a headache!
I just can't seem to get it right. Can someone help me?

Does anyone know how to do it?
I just have no idea how to do it! I also tried to do it by putting a condition in the command (if, then, else, have_unit, adjacent_location), but it didn't work! It almost gave me a headache!

Re: Set Menu Item [filter_location]
Does this do what you want?
Code: Select all
[set_menu_item]
id="click_click"
description=_ "CLICK CLICK"
[filter_location]
terrain=Wog
[filter_adjacent_location]
terrain=Wog
count=6
[/filter_adjacent_location]
[/filter_location]
[command]
[message]
speaker=narrator
message=_ "NOT YET IMPLEMENTED"
[/message]
[/command]
[/set_menu_item]
-
- Posts: 1456
- Joined: August 26th, 2018, 11:46 pm
- Location: A country place, far outside the Wire
Re: Set Menu Item [filter_location]
Might want to consider Wog* if there's a possibility of any kinds of overlays. Might also specifically NOT want Wog*, but it's worth thinking about.
Speak softly, and carry Doombringer.
Re: Set Menu Item [filter_location]
I'm so stupid!

That's exactly what I want! It works just fine! Thank you so much!gnombat wrote: ↑September 15th, 2024, 8:19 pm Does this do what you want?
Code: Select all
[filter_location] terrain=Wog [filter_adjacent_location] terrain=Wog count=6 [/filter_adjacent_location] [/filter_location]

There is no need! No possibilities of overlays!white_haired_uncle wrote: ↑September 15th, 2024, 11:19 pm Might want to consider Wog* if there's a possibility of any kinds of overlays. Might also specifically NOT want Wog*, but it's worth thinking about.