[tag][filter-tag]<StandardFilter> or [tag]<StandardFilter>
Moderator: Forum Moderators
-
- Inactive Developer
- Posts: 2461
- Joined: August 15th, 2008, 8:46 pm
- Location: Germany
[tag][filter-tag]<StandardFilter> or [tag]<StandardFilter>
The point: Should wml action tags (implemented in lua or C++) which take a standard filter have an additional tag introducing that filter ? Such as [harm_unit][filter]<SUF> although it is not really neccessary there.
pros:
-Better overview, separation, especially if additional [tag]-specific keys get added later.
-Keys (subtags...) can easily be added to the standard filter as opposed to the nightmare of checking all [tag]<StandardFilter> - type of tags for collisions with the new key; it might already have a meaning in one of those tags.
cons:
-Annoying need to write extra [filter-tag] if calling from wml or {"filter-tag", {}} if from lua every time.
pros:
-Better overview, separation, especially if additional [tag]-specific keys get added later.
-Keys (subtags...) can easily be added to the standard filter as opposed to the nightmare of checking all [tag]<StandardFilter> - type of tags for collisions with the new key; it might already have a meaning in one of those tags.
cons:
-Annoying need to write extra [filter-tag] if calling from wml or {"filter-tag", {}} if from lua every time.
(I hope you don't mind @E_H...)Elvish_Hunter wrote:Perhaps we can follow this rule:
- if the tag has only one or two extra keys, and these aren't part of SUF, no [filter] is needed (example: [slow], that has no extra keys)
- if the tag has more extra keys, [filter] is needed to keep it tidy (example: [harm_unit])
- if the tag has a key that is already part of SUF, [filter] is needed to avoid problems.
Just a proposal that can be improved and corrected.
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
- Alarantalara
- Art Contributor
- Posts: 787
- Joined: April 23rd, 2010, 8:17 pm
- Location: Canada
Re: [tag][filter-tag]<StandardFilter> or [tag]<StandardFilte
I'd like it if filters only appeared without extra tags if there were no other attributes for the tag. Makes it easier to remember when to write it out.
Call it an argument for simplicity.
Call it an argument for simplicity.
- Elvish_Hunter
- Posts: 1576
- Joined: September 4th, 2009, 2:39 pm
- Location: Lintanir Forest...
Re: [tag][filter-tag]<StandardFilter> or [tag]<StandardFilte
No, I don't mind.Anonymissimus wrote:(I hope you don't mind @E_H...)
Spoiler:
Current maintainer of these add-ons, all on 1.16:
The Sojournings of Grog, Children of Dragons, A Rough Life, Wesnoth Lua Pack, The White Troll (co-author)
The Sojournings of Grog, Children of Dragons, A Rough Life, Wesnoth Lua Pack, The White Troll (co-author)
Re: [tag][filter-tag]<StandardFilter> or [tag]<StandardFilte
i guess there's no doubt that using extra tags would be a much cleaner implementation.
don't you think the transition would be quite complicated? not too hard on the source side but there's the wiki as well. the hardest part might be wmllint...
don't you think the transition would be quite complicated? not too hard on the source side but there's the wiki as well. the hardest part might be wmllint...
-
- Inactive Developer
- Posts: 2461
- Joined: August 15th, 2008, 8:46 pm
- Location: Germany
Re: [tag][filter-tag]<StandardFilter> or [tag]<StandardFilte
It can always happen that we suddenly want to add an additional key to a [tag]<StandardFilter> - type of tag since someone has an idea for a cool and easy to implement feature which none thought of before...Alarantalara wrote:I'd like it if filters only appeared without extra tags if there were no other attributes for the tag. Makes it easier to remember when to write it out.
If we would generally use only one variant there would be less confusion about whether or not the extra filter tags are needed in a particular case. This would need to be the extra-tag one then.
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
- Alarantalara
- Art Contributor
- Posts: 787
- Joined: April 23rd, 2010, 8:17 pm
- Location: Canada
Re: [tag][filter-tag]<StandardFilter> or [tag]<StandardFilte
That's true. I guess it isn't desirable to break compatibility whenever a first attribute is added.
Re: [tag][filter-tag]<StandardFilter> or [tag]<StandardFilte
If I remember correctly, I proposed a similar coding standard a while back when I was fixing a bug with [recall] x,y= attribute. But as I remember, Sirp was against using [filter] in all cases because he considered forms like [unpetrify] id=Konrad to be both simple and easy to use/type.
Although it was originally [unstone] description=Konrad, so maybe that's a bad example.
Although it was originally [unstone] description=Konrad, so maybe that's a bad example.
http://www.wesnoth.org/wiki/User:Sapient... "Looks like your skills saved us again. Uh, well at least, they saved Soarin's apple pie."
-
- Inactive Developer
- Posts: 2461
- Joined: August 15th, 2008, 8:46 pm
- Location: Germany
Re: [tag][filter-tag]<StandardFilter> or [tag]<StandardFilte
Ironically, the syntax for that tag was in reality [unpetrify][filter]<SUF>. All occurances of the tag in mainline were using it incorrectly (without [filter]) but it did still work in all those cases due to the usages simply wanting to unpetrify all units (which was the default for no [filter] given.) If they had tried to keep some unit petrified while unpetrifying another one it wouldn't have worked... But I did change the syntax to [unpetrify]<SUF> in a recent revision so it's actually a suitable example .Sapient wrote:But as I remember, Sirp was against using [filter] in all cases because he considered forms like [unpetrify] id=Konrad to be both simple and easy to use/type.
Although it was originally [unstone] description=Konrad, so maybe that's a bad example.
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: [tag][filter-tag]<StandardFilter> or [tag]<StandardFilte
Ha, I picked the worst example possible. I even wrote [stone] at first before remembering that tag was a myth.
http://www.wesnoth.org/wiki/User:Sapient... "Looks like your skills saved us again. Uh, well at least, they saved Soarin's apple pie."
Re: [tag][filter-tag]<StandardFilter> or [tag]<StandardFilte
The transition could be a bit of a hassle, but I think it'd be worth it, so no objections from me.
However, it's worth noting that we'd still have a few tags which would accept SUF + extra keys, although they aren't ActionWML tags: for example, [have_unit] has count=, [filter_adjacent] has is_enemy= and adjacent=, etc.
However, it's worth noting that we'd still have a few tags which would accept SUF + extra keys, although they aren't ActionWML tags: for example, [have_unit] has count=, [filter_adjacent] has is_enemy= and adjacent=, etc.
-
- Inactive Developer
- Posts: 2461
- Joined: August 15th, 2008, 8:46 pm
- Location: Germany
Re: [tag][filter-tag]<StandardFilter> or [tag]<StandardFilte
Wait. I did not propose anything, I didn't even write my opinion, I just wrote down facts and started a discussion here. I rather thought of future tags.
So if the proposal is to change all [tag]<StandardFilter> tags to [tag][filter-tag]<StandardFilter> ones (including non-action tags) fist thing would be to ask esr or ai whether this is feasible regarding wmllint.
Also note that there are supposedly situations which cannot be detected by wmllint due to the lack of macro expansion.
So if the proposal is to change all [tag]<StandardFilter> tags to [tag][filter-tag]<StandardFilter> ones (including non-action tags) fist thing would be to ask esr or ai whether this is feasible regarding wmllint.
Also note that there are supposedly situations which cannot be detected by wmllint due to the lack of macro expansion.
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: [tag][filter-tag]<StandardFilter> or [tag]<StandardFilte
Should be relatively simple. What's needed is a list of tags to convert, with for each tag, the list of keys and tags that should not be moved into the new [filter].
The replacement code itself can be pretty short, though there are probably a couple of annoying corner-cases. Especially macros.
The big question remains: do we actually want this?
The replacement code itself can be pretty short, though there are probably a couple of annoying corner-cases. Especially macros.
The big question remains: do we actually want this?
Re: [tag][filter-tag]<StandardFilter> or [tag]<StandardFilte
Anonymissimus fixed it for you.Sapient wrote:Ha, I picked the worst example possible. I even wrote [stone] at first before remembering that tag was a myth.
(Sort of. In preparation for 1.7.0 ESR pushed a change to move away from “stone” to “petrify” due to the former’s unfortunate implications.)
Author of the unofficial UtBS sequels Invasion from the Unknown and After the Storm.
- Elvish_Hunter
- Posts: 1576
- Joined: September 4th, 2009, 2:39 pm
- Location: Lintanir Forest...
Re: [tag][filter-tag]<StandardFilter> or [tag]<StandardFilte
I was thinking, what about making a poll? Perhaps like this:AI wrote:The big question remains: do we actually want this?
Do you think that WML tags that require a SUF should use [filter] sub-tags?
- Yes, always
- Yes, unless the tag has no or few extra keys
- No, never
- Other (explanation below)
Current maintainer of these add-ons, all on 1.16:
The Sojournings of Grog, Children of Dragons, A Rough Life, Wesnoth Lua Pack, The White Troll (co-author)
The Sojournings of Grog, Children of Dragons, A Rough Life, Wesnoth Lua Pack, The White Troll (co-author)
-
- Inactive Developer
- Posts: 2461
- Joined: August 15th, 2008, 8:46 pm
- Location: Germany
Re: [tag][filter-tag]<StandardFilter> or [tag]<StandardFilte
Not only SUFs. SLFs too (and possibly other filters).Elvish_Hunter wrote: Do you think that WML tags that require a SUF should use [filter] sub-tags?
I was thinking about who would do this ton of work introducing lots of bugs.
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