This wiki is a read-only version of the Stardew Valley Wiki. The official editable wiki maintained by ConcernedApe can be found at stardewvalleywiki.com

User talk:Lilly/RecipeRow

From Stardew Valley Wiki
Jump to: navigation, search
This is Lilly/RecipeRow's talk page, where you can send messages and comments to Lilly/RecipeRow.
  • Sign and date your posts by typing four tildes (~~~~).
  • Put new text below old text.
  • Be polite.
  • Assume good faith.
  • Don't delete discussions.

statbonus and recipe parameter

Just want to let you know these parameters exist in the infobox under the name 'buff' and 'recipe'. I haven't come around updating all the recipe pages yet but you can see them both in the Autumn's Bounty page. --Vg-tal (talk) 23:13, 6 January 2017 (UTC)

That's great. I've changed 'statbonus' to 'buff'. My plan is to create a new template for the recipe table, based on this one. Then gradually replace all these recipe tables. Update the recipes to provide the info from the infobox, rather than copying the table row contained in those pages (i.e. move the onlyinclude tags and replace '{{infobox' with '{{{{{1|infobox}}}'). And update the recipe pages as well. This would decouple the information from the layout of the table, making it much easier to add or remove columns. Or have tables with different layouts. Then the health and energy columns can be merged. I also wanted to add a 'maximal profit' column for recipes, containing (sell value - sum of sell values of normal quality ingredients). This would show how profitable or wasteful the recipes are. --Lilly (talk) 02:33, 7 January 2017 (UTC)
I've been thinking about the maximal profit, i'm considering updating the infobox to pull the prices from Template:Baseprice from the ingredients list and display the result under the item price. The sellprice parameter could also be replace by {{baseprice|{{PAGENAME}}}} for most page. This should be possible to do with an array similar to how the professions are handled. This would mean the parameter would look like Acorn;1,Maple Seed;1,Pine Cone;1 instead of {{name|Acorn|1}}{{name|Maple Seed|1}}{{name|Pine Cone|1}}. --Vg-tal (talk) 15:16, 7 January 2017 (UTC)
Changing the list of ingredients into a list without templates seems useful. Those eliminate templates from the arguments to infobox. Arguments are expanded before being passed to the template, regardless of whether they're used in that template. However, name is a rather small template. For some other parameters, such as the recipe parameter, eliminating templates would complicate things too much. So, I'm not entirely convinced whether it is worth the effort. Also, what do we use as name/amount separator? Using '*' seems more intuitive, and makes the list more readable. Using '/' would allow us to use the '#titleparts' parser function, which furthermore can be wrapped in #iferror to deal with pages that still use the templates directly.
Considering the baseprice template, I'd prefer to have the parameters in a single place and easy to edit. Which would be specified explicitly in the parameters to infobox. Once item pages invoke the infobox template using {{{{{1|infobox}}}, the base price could then be obtained using something like {{:Algae Soup|sellprice}}, where sellprice is a template containing {{{sellprice|0}}}, thus returning the value specified to the sellprice parameter. So I don't think the baseprice template is a good idea. What was the baseprice template originally created and used for?
Regarding the maximal profit, I'd just add an extra parameter specifying the ingredients total sellprice. It is much easier to implement, more flexible and less likely to break if templates or ingredient pages are modified. And if incorrect, it is very easy to update. If you want to compute it automatically, use a substitution template, such that it is only computed once, and not every time any recipe or ingredient changes. For the Recipes page, computing the maximal profit dynamically might require a prohibitive amount of template processing. --Lilly (talk) 01:48, 8 January 2017 (UTC)
The baseprice template was created because most price is listed in 2 or more place and I wanted to make it easier to maintain them all. I've never came around using it and was afraid it would cause performance issues on a page like the travelling cart. But I like your idea better. I've layed down some code in the infobox template this morning to test my idea and what I came up with was to split the name and amount with another array (didn't know about #titleparts). --Vg-tal (talk) 03:40, 8 January 2017 (UTC)

Name parameter

For this RecipeRow template to work, the infobox name parameter should be mandatory. When transcluding pages, {{PAGENAME}} cannot be used to determine the item's name. --Lilly (talk) 01:56, 8 January 2017 (UTC)

Sorting

I would like to implement this template (despite my lack of knowledge of mediawiki syntax), but I don't see how we can ensure that columns sort properly. "Data-sort-type" doesn't seem to work for a column full of numbers formatted with the price template. I tried adding a "data-sort-value" to the sell price parameter in the infobox, but it didn't work right either (prices with only 2 characters need to be padded with zeroes in order to sort properly.)

I'm willing to change/add all the transclusion tags on all the recipe pages, if we can get the sorting to work right. margotbean (talk) 21:11, 9 March 2017 (UTC)

What if we add a parameter to the infobox called "data-sort-value" or "dsv" and set it equal to {{padleft:{{{edibility|}}}|4}}?
We could do the same for the sellprice, but we'd have to require it be entered as a raw number and error out if entered as a price-formatted entry. --margotbean (talk) 19:30, 30 March 2017 (UTC)