filtering on a list of roles

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
vghetto
Posts: 755
Joined: November 2nd, 2019, 5:12 pm

filtering on a list of roles

Post by vghetto »

Hi,
In the wiki for StandardUnitFilter, you can use a comma separated list to [or] the filters.
Like race=drake,dwarf is similar to race=drake [or] race=dwarf [/or]
Does this apply to the role= tag? Can I give a comma separated list of roles? The wiki didn't specify.
Thanks
User avatar
Ravana
Forum Moderator
Posts: 3011
Joined: January 29th, 2012, 12:49 am
Location: Estonia
Contact:

Re: filtering on a list of roles

Post by Ravana »

Test it and document the way it is.
vghetto
Posts: 755
Joined: November 2nd, 2019, 5:12 pm

Re: filtering on a list of roles

Post by vghetto »

Seems the assigned role itself can have a comma. So no, you have to use [or] in the filter for it to work, it cannot be a list.

Code: Select all

	[event]
		name=prestart

                [unit]
                        side=1
                        type=White Mage
                        role=Angel
                        placement=leader
                [/unit]

                [unit]
                        side=1
                        type=Red Mage
                        role=Devil
                        placement=leader
                [/unit]
        [/event]

        [event]
                name=moveto
                first_time_only=no

                [filter]
                        # This did not work for either.
                        # role="Angel","Devil"
                        # role=Angel,Devil

                        # This worked
                        role=Angel
                        [or]
                                role=Devil
                        [/or]
                [/filter]
                [message]
                        speaker=unit
                        message="I'm the $unit.role"
                [/message]
        [/event]
Post Reply