Unilt filter for different healing
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.
Unilt filter for different healing
I am trying to filter out units with the heals +4 and heals +8 separately. this one works :
[filter]
[filter_wml]
[abilities]
[heals]
value=4
[/heals]
[/abilities]
[/filter_wml]
[/filter]
gives me only units with healing +4
this one though does not :
[filter]
[filter_wml]
[abilities]
[heals]
value=8
[/heals]
[/abilities]
[/filter_wml]
[/filter]
It gives me units with heals +4 or Heals +8
i also tried this:
[filter]
[filter_wml]
[abilities]
[heals]
value=4
[/heals]
[/abilities]
[/filter_wml]
[not]
[filter_wml]
[abilities]
[heals]
value=8
[/heals]
[/abilities]
[/filter_wml]
[/not]
[/filter]
Any ideas?
[filter]
[filter_wml]
[abilities]
[heals]
value=4
[/heals]
[/abilities]
[/filter_wml]
[/filter]
gives me only units with healing +4
this one though does not :
[filter]
[filter_wml]
[abilities]
[heals]
value=8
[/heals]
[/abilities]
[/filter_wml]
[/filter]
It gives me units with heals +4 or Heals +8
i also tried this:
[filter]
[filter_wml]
[abilities]
[heals]
value=4
[/heals]
[/abilities]
[/filter_wml]
[not]
[filter_wml]
[abilities]
[heals]
value=8
[/heals]
[/abilities]
[/filter_wml]
[/not]
[/filter]
Any ideas?
- Speedbrain
- Posts: 137
- Joined: August 10th, 2009, 9:51 pm
- Location: Utah, USA
Re: Unilt filter for different healing
Did it store an empty set from your last example?
I'm no master of coding or WML, but it seems the 4 and the 8 should be switched in your last example. You want all the 8's, NOT the 4's, right?
I'm no master of coding or WML, but it seems the 4 and the 8 should be switched in your last example. You want all the 8's, NOT the 4's, right?
Re: Unilt filter for different healing
Look at how they are defined in the core macros of the game:
If you want to filter the mainline Cures, maybe you could use the invisible UNPOISON ability?
If you have made some costum healing abilities/have a unit with the EXTRA_HEAL but not UNPOISON... I dunno, create a costum ability instead of using the mainline ones and just give it a different id?
Also: ninja's but speedbrain's comment makes sense.
Spoiler:
Code: Select all
[filter]
ability=curing
[/filter]
Also: ninja's but speedbrain's comment makes sense.
Jazz is not dead, it just smells funny - Frank Zappa
Current projects: Internet meme Era, The Settlers of Wesnoth
Current projects: Internet meme Era, The Settlers of Wesnoth
-
- Inactive Developer
- Posts: 2461
- Joined: August 15th, 2008, 8:46 pm
- Location: Germany
Re: Unilt filter for different healing
Why do HEAL and EXTRA_HEAL have the same id in mainline ? It doesn't make much sense. Then you could filter easily with ability=...
It looks like filter_wml cares for the [heals] tag but not for value=, would explain the experienced behaviour.
You could do (in your custom abilities):
So mainline and custom units with this ability are using your custom extra_heal which matches the core one except for the id.
It looks like filter_wml cares for the [heals] tag but not for value=, would explain the experienced behaviour.
You could do (in your custom abilities):
Code: Select all
#undef ABILITY_EXTRA_HEAL
#define ABILITY_EXTRA_HEAL
[heals]
value=8
id=extra_healing
...
projects (BfW 1.12):
A Simple Campaign: campaign draft for wml starters • Plan Your Advancements: mp mod
The Earth's Gut: sp campaign • Settlers of Wesnoth: mp scenario • Wesnoth Lua Pack: lua tags and utils
updated to 1.8 and handed over: A Gryphon's Tale: sp campaign
A Simple Campaign: campaign draft for wml starters • Plan Your Advancements: mp mod
The Earth's Gut: sp campaign • Settlers of Wesnoth: mp scenario • Wesnoth Lua Pack: lua tags and utils
updated to 1.8 and handed over: A Gryphon's Tale: sp campaign
Re: Unilt filter for different healing
Dixie, that type of filter works, and is simples, but does not differentiate between a heal +4 and a heal +8.. i need a way of filtering them seperatly, for two different actions.
Speedbrain, not it catches the unit. the filter for +8 works fine, as it should. but the filter for +4 picks up the +8 units also. its as if its reading it as all units with that number or greater.
Anonymissimus, not sure how i could apply your idea. how can i get the script to change the id for one (+4) but not the other (+8). I would still need to filter the units apart. and if i can do that i'm laughing.
Speedbrain, not it catches the unit. the filter for +8 works fine, as it should. but the filter for +4 picks up the +8 units also. its as if its reading it as all units with that number or greater.
Anonymissimus, not sure how i could apply your idea. how can i get the script to change the id for one (+4) but not the other (+8). I would still need to filter the units apart. and if i can do that i'm laughing.
-
- Inactive Developer
- Posts: 2461
- Joined: August 15th, 2008, 8:46 pm
- Location: Germany
Re: Unilt filter for different healing
Put that among your utils/abilities.cfg - the core definition except for the #undef and the changed id, to substitute core's ABILITY_EXTRA_HEALING:pkz wrote:Anonymissimus, not sure how i could apply your idea. how can i get the script to change the id for one (+4) but not the other (+8). I would still need to filter the units apart. and if i can do that i'm laughing.
Spoiler:
Code: Select all
[filter]
ability=healing
[/filter]
[filter]
ability=extra_healing
[/filter]
projects (BfW 1.12):
A Simple Campaign: campaign draft for wml starters • Plan Your Advancements: mp mod
The Earth's Gut: sp campaign • Settlers of Wesnoth: mp scenario • Wesnoth Lua Pack: lua tags and utils
updated to 1.8 and handed over: A Gryphon's Tale: sp campaign
A Simple Campaign: campaign draft for wml starters • Plan Your Advancements: mp mod
The Earth's Gut: sp campaign • Settlers of Wesnoth: mp scenario • Wesnoth Lua Pack: lua tags and utils
updated to 1.8 and handed over: A Gryphon's Tale: sp campaign
Re: Unilt filter for different healing
Are you sure? Have you tried it? As I understand it, all mainline units who have heal +8 (id=healing) also have unpoison (id=curing), and none of those that have haling +4 (id=healing) have unpoison.pkz wrote:Dixie, that type of filter works, and is simples, but does not differentiate between a heal +4 and a heal +8.. i need a way of filtering them seperatly, for two different actions.
Thus, you could filter heal+4 like this:
Code: Select all
[filter]
ability=healing
[not]
ability=curing
[/not]
[/filter]
Code: Select all
[filter]
ability=curing
[/filter]
Jazz is not dead, it just smells funny - Frank Zappa
Current projects: Internet meme Era, The Settlers of Wesnoth
Current projects: Internet meme Era, The Settlers of Wesnoth
Re: Unilt filter for different healing
No, the code in 1.8 looks sensible, and it really should be looking at value. By the way, I haven't been able to reproduce the issue: units without value=8 are not matched for me.Anonymissimus wrote:It looks like filter_wml cares for the [heals] tag but not for value=, would explain the experienced behaviour.
At the very least, it helped me notice that [filter_wml] never worked in trunk. (If the unit had more attributes than the ones in the filter, it would fail.)