Filter unit with object
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.
- Spannerbag
- Posts: 547
- Joined: December 18th, 2016, 6:14 pm
- Location: Yes
Filter unit with object
Hi all,
I'm considering rewriting some existing code - in v1.16.8 - to use
However I may need to subsequently remove the
I may have missed it but if one or more unit(s) is/are given an object, e.g.
Is there a way to
Usually it's possible to filter by what the
I had a look at the wiki and there doesn't seem to be anything there?
One way I to do this I suppose would be by using unit variables but I thought I'd ask here first as I often miss the bleedin' obvious
Any help/suggestions appreciated.
Cheers!
-- Spannerbag
I'm considering rewriting some existing code - in v1.16.8 - to use
[object]
s as this would reduce bloat and be more elegant.However I may need to subsequently remove the
[object]
from individual units.I may have missed it but if one or more unit(s) is/are given an object, e.g.
Code: Select all
[object]
id=some_object
take_only_once=no
silent=yes
duration=scenario # Or whatever
[filter] # Or whatever
side=2
[/filter]
[effect]
...
[/object]
[filter]
these unit(s) by object id (in this case "some_object
")?Usually it's possible to filter by what the
[effect]
does (ability, special etc.) but that wouldn't work unambiguously in this case.I had a look at the wiki and there doesn't seem to be anything there?
One way I to do this I suppose would be by using unit variables but I thought I'd ask here first as I often miss the bleedin' obvious
Any help/suggestions appreciated.
Cheers!
-- Spannerbag
- Pentarctagon
- Project Manager
- Posts: 5581
- Joined: March 22nd, 2009, 10:50 pm
- Location: Earth (occasionally)
Re: Filter unit with object
Moved to the WML Workshop.
99 little bugs in the code, 99 little bugs
take one down, patch it around
-2,147,483,648 little bugs in the code
take one down, patch it around
-2,147,483,648 little bugs in the code
Re: Filter unit with object
[filter_wml] will find them.
- Spannerbag
- Posts: 547
- Joined: December 18th, 2016, 6:14 pm
- Location: Yes
Re: Filter unit with object
Ooops, apologies, that's where I meant to post... uh, where *did* I post out of interest?
Cheers!
-- Spannerbag
- Spannerbag
- Posts: 547
- Joined: December 18th, 2016, 6:14 pm
- Location: Yes
Re: Filter unit with object
Thanks, appreciated!
Cheers!
-- Spannerbag
- Pentarctagon
- Project Manager
- Posts: 5581
- Joined: March 22nd, 2009, 10:50 pm
- Location: Earth (occasionally)
Re: Filter unit with object
Technical SupportSpannerbag wrote: ↑June 23rd, 2023, 12:55 amOoops, apologies, that's where I meant to post... uh, where *did* I post out of interest?
Cheers!
-- Spannerbag
99 little bugs in the code, 99 little bugs
take one down, patch it around
-2,147,483,648 little bugs in the code
take one down, patch it around
-2,147,483,648 little bugs in the code