[closed] Last breath [have_unit]

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
ZombieKnight
Posts: 180
Joined: June 27th, 2022, 2:26 pm
Location: Czech Republic

[closed] Last breath [have_unit]

Post by ZombieKnight »

Hi,
I'd like to filter if unit with id=$my_unit_id is visible for side=1 in [event] name=last breath [filter] id=$my_unit_id
And apparently [have_unit], [filter_vision] doesn't recognize units with HP<0
How to do so?
Last edited by ZombieKnight on March 31st, 2024, 12:24 pm, edited 1 time in total.
I had saurian in profile before, but I've merged my discord profile with forum one...
User avatar
Ravana
Forum Moderator
Posts: 3018
Joined: January 29th, 2012, 12:49 am
Location: Estonia
Contact:

Re: Last breath [have_unit]

Post by Ravana »

Dont use have_unit then.
User avatar
ZombieKnight
Posts: 180
Joined: June 27th, 2022, 2:26 pm
Location: Czech Republic

Re: Last breath [have_unit]

Post by ZombieKnight »

But how to show a dialog only if I see that unit?
I had saurian in profile before, but I've merged my discord profile with forum one...
User avatar
Ravana
Forum Moderator
Posts: 3018
Joined: January 29th, 2012, 12:49 am
Location: Estonia
Contact:

Re: Last breath [have_unit]

Post by Ravana »

Store it.
User avatar
ZombieKnight
Posts: 180
Joined: June 27th, 2022, 2:26 pm
Location: Czech Republic

Re: Last breath [have_unit]

Post by ZombieKnight »

Not sure if thats what you advise, but I can store units location and then [have_location] [filter_vision]...
I'll try it today
I had saurian in profile before, but I've merged my discord profile with forum one...
User avatar
ZombieKnight
Posts: 180
Joined: June 27th, 2022, 2:26 pm
Location: Czech Republic

Re: Last breath [have_unit]

Post by ZombieKnight »

Code: Select all

[store_unit]
            [filter]
                id=progi
            [/filter]
            variable=is_this_unit_visible
        [/store_unit]
        [if]
            [have_location]
                x,y=$is_this_unit_visible.x,$is_this_unit_visible.y
                [filter_vision]
                    side=1
                [/filter_vision]
            [/have_location]
Jup this works, thanks
I had saurian in profile before, but I've merged my discord profile with forum one...
Post Reply