[solved?] Filter unit by [variation] 1.15.4

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
Pilauli
Posts: 115
Joined: August 18th, 2020, 12:56 pm

[solved?] Filter unit by [variation] 1.15.4

Post by Pilauli »

So yeah, I want to filter by what variation a unit has.

https://wiki.wesnoth.org/StandardUnitFilter
Based on this wiki page (which identifies "variation" as an optional field for the standard unit filter), I wrote something that I thought should work. Here are relevant snippets:

Code: Select all

[variation]
    variation_id=pale_green
    variation_name=_"pale green"
    inherit=yes
    image=units/monsters/burrower.png~PAL({BURW_COL_BRIGHT_GREEN}>{BURW_COL_PALE_GREEN})
[/variation]

Code: Select all

[modify_unit]
    [filter]
        type=Burrower
        variation=pale_green
    [/filter]
    [effect]
        apply_to=image_mod
        add=PAL({BURW_COL_BRIGHT_GREEN}>{BURW_COL_PALE_GREEN})
    [/effect]
[/modify_unit]
It doesn't work.

If I remove the "variation=pale_green" piece of the filter (or if I change it to an invalid thing like "blahblah=pale_green"), then all burrowers will get the palette-swap. But when I include a variation filter, then none of the burrowers get the palette-swap, not even the ones where their unit descriptions identify them as the pale green variation.

I'm on 1.15.4, in case that matters.

So, since this doesn't work, how can I filter by what variation a unit has?
Last edited by Pilauli on September 12th, 2020, 12:21 pm, edited 1 time in total.
newfrenchy83
Code Contributor
Posts: 172
Joined: October 6th, 2017, 12:57 pm

Re: Filter unit by [variation] 1.15.4

Post by newfrenchy83 »

i don't know but perhaps you're must write variation_id instead of variation in [filter]
newfrenchy83
Code Contributor
Posts: 172
Joined: October 6th, 2017, 12:57 pm

Re: Filter unit by [variation] 1.15.4

Post by newfrenchy83 »

in https://wiki.wesnoth.org/StandardUnitFilter , it is variation who is indicated, that must be working, i don't understand
newfrenchy83
Code Contributor
Posts: 172
Joined: October 6th, 2017, 12:57 pm

Re: Filter unit by [variation] 1.15.4

Post by newfrenchy83 »

you musns't be have that https://github.com/wesnoth/wesnoth/comm ... 5d5d928b2e in your engine, this bugs is resolved in master but after 1.15.4 release. if you want resolve your problems now, you must compile the source code afeter download the master branch on github, else, await the 1.15.15 release
Pilauli
Posts: 115
Joined: August 18th, 2020, 12:56 pm

Re: [solved?] Filter unit by [variation] 1.15.4

Post by Pilauli »

I think I will wait for 1.15.5 and see if that fixes it. Thank you!

EDIT: Okay, I found a different way to do what I was trying to do, so I don't need to filter by variation anymore.
I'll definitely test whether it works when 1.15.5 comes out, though. For science. Or something like that.
Thanks again!
Post Reply