Filtering units by hitpoint range

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
User avatar
Nyanyanyan
Posts: 73
Joined: May 11th, 2018, 10:40 pm

Filtering units by hitpoint range

Post by Nyanyanyan »

I've got a problem filtering units via a hitpoint range (e.g. "under 20" or "10-30").
I cannot hard code all the different possible values since the threshold is variable.
The code

Code: Select all

[filter]
	[filter_wml]
		hitpoints=1-$somevalue
	[/filter_wml]
	[filter_side]
		[enemy_of]
			side=$side_number
		[/enemy_of]
	[/filter_side]
[/filter]
does not work, so I am out of ideas what to do here.

Any help would be appreciated.
Author of Age of Lords and the Revolution and Civil War and Expendable Leaders 2 multiplayer mods.
User avatar
Nyanyanyan
Posts: 73
Joined: May 11th, 2018, 10:40 pm

Re: Filtering units by hitpoint range

Post by Nyanyanyan »

Thanks a lot, didn't know this existed.
Author of Age of Lords and the Revolution and Civil War and Expendable Leaders 2 multiplayer mods.
Post Reply