For legacy support only! {{Cost}} now support discounts directly.
For a 10% discount just use {{Cost|XXX|disc=b}} (Sam) or {{Cost|XXX|disc=m}} (Alan)

This is {{CostSam}}. (This documentation also applies to {{CostAlan}}.) The template accepts the same input that {{Cost}} accepts, applies the 10% discount received for completing all of Sam's (Alan's) contracts, then produces output in the same format as {{Cost}}. This template is designed to be used in tandem with {{Cost}} when creating tables for buildings (Mystery Depot).


Users can input data for buildings (Mystery Depot items) much more quickly and easily than before. This template eliminates the need for users to calculate discounts themselves, eliminates errors in calculating or typing discounted prices, and eliminates inconsistencies between users when rounding. Just input cost data, copy and paste, change the name of the template, and that's it!!

{{CostSam}} ({{CostAlan}}) is almost an exact duplicate of {{Cost}}, which was designed and created by Koppa Dasao. Koppa Dasao deserves all the credit for this template's logic, structure, and output. The only difference between this template and the original is the tiny amount of code used to calculate the discount.


  • {{CostSam|<resource1=amount1>}}
  • {{CostAlan|<resource1=amount1>|<resource2=amount2>}}
  • {{CostSam|<resource1=amount1>|<resource2=amount2>|<resource3=amount3>}}
  • {{CostAlan|<resource1=amount1>|<resource2=amount2>|<line=y>}}
    • resource1, resource2, resource3 = the names of the 18 different resources in the TrainStation game: gems, gold, and the 16 materials. (minimum: 4 characters)
    • amount1, amount2, amount3 = the amounts required of resource1, resource2, and resource3, respectively, to purchase an item. Always use plain numbers with no formatting, e.g. 1000000 (NOT 1,000,000 or 1.000.000 or 1 000 000).
    • The 2nd and 3rd parameters are optional. If the item requires only one or two resources, simply close the {{braces}}. DO NOT add extra pipes (|) for the unnecessary parameters.
    • Gems (Gems) always appear alone in an item's cost. No item in the game has a cost that includes gems plus another resource.
    • Optional parameter line, if present, will cause the output to display on one horizontal line.


NOTE: This template is designed to be used with {{Cost}}. {{CostSam}} should rarely be used alone, if ever.

{{CostSam|gold=10000}} gives...
9,000 Gold*

{{CostAlan|gold=10000|wood=20000|bricks=1234567890}} gives...
9,000 Gold
18,000 Wood
1,111,111,101 Bricks

Example buildings table (abbreviated):

{| border="0" class="article-table sortable" style="width:100%; text-align:right;"
!scope="col" style="text-align:left;"| Name
!scope="col" style="text-align:right;"| Level
!scope="col" style="text-align:right;" class="unsortable"| Limit
!scope="col" style="text-align:right;" class="unsortable"| Cost
!scope="col" style="text-align:right;" class="unsortable"| [[Discounts#Buildings|Discounted Cost]]
!scope="col" style="text-align:right;" class="unsortable"| {{XP|Build}}
|style="text-align:left;"| [[Central Station]]
| {{formatnum:50}}
| {{formatnum:1}}
| {{cost|gems=150}}
| {{CostSam|gems=150}}
| {{formatnum:5200}}
|style="text-align:left;"| [[Suburb Station]]
| {{formatnum:50}}
| {{formatnum:1}}
| {{cost|bric=20000|glas=15000|stee=10000}}
| {{CostSam|bric=20000|glas=15000|stee=10000}}
| {{formatnum:3200}}


Name Level Limit Cost Discounted Cost Build XP
Central Station 50 1 150 Gems 135 Gems* 5,200
Suburb Station 50 1 20,000 Bricks
15,000 Glass
10,000 Steel
18,000 Bricks
13,500 Glass
9,000 Steel

Example horizontal output

Cost: {{Cost|wood=5000|bric=5000|sili=5000|line=y}}<br />
Disc.: {{CostSam|wood=5000|bric=5000|sili=5000|line=y}}

Cost: 5,000 Wood; 5,000 Bricks; 5,000 Silicon
Disc.: 4,500 Wood; 4,500 Bricks; 4,500 Silicon*

See also

Community content is available under CC-BY-SA unless otherwise noted.