problem with filter_side

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

problem with filter_side

Post by vghetto »

Hello,

I'm having an issue with store_side and filter_side. I want to store only the sides that have a specific team_name, but it seems to be storing all sides regardless of the filter.

Code: Select all

[event]
        name=start

        [store_side]
                [filter_side]
                        team_name=GangTeam
                        user_team_name= _ "Axis Gang"
                [/filter_side]
                variable=temp_enemies
        [/store_side]

        [if]
                {VARIABLE_CONDITIONAL temp_enemies.length greater_than 0}
        [then]
                [message]
                        side=1
                        [and]
                                canrecruit=yes
                        [/and]
                        message=_"They allied themselves against us!"
                [/message]
        [/then]
        [/if]
        {CLEAR_VARIABLE temp_enemies}
Full code is https://github.com/virtualghetto/Vaelia ... s.cfg#L725

Please help, thanks.
User avatar
octalot
General Code Maintainer
Posts: 786
Joined: July 17th, 2010, 7:40 pm
Location: Austria

Re: problem with filter_side

Post by octalot »

Take out the [filter_side] tag, [store_side] is itself a filter.
vghetto
Posts: 755
Joined: November 2nd, 2019, 5:12 pm

Re: problem with filter_side

Post by vghetto »

That worked. Indeed, the wiki does say not to do what I did.
https://wiki.wesnoth.org/FilterWML/Exam ... conditions.

Thank you
Post Reply