Template talk:Vendor table notes

From Guild Wars 2 Wiki
Jump to navigationJump to search

Cname[edit]

So after today's edit this template checks on default if the value of the parameter requirement is a canonical name of an achievement, if yes then it uses the achievement, otherwise it treats the value as exact page name. Just out of curiousity, how does one specify a page requirement (not of context achievement) that shares a canonical name with an achievement? Spoiler: Canonical names are not unique and thus can't be used a proper search term. My philosophy: no shortcuts, they never pay off, exact names - although sometimes complicated - simplify life in the end.

So far (I think) luckily most of the currently defined and problematic pages are caught by the switch (already sorting out the contexts NPC, Location, Story) but what about all the other contexts that aren't caught? For those we won't be able to specify the page name, it will always automatically set it to an achievement.

I ran a query to find out how many achievements actually share a canonical name with any other page: 828 out of 5047 documented achievement pages, see here. --Tolkyria (talk) 20:28, 29 August 2021 (UTC)

Thanks for running the query, that's really helpful data. There are indeed a few other contexts for which the pagename matches an achievement's canonical name, but I'd argue they are not very consequential because they will not be used as a requirement for the purchase of an item.
  • Effect: Likely will never be a requirement, and they are used as achievement qualification trackers anyway.
  • Achievement category: No purchase will ever require an entire achievement category.
  • Event: Likely the event will award the achievement which will be used as a purchase requirement.
  • Item, Skin: These are rewarded from completing the achievement with the same name, so they are equivalent for purchase requirement purposes.
  • Object: All of them are insights/strongboxes which grant the achievement after being used.
  • Skill, Trait: Will never be a requirement.
  • Release: Will never be a requirement for an entire release over an achievement of the same name.
Also I disagree with requiring exact achievement names (eg. A Star to Guide Us (achievements)#achievement4385) because finding it is not straightforward and requires some specific wiki knowledge into how achievements are stored.
--BuffsEverywhere (talk) 23:08, 29 August 2021 (UTC)
Perfect, I wasn't sure about certain contexts, but based on your argumentation it should be fine. --Tolkyria (talk) 18:56, 30 August 2021 (UTC)
Oops, I missed the Follows Advice mastery. I'll add the mastery context to the template and it should be fine, probably. --BuffsEverywhere (talk) 03:36, 31 August 2021 (UTC)

Example where an achievement redirect to a story article has unexpected results[edit]

{{vendor table row|item=Minister's Hat (heavy)|cost=20000 coin + 200 Research Note|requirement=Whiffing Wanderer; Wanderer Weaving}}

The above was expected to link to both achievements, e.g. "Requires completing the achievement Whiffing Wanderer and completing the achievement Wanderer Weaving."

However, due to both achievements redirecting to a section on a story page, what it actually did was print "Requires completing the story step Deep Trouble and completing the story step Deep Trouble."

What we could do would be to (1) check the #anchor from the redirect (does it contain a # symbol), (2) if so split on the # symbol, and then (3) check if contains to "achievement").

What I used to bypass the SMW context lookup:

{{vendor table row|item=Minister's Hat (heavy)|cost=20000 coin + 200 Research Note|requirement=completing both of the [[Whiffing Wanderer]] and [[Wanderer Weaving]] achievements.}}

Adding a wiki link functionally works but I thought I'd record this here anyyway. -Chieftain AlexUser Chieftain Alex sig.png 06:10, 30 June 2023 (UTC)