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

Template:Infosection price/doc

From Stardew Valley Wiki
Jump to: navigation, search

This template displays a full set of item prices -- including both quality and profession factors. It is designed specifically for use within Template:Infobox and other Infobox templates.

Notes

  • Normally multiple qualities of an item are displayed using Template:Qualityprice. However, the template will switch to display using Template:Price -- meaning no item icon, and instead a gold icon -- when appropriate. Namely, if only Normal quality is being displayed and artisan is not set (i.e., it is not the artisan-product subsection of another item).
  • The template assumes that is being called from within an already-defined infobox table that contains exactly two columns. If three-column display is used, the template creates a full-width sub-table to handle the three-columns without altering the rest of the table columns.
  • In standard usage, each profession is displayed in one data cell. All listed items are displayed in every data cell, and all other variables (price, quality, etc.) are assumed to apply to every item in every cell. However, settings on individual cells and/or items can be customized (see Advanced Parameters). And the auto setting allows Template:Qualityprice to automatically set price/quality on certain items.

Usage

Syntax

Typical usage:

 {{Infosection price
     | prof      = values      <- List of all professions/price adjustments, starting with Base
     | item      = item_name
     | price     = base_price
     | quality   = values        
 }}

Other standard parameters:

     | artisan   = true
     | auto      = true
     | srcprice  = source_base_price
     | ncolumns  = ncolumns
     | addtable  = true
     | iridium   = true
     | hide      = values
     | link      = link
     | comboprof = value

Advanced parameters:

     | itemcell[#] = item_name
     | multcell[#] = prof_mult
     | linkcell[#] = link
     | qualcell[#] = values
     | link[item]  = link
     | qual[item]  = values
     | price[item] = base_price
     | image[item] = image

Standard Parameters

All parameters are named and optional, although for mimimal usefulness at least item and price are needed. Default value for all arguments is empty, unless specified otherwise.

  • prof = values
    • A comma-separated list of all professions and/or price-adjustment factors for which prices should be calculated/displayed.
    • Default value is Base, meaning one data cell displaying prices without any profession-related adjustments
    • Should normally start with Base so that the base prices are displayed.
    • Each entry in prof is displayed in a separate data cell, and therefore prof effectively defines the size of the displayed section.
    • Duplicate entries are allowed in the list, especially when using parameters such as itemcell[#].
    • All recognized values are: Base, Rancher, Tiller, Artisan, Forester, Tapper, Blacksmith, Gemologist, Fisher, Angler, Spring Onion Mastery, Bear's Knowledge.
    • Non-standard values are allowed, in which case the name will be displayed without an icon. By default, the price multiplier of an unrecognized profession is 1, but multcell[#] can be used to define a multiplier.
  • item = item_name
    • Name of item being displayed. There should normally be a corresponding image named File:item_name.png.
      • But in cases where the image name differs from the item name, item should specifically be the item name, and image[item] can be used to specify the image name.
    • Generates the icons displayed in the table using Template:Qualityprice and Template:Quality
    • item_name can be a comma-separated list of multiple items. In this case, all listed items are displayed in all data cells.
  • price = base_price
    • The base price of item_name.
    • This price can be left missing if srcprice is specified (see details on srcprice below) -- if srcprice/auto are not used, Cannot be sold will be displayed for missing values.
    • In special-use cases, price may be a string value (e.g., for generic Wine). In this case, the string is printed as-is for the base price, and the template attempts to auto-generate an appropriate string for each profession
    • Even if multiple items are provided in item, price is expected to be a single value of price that is the default value used for all items. srcprice can be used to override the default price as necessary, or else price[item] can be used to provide per-item base prices.
  • quality = values
    • A list of all quality values to display, separated by commas.
    • Recognized values are Normal, Silver, Gold, Iridium
    • In standard usage, the values are the exact individual qualities to display. However, the template will also recognize all the parameters and special values used by other templates; see Template:ParseInputQuality for details.
    • quality is the default list of qualities used for all items listed in item. If multiple items are being displayed and different qualities are needed for each item, auto can be used to automatically set the quality for certain items (Wine, Pale Ale, Beer, Mead, Juice, Jelly, Pickles, Roe, Aged Roe, Caviar). Also, qual[item] cna be used to provide per-item qualities.
  • artisan = true
    • Set to true if the displayed item(s) are derived products being displayed as part of another item (the source item) infobox.
    • Take for example item=Cheese. Artisan should not be set for info displayed on Cheese. Artisan should be set for info displayed on Milk (or Large Milk)
    • Causes the section header to always be shown, using "Artisan Sell Prices" instead of "Sell Prices"; forces display to always use Template:Qualityprice so the item icon is always shown.
    • Does not necessarily mean that the item(s) are truly artisan goods, and does not influence the displayed professions.
  • auto = true
    • Set to true if price/quality should be automatically set for recognized items.
    • This parameter is passed to Template:Qualityprice, which is responsible for all the automatic values.
    • Prices can only be automatically set if srcprice is also provided.
  • srcprice = source_base_price
    • The base price of the item used to create item. Only used if auto is also set.
    • This should be the base price of the fruit used to create Wine or Jelly; the vegetable used to create Juice or Pickles; or, the fish that spawned the Roe or Aged Roe.
    • Allows the price of the Wine, Juice, Pickles, Jam, Roe, or Aged Roe to be automatically calculated
  • ncolumns = ncolumns
    • Set to 1, 2, or 3 to specify number of columns that contain data cells. Default value is set automatically based on input.
    • 1 column means all data is in a single column on the right side of the table; the headers for all data cells are shown on the left side of the table.
    • 2 and 3 columns mean that the data cells are displayed horizontally across the table; the header for each data cell is shown above it.
    • Default is to set ncolumns to the number of entries in prof. But code will automatically switch to ncolumns=1 if only one entry is being displayed in every cell (one item/cell, and one quality/item).
    • Note that the template assumes all data is being embedded within a standard infobox table, i.e., a table that is two columns wide. Any value of ncolumns>2 means that a secondary table is created that is embedded within the main infobox table.
  • addtable = true
    • Set to true only if template is being called outside of an infobox, and therefore is not already contained within a table. In particular, necessary to create examples as shown in this documentation.
  • iridium = true
    • Set iridium to true to add Iridium to the list of qualities.
    • Easier to do by including Iridium as a value for quality; iridium parameter only provided for consistency with other templates.
  • hide = values
    • Comma-separated list of quality values to hide.
    • Easier to do by just not listing them in quality; hide parameter only provided for consistency with other templates.
  • link = link
    • Only necessary on non-English wikis, to provide language-specific translation of item.
  • comboprof = prof
    • Special-use parameter to specify an additional profession that is combined with every entry listed in prof.
    • See Blackberry for an example of its usage -- where comboprof=Tiller is used to add a section with Tiller prices and combined Tiller/Bear's Knowledge prices.

Advanced Parameters

If details of the output need to be customized beyond what is possible using the standard parameters, the template allows most details to be customized either per cell or per item.

Per-cell settings allow the information in a given data cell to be customized, in other words, the information associated with each entry in the prof parameter list. Note that values with prof can be repeated as many times as necessary. cell1 parameters target the first listed profession, cell2 target the second, etc. This is used, for example, to generate the Roe/Aged Roe section of fish page using these parameters:

 | prof      = Base, Base, Artisan
 | itemcell1 = Roe
 | itemcell2 = Aged Roe
 | itemcell3 = Aged Roe

This means the first cell shows Roe prices using no profession; the second cell shows Aged Roe prices using no profession; the third cell shows Aged Roe prices using the Artisan profession.

Available per-cell settings (where [#] should be replaced by any valid cell number, e.g., 1, 2, or 3) are:

  • itemcell[#] = item_name
    • A comma-separated list of one or more items to display in the cell, details same as item, but cell-specific
  • multcell[#] = prof_mult
    • A multiplier to apply to all prices displayed in the cell. Overrides any multiplier associated with the cell's profession (or can be used to assign a multiplier to a non-standard profession).
  • linkcell[#] = link
    • A comma-separated list of links, one for each item listed in itemcell[#]. Details same as link.
  • qualcell[#] = values
    • A comma-separated list of qualities to be displayed for all items in this cell. Details same as quality.
    • Hide/iridium parameters are not supported at the per-cell level -- all desired qualities must be listed in qualcell[#]; any qualities not listed will be excluded.

Per-item settings allow the information used for a given item to be customized everywhere that item is shown in the section. In the Roe/Aged Roe case this is used to provide a custom image for Roe, via:

 | imageRoe  = Yellow Roe

Note that the item name must exactly match how it appears in item or itemcell[#] -- capitalization must match, and any spaces must be left as is. For example, on Slime Egg, different prices are assigned to each color of Slime Egg using:

 |item = Green Slime Egg, Blue Slime Egg, Red Slime Egg, Purple Slime Egg
 |priceGreen Slime Egg   = 1000
 |priceBlue Slime Egg    = 1750
 |priceRed Slime Egg     = 2500
 |pricePurple Slime Egg  = 5000

Available per-item settings (where [item] should be replaced by any valid item name) are:

  • link[item] = link
    • The link to use for this item. Details same as link.
  • qual[item] = values
    • A comma-separated list of qualities to use for this item. Details same as quality.
    • Hide/iridium parameters are not supported at the per-item level -- all desired qualities must be listed in qual[item]; any qualities not listed will be excluded.
  • price[item] = base_price
    • The base price of this item. Details same as price.
  • image[item] = image
    • The image to display for this item. Should be the base name of the image, without the .png extension.

Examples

{{Infosection price
  | item     = Large Milk
  | price    = 190
  | prof     = Base, Rancher
  | quality  = Normal, Silver, Gold, Iridium
  | addtable = true
}}

Price section for the Large Milk page. Result:

Sell Prices
Base Price: RancherRancher Profession:
(+20% Sell Price)
Large Milk
190g
Large Milk
Silver
237g
Large Milk
Gold
285g
Large Milk
Iridium
380g
Large Milk
228g
Large Milk
Silver
284g
Large Milk
Gold
342g
Large Milk
Iridium
456g
{{Infosection price
  | item     = Blackberry
  | price    = 20
  | prof     = Base, Bear's Knowledge
  | quality  = Normal, Silver, Gold, Iridium
  | addtable = true
}}
{{Infosection price
  | item     = Blackberry
  | price    = 20
  | prof     = Base, Bear's Knowledge
  | comboprof= Tiller
  | quality  = Normal, Silver, Gold, Iridium
  | addtable = true
}}

Proposed new price section for Blackberry, adding Tiller bonuses. Result. Note use of comboprof for second half of data.

Sell Prices
Base Price: Bear's KnowledgeBear's Knowledge:
(×3 Sell Price)
Blackberry
20g
Blackberry
Silver
25g
Blackberry
Gold
30g
Blackberry
Iridium
40g
Blackberry
60g
Blackberry
Silver
75g
Blackberry
Gold
90g
Blackberry
Iridium
120g

Tiller Profession Tiller Profession Sell Prices
Tiller Profession
(+10% Sell Price)
Bear's Knowledge + Tiller Profession
(×3.3 Sell Price)
Blackberry
22g
Blackberry
Silver
27g
Blackberry
Gold
33g
Blackberry
Iridium
44g
Blackberry
66g
Blackberry
Silver
82g
Blackberry
Gold
99g
Blackberry
Iridium
132g
{{Infosection price
  | item     = Wine, Jelly
  | srcprice = 20
  | auto     = true
  | prof     = Base, Artisan
  | quality  = Normal
  | artisan  = true
  | addtable = true
}}

Artisan goods section for Blackberry page. Result:

Artisan Sell Prices
Base Price: ArtisanArtisan Profession:
(+40% Sell Price)
Wine
60g
Wine
Silver
75g
Wine
Gold
90g
Wine
Iridium
120g
Jelly
90g
Wine
84g
Wine
Silver
105g
Wine
Gold
125g
Wine
Iridium
168g
Jelly
125g
{{Infosection price
  | prof      = Base, Base, Artisan
  | srcprice  = 200
  | auto      = true
  | itemcell1 = Roe
  | itemcell2 = Aged Roe
  | itemcell3 = Aged Roe
  | imageRoe  = Yellow Roe
  | quality   = Normal
  | artisan   = true
  | ncolumns  = 3    
  | addtable  = true
}}

Artisan goods section on Pufferfish page. Uses multiple special features

  • itemcell[#] to display a different item in each data cell.
  • image[item] to use a custom image for Roe.
  • ncolumns=3 overrides default (which would be ncolumns=1) -- want to use three side-by-side columns because standard fish price information is already in three-column format.

Artisan Sell Prices
Roe: Aged Roe: Aged Roe:
Artisan (+40%)
Roe
130g
Aged Roe
260g
Aged Roe
364g