Template talk:Recipe

From Guild Wars 2 Wiki
Jump to navigationJump to search


Useing this template for Guild Hall upgrades?[edit]

I would like to use this template for the guild hall upgrade recipes. Each upgrade would require it's own page. This way it can use the systematic wiki. Problem is the ingredient# needs to expand to a unknown amount. Any idea on how to make this happen? Anzenketh (talk) 14:34, 27 October 2015 (UTC)

No, this one is highly customized to crafting. You can use it as the basis for creating a new template, however. —Dr Ishmael User Dr ishmael Diablo the chicken.png 15:05, 27 October 2015 (UTC)
I was thinking of creating a new one anyways. I am also taking it this means that there is no way to make a new template that ingredient# will expand to a unknown amount. Anzenketh (talk) 15:28, 27 October 2015 (UTC)
Yes, using #arraymap. But I just didn't see the need to shoehorn it into this one, which is specifically designed around the crafting system of 1-4 ingredients. Besides, you don't need most of the parameters out of this one anyway, like source, type, discipline, rating, quantity, etc. All you need is a list of inputs (and I wouldn't call them "ingredients" either, unless that word is used in-game). —Dr Ishmael User Dr ishmael Diablo the chicken.png 15:34, 27 October 2015 (UTC)

Multiple recipe sheets[edit]

The template needs support for multiple sheets. Items such as Prismatic Lodestone have several different recipe sheets, depending on the precursor weapon and its box. —Ventriloquist 19:06, 15 November 2015 (UTC)

Are the Prismatic lodestones created by the different recipe sheets actually the same item with the same ID? -Chieftain AlexUser Chieftain Alex sig.png 20:49, 15 November 2015 (UTC)
They sure are. —Ventriloquist 20:51, 15 November 2015 (UTC)

Storing duplicate forge ingredients[edit]

It's been 2 years since duplicate ingredients were mentioned.[1] Wintersday 2015 rolls in with Foostivoo the Merry mystic forge recipe that now accepts "1 (Mini Snowman), 1 (Mini Snowman), 1 (Mini Snowman), 250 (Flawless Snowflake)" but SMW stores it as "1 (Mini Snowman), 250 (Flawless Snowflake)". --BryghtShadow (talk) 20:38, 21 December 2015 (UTC)

The only idea I've had to address the bug (outlined on Guild Wars 2 Wiki:Semantic MediaWiki#Particular to SMW) is to create additional pages such as "Mini Snowman (smw redirect 1)"/"Mini Snowman (smw redirect 2)" and redirect it. SMW uses all the properties for the target page, and the only problem is being redirected via the skanky redirect page. This would fix the appearance in recipe list.
I've implemented an example using Mini Snowman (smw redirect 1), Mini Snowman (smw redirect 2) and made a small edit to Foostivoo the Merry. -Chieftain AlexUser Chieftain Alex sig.png 21:06, 21 December 2015 (UTC)
Dr Ishmael suggested this 2 years ago: "I suppose we'll have to add a dummy element to the Property:Has ingredient record with values 1/2/3/4 (based on the input ingredient# position) in order to keep every ingredient unique". I've written an example that implements indices at the Project:Sandbox. --BryghtShadow (talk) 10:21, 28 December 2015 (UTC)
If we store everything like that then we won't be able to query for recipes based on a single ingredient, a major flaw imo. -Chieftain AlexUser Chieftain Alex sig.png 13:22, 28 December 2015 (UTC)
Why is it not possible to query for a single ingredient if we added indices? I read the manual on the record type and from what I see it's possible. We already query recipe lists using wildcards in templates like {{Recipe list by discipline}}. Here's my updated example with actually created properties and subobjects: GW2W:Sandbox --BryghtShadow (talk) 06:51, 4 January 2016 (UTC)
Alright that looks good I'm clearly wrong on that front. How would we parse that result into something like {{recipe list}}? Currently we separate by ")," (this avoids breaking pagenames that have commas or brackets in the titles) - here is the line I'm looking at:
<div class="ingredients">{{#arraymap:{{#replace:{{{4|}}}|+|}},|),|@@@|<!-- Formatting the ingredients -->
;{{#explode:@@@| |0}}:{{#vardefine:recipe_ingredient|{{#sub:@@@|{{#expr:{{#pos:@@@| }}+2}}}}}}<span class="inline icon" style="width:20px; height:20px; vertical-align:middle;">[[{{#show:{{#var:recipe_ingredient}}|?Has game icon|link=none|default=File:Skill.png}}|link={{#var:recipe_ingredient}}|20x20px]]</span> [[{{#var:recipe_ingredient}}|{{#show:{{#var:recipe_ingredient}}|?Has canonical name|default={{#var:recipe_ingredient}}}}]]
|\n}}</div>
(I suspect we might have to sequence it Quantity;Index;Item to split it easily.) -Chieftain AlexUser Chieftain Alex sig.png 11:52, 4 January 2016 (UTC)
To answer my own question, we can parse your proposal with
<div class="ingredients">{{#arraymap:{{#replace: 1 (1, Mini Snowman), 3 (1, Mini Snowman), 4 (250, Flawless Snowflake), 2 (1, Mini Snowman) |+|}},|),|@@@|<!-- Formatting the ingredients -->
;{{#sub:{{#explode:@@@| |1}}|1|-1}}:{{#vardefine:recipe_ingredient|{{#sub:@@@|{{#expr:{{#pos:@@@| |2}} + 1}}}}}}<span class="inline icon" style="width:20px; height:20px; vertical-align:middle;">[[{{#show:{{#var:recipe_ingredient}}|?Has game icon|link=none|default=File:Skill.png}}|link={{#var:recipe_ingredient}}|20x20px]]</span> [[{{#var:recipe_ingredient}}|{{#show:{{#var:recipe_ingredient}}|?Has canonical name|default={{#var:recipe_ingredient}}}}]]
|\n}}</div>
It might be worth someone else checking that for errors, but otherwise I'd be happy with indices then. -Chieftain AlexUser Chieftain Alex sig.png 12:45, 4 January 2016 (UTC)
Thinking ahead, what templates will be affected by the property restructure?
I'd propose disabling any read templates (by returning blank instead of ingredients) for 24 hours while the set templates catch up with changes. -Chieftain AlexUser Chieftain Alex sig.png 23:51, 5 January 2016 (UTC)

Base ingredients needs more query depth[edit]

Template:Base_ingredients defaults to 5 recursive calls for recipes, but some Scribe recipes have more depth than this. For instance, Lion Fountain requires 7 recursive calls (or more?) to show all of its ingredients. Is that something that can be addressed with this template, or would the change be better made at Template:Base_ingredients? -- Dashface User Dashface.png 13:59, 2 January 2016 (UTC)

Form:Base ingredients query It would need 8 recursive calls (query depth=8). I suspect some pages with long ingredient names will cause problems if we raise the query depth to 8 - we get a maximum of a thousand characters before we run into problems (i.e. length("Pile of Radiant Dust, Hard Wood Log, Pouch of Red Pigment, ...)<1000). , so although raising the query depth limit to 8 would improve this page's results, it might break other pages. -Chieftain AlexUser Chieftain Alex sig.png 16:48, 2 January 2016 (UTC)
Probably switch to the solution I did on the other template. Alex seems to enjoy complaining about my changes, so I'll let him try fixing it first.--Relyk ~ talk < 20:03, 2 January 2016 (UTC)
The version that broke the first time a bracket and a comma popped up in the name? :D
I'll have a look at the other implementation on Monday when I get back. -Chieftain AlexUser Chieftain Alex sig.png 20:59, 2 January 2016 (UTC)

Has recipe id[edit]

We should switch to Property:Has game id over a separate Property:Has recipe id for the subobject. It's redundant when we define Has context and inconsistent with other pages.--Relyk ~ talk < 21:04, 4 March 2016 (UTC)

Not properly passing on the ingredient to the recipe subobject if using item's ID[edit]

I've created a recipe on the page Triumphant Hero's Breastplate. The recipe properly displays the ascended version of the item, but the recipe subobject is trying to use the item's ID. G R E E N E R 02:51, 10 August 2017 (UTC)

Specifying the id was removed as a method donkeys ago. special:browse shows the data is not being set correctly. Maybe I should tweak {{item variant table row}} to be like {{achievement table row}} and use the item id if specified (so the recipe paramter would be given as | ingredient1 = 1 Triumphant Hero's Breastplate#item83394) -Chieftain AlexUser Chieftain Alex sig.png 06:40, 10 August 2017 (UTC)
I also should have looked at the other common workaround for such a case, Corrupted Artifact. More of the legendary items will appear on the API as time goes on. Let me know if you have a preference for how they're handled. G R E E N E R 07:54, 10 August 2017 (UTC)

required amount that's more than 1000 is not referenced properly[edit]

The issued page is Jar of Distilled Glory. The page has a hidden recipe inside:

  • <div style="display:none"><!--Hidden recipe to display required ingredients in base ingredients query--> {{Recipe | source = other | ingredient1 = 1000 Shard of Glory}} </div>

Now, the issue is that another page Gift of Competitive Dedication can't take the ingredient reference from this. I checked this works when I set it to 999 units. only setting the item as 1000 units has the issue.

also, another page that has the same issue is Essence of Strategy --Targal (talk) 19:19, 9 February 2024 (UTC)

Reading this another way, you added a recipe which doesn't exist ingame, which breaks Template:Base ingredients lookup (not template:recipe). The problem is very likely the comma in the number format from the initial SMW result -unfortunately as this is a "record" type SMW object, we can't control the output format to remove this.
I'd rather we did not have fake recipes hidden on any page (granted we've done this for Charged Quartz for years). -Chieftain AlexUser Chieftain Alex sig.png 20:32, 9 February 2024 (UTC)
Specifically the problem is generated by this line (I've replaced the raw version {{#show:{{#var:recipe}}|?Has ingredient|link=none|valuesep=~}} with an example pertinent to your example page:
{{#show:Jar of Distilled Glory#recipe1|?Has ingredient|link=none|valuesep=~}}
which renders as "1 (1,000, Shard of Glory)"
-Chieftain AlexUser Chieftain Alex sig.png 20:42, 9 February 2024 (UTC)