Difference between revisions of "Template:Recipe define"

From Captain of Industry Wiki
Jump to: navigation, search
(Replace unicode 4-o-clock symbol with source in-game UI image asset)
m
 
(72 intermediate revisions by 2 users not shown)
Line 1: Line 1:
<includeonly><!--
<includeonly><!--
--><div style="min-height: 75px; font-size: 14px; font-weight: bold;"><!--
  -->{{#if: {{NAMESPACE}} ||<!--
    -->{{#cargo_store: _table = recipes <!--


  -->{{#if:{{{Building|}}}|<!--
       ** Fields are specified to specify types and try to avoid silent definition error,
    --><div style="max-width:65px; max-height:65px; text-align:center; vertical-align:top; display:inline-block; position:relative;"><!--
       when parser decides to put empty strings in place of unspecified fields. **
       -->{{#ifeq: {{lc:{{{Building}}}}} | dumping |
        [[File:{{{Output1Name}}}.png{{!}}link={{{Output1Name}}}{{!}}65x65px]] |
        [[File:{{{Building}}}.png{{!}}link={{{Building}}}{{!}}65x65px]]<!--
       -->}}<!--
    --></div><!--
    -->{{#switch: {{lc:{{{Building}}}}}
        | mining
        | dumping = <div style="display: inline-block; margin-top: 15px; width: 50px; text-align:center;"><div style="height:45px; text-align:center; display:inline-block; font-size:10pt;"><div>[[File:Icon arrow right.svg|30x45px]]</div></div></div>
        | #default = <div style="font-size:18px; width:15px; text-align:center; vertical-align:text-top; display:inline-block; position: relative;">:</div><!--
    -->}}<!--
  -->}}<!--


  -->{{#if:{{{Input1Name|}}}|<!--
       ** Building field is taken from info_bldg by default in preparation to the possible change,
    --><div style="max-width:45px; max-height:45px; text-align:center; vertical-align:top; display:inline-block; position:relative;"><!--
       when recipe data won't be defined at buildings pages anymore. See Infobox templates.**
       -->[[File:{{{Input1Name}}}.png|link={{{Input1Name}}}|45x45px]]<div style="display: inline-block; margin-top: 5px;">{{{Input1Qty}}}</div><!--
    --></div><!--
  -->}}<!--
  -->{{#if:{{{Input2Name|}}}|<!--
    --><div style="font-size:18px; width:20px; text-align:center; vertical-align:bottom; display:inline-block; position: relative;">+</div><!--
    --><div style="max-width:45px; max-height:45px; text-align:center; vertical-align:top; display:inline-block;  position:relative;"><!--
       -->[[File:{{{Input2Name}}}.png|link={{{Input2Name}}}|45x45px]]<div style="display: inline-block; margin-top: 5px;">{{{Input2Qty}}}</div><!--
    --></div><!--
  -->}}<!--
  -->{{#if:{{{Input3Name|}}}|<!--
    --><div style="font-size:18px; width:20px; text-align:center; vertical-align:bottom; display:inline-block; position: relative;">+</div><!--
    --><div style="max-width:45px; max-height:45px; text-align:center; vertical-align:top; display:inline-block;  position:relative;"><!--
      -->[[File:{{{Input3Name}}}.png|link={{{Input3Name}}}|45x45px]]<div style="display: inline-block; margin-top: 5px;">{{{Input3Qty}}}</div><!--
    --></div><!--
  -->}}<!--
  -->{{#if:{{{Input4Name|}}}|<!--
    --><div style="font-size:18px; width:20px; text-align:center; vertical-align:bottom; display:inline-block; position: relative;">+</div><!--
    --><div style="max-width:45px; max-height:45px; text-align:center; vertical-align:top; display:inline-block;  position:relative;"><!--
      -->[[File:{{{Input4Name}}}.png|link={{{Input4Name}}}|45x45px]]<div style="display: inline-block; margin-top: 5px;">{{{Input4Qty}}}</div><!--
    --></div><!--
  -->}}<!--
  -->{{#if:{{{Input5Name|}}}|<!--
    --><div style="font-size:18px; width:20px; text-align:center; vertical-align:bottom; display:inline-block; position: relative;">+</div><!--
    --><div style="max-width:45px; max-height:45px; text-align:center; vertical-align:top; display:inline-block;  position:relative;"><!--
      -->[[File:{{{Input5Name}}}.png|link={{{Input5Name}}}|45x45px]]<div style="display: inline-block; margin-top: 5px;">{{{Input5Qty}}}</div><!--
    --></div><!--
  -->}}<!--
  -->{{#if:{{{Input6Name|}}}|<!--
    --><div style="font-size:18px; width:20px; text-align:center; vertical-align:bottom; display:inline-block; position: relative;">+</div><!--
    --><div style="max-width:45px; max-height:45px; text-align:center; vertical-align:top; display:inline-block;  position:relative;"><!--
      -->[[File:{{{Input6Name}}}.png|link={{{Input6Name}}}|45x45px]]<div style="display: inline-block; margin-top: 5px;">{{{Input6Qty}}}</div><!--
    --></div><!--
  -->}}<!--


  -->{{#if:{{{Time|}}}|<div style="display: inline-block; margin-top: 15px; width: 50px; text-align:center;"><div style="height:45px; text-align:center; display:inline-block; font-size:10pt;"><div>{{{Time}}}&nbsp;[[File:Clock.png|link=|16x16px]]</div><div>[[File:Icon arrow right.svg|30x45px]]</div></div></div>}}<!--
    -->| Building    = {{{Building|{{#var:info_bldg}}}}}
 
        | Unreleased  = {{{Unreleased|}}}
   -->{{#if:{{{Output1Name|}}}|<!--
        | Input1Name  = {{{Input1Name|}}}
    -->{{#ifeq: {{lc:{{{Building}}}}} | dumping <!--
        | Input1Qty  = {{{Input1Qty|0.0}}}
      -->|<div style="max-width:45px; max-height:45px; text-align:center; vertical-align:top; display:inline-block; position:relative;"><!--
        | Input1Unit  = {{{Input1Unit|}}}
         -->[[File:{{{Building}}}.png{{!}}link={{{Building}}}{{!}}65x65px]]<!--
        | Input2Name  = {{{Input2Name|}}}
      --></div><!--
        | Input2Qty  = {{{Input2Qty|0.0}}}
      -->|<div style="max-width:45px; max-height:45px; text-align:center; vertical-align:top; display:inline-block; position:relative;"><!--
        | Input2Unit  = {{{Input2Unit|}}}
         -->[[File:{{{Output1Name}}}.png{{!}}link={{{Output1Name}}}{{!}}45x45px]]<div style="display: inline-block; margin-top: 5px;">{{{Output1Qty|}}}</div><!--
        | Input3Name  = {{{Input3Name|}}}
      --></div><!--
        | Input3Qty  = {{{Input3Qty|0.0}}}
        | Input3Unit  = {{{Input3Unit|}}}
        | Input4Name  = {{{Input4Name|}}}
        | Input4Qty   = {{{Input4Qty|0.0}}}
        | Input4Unit  = {{{Input4Unit|}}}
        | Input5Name  = {{{Input5Name|}}}
        | Input5Qty  = {{{Input5Qty|0.0}}}
        | Input5Unit  = {{{Input5Unit|}}}
        | Input6Name  = {{{Input6Name|}}}
        | Input6Qty  = {{{Input6Qty|0.0}}}
        | Input6Unit  = {{{Input6Unit|}}}
        | Time        = {{{Time|0.0}}}
        | Output1Name = {{{Output1Name|}}}
        | Output1Qty = {{{Output1Qty|0.0}}}
        | Output1Unit = {{{Output1Unit|}}}
         | Output2Name = {{{Output2Name|}}}
        | Output2Qty  = {{{Output2Qty|0.0}}}
        | Output2Unit = {{{Output2Unit|}}}
        | Output3Name = {{{Output3Name|}}}
        | Output3Qty  = {{{Output3Qty|0.0}}}
        | Output3Unit = {{{Output3Unit|}}}
        | Output4Name = {{{Output4Name|}}}
        | Output4Qty = {{{Output4Qty|0.0}}}
        | Output4Unit = {{{Output4Unit|}}}
         | Output5Name = {{{Output5Name|}}}
        | Output5Qty  = {{{Output5Qty|0.0}}}
        | Output5Unit = {{{Output5Unit|}}}
        | Output6Name = {{{Output6Name|}}}
        | Output6Qty  = {{{Output6Qty|0.0}}}
        | Output6Unit = {{{Output6Unit|}}} <!--
     -->}}<!--
     -->}}<!--
   -->}}<!--
   -->}}<!--
  -->{{#if:{{{Output2Name|}}}|<!--
--></includeonly><!--
    --><div style="font-size:18px; width:20px; text-align:center; vertical-align:bottom; display:inline-block; position: relative;">+</div><!--
 
    --><div style="max-width:45px; max-height:45px; text-align:center; vertical-align:top; display:inline-block;  position:relative;"><!--
-->{{#vardefine: cargo_define_invoked | yes}}<!--
      -->[[File:{{{Output2Name}}}.png|link={{{Output2Name}}}|45x45px]]<div style="display: inline-block; margin-top: 5px;">{{{Output2Qty}}}</div><!--
    --></div><!--
  -->}}<!--
  -->{{#if:{{{Output3Name|}}}|<!--
    --><div style="font-size:18px; width:20px; text-align:center; vertical-align:bottom; display:inline-block; position: relative;">+</div><!--
    --><div style="max-width:45px; max-height:45px; text-align:center; vertical-align:top; display:inline-block;  position:relative;"><!--
      -->[[File:{{{Output3Name}}}.png|link={{{Output3Name}}}|45x45px]]<div style="display: inline-block; margin-top: 5px;">{{{Output3Qty}}}</div><!--
    --></div><!--
  -->}}<!--
  -->{{#if:{{{Output4Name|}}}|<!--
    --><div style="font-size:18px; width:20px; text-align:center; vertical-align:bottom; display:inline-block; position: relative;">+</div><!--
    --><div style="max-width:45px; max-height:45px; text-align:center; vertical-align:top; display:inline-block;  position:relative;"><!--
      -->[[File:{{{Output4Name}}}.png|link={{{Output4Name}}}|45x45px]]<div style="display: inline-block; margin-top: 5px;">{{{Output4Qty}}}</div><!--
    --></div><!--
  -->}}<!--
  -->{{#if:{{{Output5Name|}}}|<!--
    --><div style="font-size:18px; width:20px; text-align:center; vertical-align:bottom; display:inline-block; position: relative;">+</div><!--
    --><div style="max-width:45px; max-height:45px; text-align:center; vertical-align:top; display:inline-block;  position:relative;"><!--
      -->[[File:{{{Output5Name}}}.png|link={{{Output5Name}}}|45x45px]]<div style="display: inline-block; margin-top: 5px;">{{{Output5Qty}}}</div><!--
    --></div><!--
  -->}}<!--
  -->{{#if:{{{Output6Name|}}}|<!--
    --><div style="font-size:18px; width:20px; text-align:center; vertical-align:bottom; display:inline-block; position: relative;">+</div><!--
    --><div style="max-width:45px; max-height:45px; text-align:center; vertical-align:top; display:inline-block;  position:relative;"><!--
      -->[[File:{{{Output6Name}}}.png|link={{{Output6Name}}}|45x45px]]<div style="display: inline-block; margin-top: 5px;">{{{Output6Qty}}}</div><!--
    --></div><!--
  -->}}<!--


--></div></includeonly><!--
--><noinclude><!--
--><noinclude>{{documentation}}</noinclude>
  -->{{#cargo_attach: _table = recipes}}<!--
  -->{{documentation}}<!--
--></noinclude>

Latest revision as of 15:21, 2 May 2023

This template adds rows to the table "recipes", which is declared by the template Recipe declare. View table.

Template documentation (for the above template, sometimes hidden or invisible) [view] [edit] [history] [refresh]
Purpose
This template provides a method to rapidly illustrate crafting recipes without in-depth knowledge of wiki syntax or manual repetition/copy-pasting.
Basic usage
The following 2 templates are provided for making a recipe.
Both templates can be used with the format written in #Examples in this document.
Parameters
The template accepts the following parameters:
  • Building: Name of buildings (example: Blast Furnace). No need to specify on pages using Template:Infobox machine because the building is automatically detected.
  • Input1Name, Input2Name, ..., Input6Name: Name of materials (example: Iron Ore)
    • Input1Name = Mining (optional): Applies special format for mining.
  • Output1Name, Output2Name, ... Output6Name: Name of products (example: Molten Iron)
    • Output1Name = Dumping (optional): Applies special format for dumping.
  • Input1Qty, ..., Input6Qty, Output1Qty, ..., Output6Qty: Amount of materials or products per 1 cycle of recipe.
  • Time: Cycle time of recipe.
  • Input1Unit, ..., Input6Unit, Output1Unit, ..., Output6Unit (optional): Adds unit (for Electricity and Mechanical Power)
  • HideBldg (optional, rare): Hides building in recipe. No need to specify on pages using Template:Infobox machine (the building is automatically hidden).
  • Unreleased = yes (optional, rare): Applies special format for unreleased recipe
Limitations
This template can accept up to 6 inputs, 6 outputs, and 1 time value per recipe. The output can include only 1 pollution.

Examples

Example usage for mining
Markup Renders as
  {{Recipe
    | Input1Name  = Mining
    | Output1Name = Copper Ore
  }}
Mining.png
Transform.png
Copper Ore.png
Example usage for dumping loose materials
Markup Renders as
  {{Recipe
    | Output1Name = Dumping
    | Input1Name  = Rock
  }}
Rock.png
Transform.png
Dumping.png
Example usage for a machine with both inputs and outputs without pollution (most recipes)
Markup Renders as
  {{Recipe
    | Building    = Rotary Kiln
    | Input1Name  = Limestone
    | Input1Qty   = 12
    | Input2Name  = Coal
    | Input2Qty   = 2
    | Time        = 10
    | Output1Name = Cement
    | Output1Qty  = 4
    | Output2Name = Exhaust
    | Output2Qty  = 8
  }}
Rotary Kiln.pngCoal
:
12
Limestone.png
72
Plus.png
2
Coal.png
12
10 Clock.png
Transform.png
60 Clock 60s.png
4
Cement.png
24
Plus.png
8
Exhaust.png
48
Example for buildings that "provide" materials (Groundwater Pump, Air Separator, etc.)
Markup Renders as
  {{Recipe
    | Building    = Groundwater Pump
    | Time        = 10
    | Output1Name = Water
    | Output1Qty  = 8
  }}
Groundwater Pump.png
:
PROVIDES
8
Water.png
48
/ 10 Clock.png

/ 60 Clock 60s.png
Example usage for dumping/flaring/venting non-polluting liquids/gasses
Markup Renders as
  {{Recipe
    | Building    = Smoke Stack
    | Input1Name  = Oxygen
    | Input1Qty   = 200
    | Time        = 20
  }}
Smoke Stack.pngSmall
:
ACCEPTS
200
Oxygen.png
600
/ 20 Clock.png

/ 60 Clock 60s.png
Example usage for recipe with pollution
Markup Renders as
  {{Recipe
    | Building    = Liquid Dump
    | Input1Name  = Waste Water
    | Input1Qty   = 2
    | Time        = 2
    | Output1Name = Water Pollution
    | Output1Qty  = 2
  }}
Liquid Dump.png
:
ACCEPTS
2
Waste Water.png
60
/ 2 Clock.png

/ 60 Clock 60s.png
2
Water Pollution.png
60
  {{Recipe
    | Building    = Exhaust Scrubber
    | Input1Name  = Exhaust
    | Input1Qty   = 30
    | Input2Name  = Water
    | Input2Qty   = 4
    | Time        = 10
    | Output1Name = Sulfur
    | Output1Qty  = 1
    | Output2Name = Carbon Dioxide
    | Output2Qty  = 12
    | Output3Name = Steam Lo
    | Output3Qty  = 4
    | Output4Name = Air Pollution
    | Output4Qty  = 4
  }}
Exhaust Scrubber.png
:
30
Exhaust.png
180
Plus.png
4
Water.png
24
10 Clock.png
Transform.png
60 Clock 60s.png
1
Sulfur.png
6
Plus.png
12
Carbon Dioxide.png
72
Plus.png
4
Steam Lo.png
24
4
Air Pollution.png
24
Example usage for Mechanical Power and Electricity recipes with units
Markup Renders as
  {{Recipe
    | Building    = Low-pressure Turbine
    | Input1Name  = Steam Lo
    | Input1Qty   = 4
    | Time        = 5
    | Output1Name = Mechanical Power
    | Output1Qty  = 1
    | Output1Unit = MW
    | Output2Name = Steam Depleted
    | Output2Qty  = 4
  }}
Low-pressure Turbine.pngTier I
:
4
Steam Lo.png
48
Clock.png
Transform.png
60 Clock 60s.png
 
Mechanical Power.png
1 MW
Plus.png
4
Steam Depleted.png
48
Example usage for instantaneous recipes
Markup Renders as
  {{Recipe
    | Building    = Power Generator
    | Input1Name  = Mechanical Power
    | Input1Qty   = 500
    | Input1Unit  = KW
    | Time        = 0
    | Output1Name = Electricity
    | Output1Qty  = 250
    | Output1Unit = KW
  }}
Power Generator.png
:
 
Mechanical Power.png
500 KW
Transform.png
 
Electricity.png
250 KW
Example usage for recipes with variable quantity
Markup Renders as
  {{Recipe
    | Building    = Waste Collection
    | Time        = 60
    | Output1Name = Waste
    | Output1Unit = ?
  }}
Waste Collection.png
:
PROVIDES
?
Waste.png
?
/ 60 Clock.png

/ 60 Clock 60s.png
Example usage for hiding the building (automatically happens on pages using Template:Infobox machine)
Markup Renders as
  {{Recipe
    | Building    = Mixer
    | HideBldg    = yes
    | Input1Name  = Sand
    | Input1Qty   = 18
    | Input2Name  = Limestone
    | Input2Qty   = 4
    | Input3Name  = Salt
    | Input3Qty   = 4
    | Time        = 20
    | Output1Name = Glass Mix
    | Output1Qty  = 14
  }}
18
Sand.png
54
Plus.png
4
Limestone.png
12
Plus.png
4
Salt.png
12
20 Clock.png
Transform.png
60 Clock 60s.png
14
Glass Mix.png
42
Example usage for unreleased recipe
Markup Renders as
  {{Recipe
    | Building    = Crusher
    | Input1Name  = Gravel
    | Input1Qty   = 18
    | Time        = 20
    | Output1Name = Gold
    | Output1Qty  = 14
    | Unreleased  = yes
  }}
Crusher.png
:
20
Gravel.png
60
20 Clock.png
Transform.png
60 Clock 60s.png
1
Gold.png
3
UNRELEASED
The above text is transcluded from Template:Recipe draw/doc; you can change it or view its history. (How does this work?)
If you're done making changes, please refresh the text. (Why?)
You can experiment in this template's sandbox (create | mirror ) and testcases (create) pages.
Please add categories and interwikis to Template:Recipe draw/doc. (View all subpages of this page.)