This template is used only within the Traveling merchant articles. It is a formatted cell template.
It is actually used to format output for the two or three adjacent cells that appear in the price range and chance (and brought) columns of the items bought and items sold tables.
When a merchant buys or sells a Resource, they do so at a random price. The game color codes these prices into five categories, ranging from very above average to very below average. The chance that a merchant will buy or sell a given resource itself is also random, and that probability is also displayed as part of this template's output.
Colors and calculations[edit source]
This template automatically colors the first price in red by default, coloring it instead in green if the item is sold by the merchant. In this way, unfavorable values are shown in red and favorable values in green. This direction of color coding is observed in all of the cells.
The probability that the merchant actually visits the settlement in a given year is calculated by the template thusly:
- probability = ( C1 + c2 + c3 + c4 + c5 ) / years
The sections of the probability bar (rendered in the chance column) are then sized accordingly, i.e. given a 50% chance that the merchant visited during a 30 year period and, when they did, they brought an item and offered it at a very low price a total of five times, that price will be reflected by a red section of the bar that is 17% of its total possible length.
- (required) The first five are the price parameters for each of the five colors, and are shown in the cell in the price range column.
- (required) The next five are the count parameters for each of the five colors.
- (required) This is the number of in‑game years over which the data was collected.
- (optional) This indicates that the item is being sold to the player, and that an additional "brought" cell must be rendered.
- (required when
s=1) These are three values that are rendered in their respective color in the third cell.
For items that the merchant buys from you:
For items that the merchant sells to you: