How to check if all mages are within a list of hexes?

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
Marcgal

How to check if all mages are within a list of hexes?

Post by Marcgal »

Or, equivalently, there is no mage that is not positioned within a list of hexes. This should be checked in a moveto event…

Here is my approach:

Code: Select all

        [event]
            name=moveto
            
            [filter]
                [not]
                    [filter]
                        type= Red Mage, Arch Mage, Great Mage, Silver Mage, White Mage, Mage of Light
                        
                        [filter_location]
                            [not]
                                x=16,15,15,15,15,15,15,15,15,15,16,17,18,19,20,21,22,23,24,25,26,27,28,29,30,31,32,33,33,33,33,33,33,33,33
                                y=40,40,39,38,37,36,35,34,33,32,31,31,30,30,29,29,28,28,28,29,29,30,30,31,31,32,32,33,34,35,36,37,38,39,40
                            [/not]
                        [/filter_location]
                    [/filter]
                [/not]
            [/filter]
            
            [message]
                message="Matched!"
            [/message]
        [/event]
    [/event]
Sadly, this won’t work. I don’t understand why.

What am I doing wrong and how to do this correctly?
User avatar
Ravana
Forum Moderator
Posts: 3011
Joined: January 29th, 2012, 12:49 am
Location: Estonia
Contact:

Re: How to check if all mages are within a list of hexes?

Post by Ravana »

[filter_condition] and [have_unit] not [filter].
Marcgal

Re: How to check if all mages are within a list of hexes?

Post by Marcgal »

Thank You, Kind Sir!
Post Reply