Set Menu Item [filter_location]

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
User avatar
Saizo-Luz
Posts: 83
Joined: June 14th, 2024, 12:50 pm
Location: High Heavens

Set Menu Item [filter_location]

Post by Saizo-Luz »

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? :hmm: 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?
white_haired_uncle
Posts: 1456
Joined: August 26th, 2018, 11:46 pm
Location: A country place, far outside the Wire

Re: Set Menu Item [filter_location]

Post by white_haired_uncle »

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.
Speak softly, and carry Doombringer.
User avatar
Saizo-Luz
Posts: 83
Joined: June 14th, 2024, 12:50 pm
Location: High Heavens

Re: Set Menu Item [filter_location]

Post by Saizo-Luz »

white_haired_uncle wrote: September 15th, 2024, 7:27 pm Probably want to ask in the WML forum.
Oh God! :doh: Missclick! Sorry! I must have read it too fast!
User avatar
Saizo-Luz
Posts: 83
Joined: June 14th, 2024, 12:50 pm
Location: High Heavens

Set Menu Item [filter_location] - WML FORUM THIS TIME

Post by Saizo-Luz »

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? :hmm: 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! :x
gnombat
Posts: 892
Joined: June 10th, 2010, 8:49 pm

Re: Set Menu Item [filter_location]

Post by gnombat »

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]
white_haired_uncle
Posts: 1456
Joined: August 26th, 2018, 11:46 pm
Location: A country place, far outside the Wire

Re: Set Menu Item [filter_location]

Post by white_haired_uncle »

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.
User avatar
Saizo-Luz
Posts: 83
Joined: June 14th, 2024, 12:50 pm
Location: High Heavens

Re: Set Menu Item [filter_location]

Post by Saizo-Luz »

I'm so stupid! :doh:
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]
That's exactly what I want! It works just fine! Thank you so much! :D
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.
There is no need! No possibilities of overlays!
Post Reply