Template talk:Item infobox

From Guild Wars Wiki
Jump to navigationJump to search

Vista-file-manager.png
Archive


salvage auto-cats[edit]

This is another template that is no longer up to dealing with our current method of auto-categorization or level of detail, i.e. autocat fails if:

  • There are multiple salvage possibilities and the specific combination hasn't been detailed.
  • We add the specific number of salvage items.
  • We add the number and the likelihood, e.g. Phantom Residue.
  • In any other case in which we fail to list the mats exactly as required by the info box.

Accordingly, I recommend that we update the infobox to

  1. Allow for up to five salvage items (3 common, 2 rare — those seem to be the max).
  2. The number of each (we can do this for a lot of trophies).
  3. The likelihood when using an expert salvage kit. (We can only do this for a few items, so this could wait. Alternatively, we could represent it this as a fractional number, e.g. 20% chance of 4 mats, 80% chance of 5 could be shown as 4.8).

I've created an example for how we might implement #1 (for weapons) at User:TEF/Sandbox/Weapon infobox. – Tennessee Ernie Ford (TEF) 18:46, 5 September 2011 (UTC)

Including #2 and #3 will only lead to more parameters, so at some point it's going to get ugly. I don't think the percentages of 4 vs. 5 Piles of Glittering Dust should be mentioned anywhere but on the talk page - usually, the interesting value is the ratio of common to rare salvage, and we don't have hard data for any item I know. So I'd suggest to do #1 and #2 and skip #3.
Coding-wise, there's a lot of redundancy between all the templates. I'd suggest enforcing common parameter names and a common layout between all item templates by using two helper templates, e.g.
Template:Some Infobox calls
{{Infobox salvage rows| (table background color) | {{{commonsalvage|}}} | {{{commonsalvage_amount|}}} | {{{commonsalvage2|}}} | {{{commonsalvage2_amount|}}} /* ... */ | {{{raresalvage|}}} | {{{raresalvage_amount|}}} | /* ... */ }}, which outputs the two table rows, then calls the second template once for each item:
{{Infobox salvage categorization| {{{commonsalvage|}}} }} is just the huge switch statement for adding to [[Category:Contains stuff]].
This should reduce the amount of redundant copy/pasting and make it easier to adjust multiple infoboxes to the new system. Anything I missed? Tub 20:00, 5 September 2011 (UTC)
I like the idea of having the helper templates.
Personally, I like to see the numbers b/c it helps me to evaluate whether its worth the effort to salvage/farm an item (without having to follow links). So, I'd like to see us implement #1 in a way that makes it easy to handle #2 later (even if we don't do it now). I think the %s are overkill, but the sneaky fractional value would handle it (assuming we collected the supporting data).
If we don't get much feedback, I'll add a note to Community Portal so that ppls can opine...and then we can figure out the next steps. – Tennessee Ernie Ford (TEF) 20:47, 5 September 2011 (UTC)

(Reset indent) Screw cleaning up hundreds of item pages, here's something smarter that can deal with the existing data (enabled by the recent update of ParserFunctions):

User:Tub/Sandbox/Material categorization
Opinions? Tub 14:25, 6 January 2012 (UTC)
Good work; it seems like a sensible next step.
I'm not sure I understand how it would be implemented: I'm guessing that we apply it inside the existing infobox (which still requires editing 100s of articles, but wikichu could do that). I assume it can handle an arbitrary number of mats within? Finally, will it correctly categorize if the brackets are missing (iirc, that's the case for ~a dozen or two infoboxes).
This doesn't resolve the issues around using DPL, but perhaps future events (<cough>GW2</cough>) will render that ability moot for this wiki. – Tennessee Ernie Ford (TEF) 16:47, 6 January 2012 (UTC)
Oh, we'll just call the new template from within {{Item infobox}}, i.e. {{Material categorization|Contains|{{commonsalvage|}}} {{raresalvage|}}} }} and it'll autocat every item in existence. No need to adjust articles, unless you wish to clean up the categories that were added manually.
Can you link to a few examples were the brackets are missing? Problem is, if I'm just searching for "Steel Ingot" inside the text, it may be either Steel Ingots or Deldrimor Steel Ingots. That's why every mat is required to start with [[ for recognition.
What DPL-issues are you referring to? Once auto-cats work, you can just filter by Category:Contains iron instead of attempting to parse the "commonsalvage"-parameter, which should solve most issues I can come up with right now. Tub 17:48, 6 January 2012 (UTC)
So, we'll ask wikichu to add the new template around the current parms (and probably, s/he can remove the manual cats, since there's only a limited number of possibles — probably two separate scripts). Awesome.
Re: missing brackets. I cannot link to any examples, but I remember finding that situation for some items (perhaps using DPL? maybe by accident?). It's possible (likely?) that I fixed any that I found at the time. If it's more than a minute's work to deal with the use case, I'd say ignore it and we can fix those manually (it won't be that many). OTOH, if it's easy, it would make it easier to add add'l mats going forward (since one would only have to worry about adding the short name of a mat to make it all look perfect).
Re: DPL queries. I've been experimenting with using DPL to make it easier to make lists of how many granite you get from salvaging this or that. Now that you've asked about it, it occurs to me that addressing that is well beyond the scope of this effort. i.e. my apologies for bringing it up.
Thanks for putting this together. – Tennessee Ernie Ford (TEF) 18:00, 6 January 2012 (UTC)
I think you misunderstood. No bot is needed (except maybe to remove the manual cats, but that's optional). We don't need to change how {{Item infobox}} is called, we just need to add functionality to the infobox template itself. In this case, add a single line to call another template that does the categorization. It's magic! Tub 20:01, 6 January 2012 (UTC)
zomg! more awesome than I had realized. – Tennessee Ernie Ford (TEF) 20:20, 6 January 2012 (UTC)

(Reset indent) Why didn't we implement this piece of code in the end? I don't think anyone had any objections. File:User Chieftain Alex Chieftain Signature.jpg Chieftain Alex 12:51, 26 April 2012 (UTC)

I don't think anyone but TEF had anything positive to say, either. The change is somewhat invasive, and I don't like being the guy who broke the wiki unless other people agree that the benefit is worth the risk. In other words, if you want this added, step forward and voice your opinion. If I see enough people backing the change, I won't hesitate to finish it. Tub 18:36, 26 April 2012 (UTC)

Revisited[edit]

@ Tub, would I be correct in thinking the salvage template would be implemented like this and this?

Besides the Weapon and Item infoboxes, which other templates would benefit from the salvage template? File:User Chieftain Alex Chieftain Signature.jpg Chieftain Alex 19:26, 13 August 2012 (UTC)

I'd add an unusual character between the two variables, just to be safe, i.e.
{{{commonsalvage|}}} # {{{raresalvage|}}}
But otherwise that's exactly how it should be used.
I'm not aware of any infoboxes that have a usable parameter for salvage or drops except for the two you mentioned. Neither Armor nor NPCs infoboxes provide a parameter. Tub 20:35, 13 August 2012 (UTC)
In that case, I might remove the first parameter and set it to be fixed as "Contains" since neither of those templates will use "Drops" File:User Chieftain Alex Chieftain Signature.jpg Chieftain Alex 10:09, 14 August 2012 (UTC)
Looks like I broke everything then fixed it? (Every time it found a page without any salvage data, e.g. Rune of Vigor, it would categorise anyway) :/ You did predict this would happen to the person who implemented ^_^ File:User Chieftain Alex Chieftain Signature.jpg Chieftain Alex 10:47, 14 August 2012 (UTC)
Just realised that although the template would have worked without my shitpoor work around, adding the character between parameters effectively broke the first #if on {{Material categorization}}. File:User Chieftain Alex Chieftain Signature.jpg Chieftain Alex 10:54, 14 August 2012 (UTC)
Oh sorry, that's my fault, I totally forgot about that when suggesting the #. Your fix was spot-on, just a little more complicated than needed. Tub 11:01, 14 August 2012 (UTC)
Category:Material list without links has a few entries left over due to no salvage data (even after cleanup), but otherwise seems everything seems great.
Some weapons like Deldrimor Spear have the categories specified at the bottom of the page, but idk if that is just data that has been assumed from the crafting materials, or if they are materials it salvages into. I'm tempted to ignore them since they probably have the correct categories. File:User Chieftain Alex Chieftain Signature.jpg Chieftain Alex 16:26, 14 August 2012 (UTC)
Yeah, salvage=Unknown is obviously going to be flagged as missing links. You could go ahead and remove the parameters from those articles. Or we live with the fact that they went into the category. IIRC there's even a way to hide the category on the articles if we wish to, but I'd have to consult the wiki manual for that.
Why don't you go and ask the contributor? Mora is still around. Tub 17:05, 14 August 2012 (UTC)

Category:Trophies update[edit]

Page name Issue Categories the same before and after template change?
Abnormal Seed Type not specified, collector given Yes Maintains categories.
Ashen Wurm Husk Not collected Yes Maintains categories.
Amphibian Tongue Filled out properly Yes Maintains categories.
Amulet of the Mists Reward trophy only, no collector specified Yes Maintains categories.
Ancient Artifact Reward trophy, collector given Yes Maintains categories.
Bolt of Linen Rare material, nicholas as collector No Category:Trophies removed.
Candy Cane Shard Reward trophy, trophy, salvage item, collector given No Category:Reward trophies & Category:Salvage items added.
Charr Hide Salvage item, collector given No Category:Trophies removed.
Cobalt Talon Trophy (unlinked), collector given Yes Maintains categories.
Pillaged Goods Salvage item, collector given No Category:Trophies removed.
War Supplies Sweet, reward trophy, collectors given Yes Maintains categories.

I've tested a few pages, and they seem to be working fine, so I updated the template. --File:User Chieftain Alex Chieftain Signature.jpg Chieftain Alex 10:53, 4 August 2012 (UTC)

putting items in Category:Beyond locations?[edit]

seems this template is autocatting pages weirdly.--Senti (talk) 05:36, 20 April 2024 (UTC)