[closed] How to filter if units side is allied with side 1

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] How to filter if units side is allied with side 1

Post by ZombieKnight »

Hi,
How to filter if $my_unit.side is allied with side=1?
I've found no [if] "have side"
Any idea?
Last edited by ZombieKnight on March 31st, 2024, 12:13 pm, edited 1 time in total.
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: How to filter if units side is allied with side 1

Post by ZombieKnight »

I know but how to filter sides in [if] tag?
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: How to filter if units side is allied with side 1

Post by Ravana »

Define function wesnoth.wml_conditionals.have_side if you really need it without actionWML.
User avatar
Pentarctagon
Project Manager
Posts: 5567
Joined: March 22nd, 2009, 10:50 pm
Location: Earth (occasionally)

Re: How to filter if units side is allied with side 1

Post by Pentarctagon »

Presumably you could use [have_unit]?
99 little bugs in the code, 99 little bugs
take one down, patch it around
-2,147,483,648 little bugs in the code
User avatar
ZombieKnight
Posts: 180
Joined: June 27th, 2022, 2:26 pm
Location: Czech Republic

Re: How to filter if units side is allied with side 1

Post by ZombieKnight »

Hmm, yes thats a good idea I can use [have_unit] id=$my_unit.id [filter_side] allied with.
Thanks, 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: How to filter if units side is allied with side 1

Post by ZombieKnight »

Jup,
Thanks!

Code: Select all

[if]
        [have_unit]
            id=$speaking_unit.id
            [filter_side]
                [allied_with]
                    side=1
                [/allied_with]
            [/filter_side]
        [/have_unit]
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: How to filter if units side is allied with side 1

Post by ZombieKnight »

Can someone mark this as "Closed"?
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: How to filter if units side is allied with side 1

Post by Ravana »

We wont do that.
User avatar
ZombieKnight
Posts: 180
Joined: June 27th, 2022, 2:26 pm
Location: Czech Republic

Re: How to filter if units side is allied with side 1

Post by ZombieKnight »

Can I do that?
Or do you think it isn't closed?
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: [closed] How to filter if units side is allied with side 1

Post by ZombieKnight »

Oh I see... is it good like so?
I had saurian in profile before, but I've merged my discord profile with forum one...
Post Reply