Template:Recipe fetch: Difference between revisions

From Captain of Industry Wiki
Jump to: navigation, search
made the intro's headers
Vekking (talk | contribs)
No edit summary
 
(31 intermediate revisions by 4 users not shown)
Line 1: Line 1:
{{#if: {{NAMESPACE}} ||  
{{#if: {{NAMESPACE}} ||  
{{#vardefine: ingred | {{{1|{{PAGENAME}}}}} }}
{{#vardefine: ingred | {{{1|{{PAGENAME}}}}} }}<!--


{{#cargo_query: tables=recipes
-->{{#cargo_query: tables=RecipesImport
| fields = _pageName=Building,
  | fields =
            Input1Name, Input1Qty, Input2Name, Input2Qty, Input3Name, Input3Qty,
          Building,
            Input4Name, Input4Qty, Input5Name, Input5Qty, Input6Name, Input6Qty,
          BuildingIcon,
            Time,
          Input1Name, Input1Qty, Input1Icon,
            Output1name, Output1Qty, Output2Name, Output2Qty, Output3Name, Output3Qty,
          Input2Name, Input2Qty, Input2Icon,
            Output4Name, Output4Qty, Output5Name, Output5Qty, Output6Name, Output6Qty
          Input3Name, Input3Qty, Input3Icon,
          Input4Name, Input4Qty, Input4Icon,
          Input5Name, Input5Qty, Input5Icon,
          Input6Name, Input6Qty, Input6Icon,
          Time,
          PowerMult,
          Output1Name, Output1Qty, Output1Icon,
          Output2Name, Output2Qty, Output2Icon,
          Output3Name, Output3Qty, Output3Icon,
          Output4Name, Output4Qty, Output4Icon,
          Output5Name, Output5Qty, Output5Icon,
          Output6Name, Output6Qty, Output6Icon,
          Unreleased
  | where =
{{#if: {{{showAll|}}} | 1=1 |
    {{#if: {{{isbldg|}}} | Building = "{{PAGENAME}}" |


| where =
      {{#ifeq: {{lc:{{{dir|}}}}} | in |
  {{#ifeq: {{lc:{{{dir|}}}}} | in |
        Input1Name = "{{#var:ingred}}" OR Input2Name = "{{#var:ingred}}" OR Input3Name = "{{#var:ingred}}"
    Input1Name = "{{#var:ingred}}" OR Input2Name = "{{#var:ingred}}" OR Input3Name = "{{#var:ingred}}"
        OR Input4Name = "{{#var:ingred}}" OR Input5Name = "{{#var:ingred}}" OR Input6Name = "{{#var:ingred}}" |
    OR Input4Name = "{{#var:ingred}}" OR Input5Name = "{{#var:ingred}}" OR Input6Name = "{{#var:ingred}}" |


    {{#ifeq: {{lc:{{{dir|}}}}} | out |
        {{#ifeq: {{lc:{{{dir|}}}}} | out |
      Output1name = "{{#var:ingred}}" OR Output2Name = "{{#var:ingred}}" OR Output3Name = "{{#var:ingred}}"
          Output1Name = "{{#var:ingred}}" OR Output2Name = "{{#var:ingred}}" OR Output3Name = "{{#var:ingred}}"
      OR Output4Name = "{{#var:ingred}}" OR Output5Name = "{{#var:ingred}}" OR Output6Name = "{{#var:ingred}}" |
          OR Output4Name = "{{#var:ingred}}" OR Output5Name = "{{#var:ingred}}" OR Output6Name = "{{#var:ingred}}" |


        Input1Name = "{{#var:ingred}}" OR Input2Name = "{{#var:ingred}}" OR Input3Name = "{{#var:ingred}}"
            {{#ifeq: {{lc:{{{dir|}}}}} | both |
        OR Input4Name = "{{#var:ingred}}" OR Input5Name = "{{#var:ingred}}" OR Input6Name = "{{#var:ingred}}"
              Input1Name = "{{#var:ingred}}" OR Input2Name = "{{#var:ingred}}" OR Input3Name = "{{#var:ingred}}"
        OR Output1name = "{{#var:ingred}}" OR Output2Name = "{{#var:ingred}}" OR Output3Name = "{{#var:ingred}}"
              OR Input4Name = "{{#var:ingred}}" OR Input5Name = "{{#var:ingred}}" OR Input6Name = "{{#var:ingred}}"
        OR Output4Name = "{{#var:ingred}}" OR Output5Name = "{{#var:ingred}}" OR Output6Name = "{{#var:ingred}}" }} }}
              OR Output1Name = "{{#var:ingred}}" OR Output2Name = "{{#var:ingred}}" OR Output3Name = "{{#var:ingred}}"
              OR Output4Name = "{{#var:ingred}}" OR Output5Name = "{{#var:ingred}}" OR Output6Name = "{{#var:ingred}}" }} }} }} }} }}<!--
 
  -->| intro = {{#ifeq: {{lc:{{{dir|}}}}} | in | ===Consumption=== | {{#ifeq: {{lc:{{{dir|}}}}} | out | ===Production=== }} }}<!--


| intro = {{#ifeq: {{lc:{{{dir|}}}}} | in | ==Consumption== | {{#ifeq: {{lc:{{{dir|}}}}} | out | ==Production==}} }}
  -->| format = template
| format = template
  | template = {{{template|Recipe draw}}}
| template = Recipe draw
  | named args = yes
| named args = yes
  | limit= {{{limit|100}}}
}}
  | offset= {{{offset|0}}}
}}
  | default =  
  |more results text=
}}<!--
-->}}<!--
--><noinclude>{{documentation}}</noinclude>

Latest revision as of 17:28, 20 May 2025

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
  }}
[[File:{{{Output1Icon}}}.png|64x64px|link=Copper Ore]]
Example usage for dumping loose materials
Markup Renders as
  {{Recipe
    | Output1Name = Dumping
    | Input1Name  = Rock
  }}
[[File:{{{Input1Icon}}}.png|64x64px|link=Rock]]
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
  }}
[[File:{{{BuildingIcon}}}.png|72x72px|link=Rotary Kiln]]Coal
:
12
72
2
12
10 
60 
4
24
8
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
  }}
[[File:{{{BuildingIcon}}}.png|72x72px|link=Groundwater Pump]]
:
PROVIDES
8
48
/ 10 

/ 60 
Example usage for dumping/flaring/venting non-polluting liquids/gasses
Markup Renders as
  {{Recipe
    | Building    = Smoke Stack
    | Input1Name  = Oxygen
    | Input1Qty   = 200
    | Time        = 20
  }}
[[File:{{{BuildingIcon}}}.png|72x72px|link=Smoke Stack]]Small
:
ACCEPTS
200
600
/ 20 

/ 60 
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
  }}
[[File:{{{BuildingIcon}}}.png|72x72px|link=Liquid Dump]]
:
ACCEPTS
2
60
/ 2 

/ 60 
2
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
  }}
[[File:{{{BuildingIcon}}}.png|72x72px|link=Exhaust Scrubber]]
:
30
180
4
24
10 
60 
1
6
12
72
4
24
4
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
  }}
[[File:{{{BuildingIcon}}}.png|72x72px|link=Low-pressure Turbine]]Tier I
:
4
48
60 
 
1 MW
4
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
  }}
[[File:{{{BuildingIcon}}}.png|72x72px|link=Power Generator]]
:
 
500 KW
 
250 KW
Example usage for recipes with variable quantity
Markup Renders as
  {{Recipe
    | Building    = Waste Collection
    | Time        = 60
    | Output1Name = Waste
    | Output1Unit = ?
  }}
[[File:{{{BuildingIcon}}}.png|72x72px|link=Waste Collection]]
:
PROVIDES
?
?
/ 60 

/ 60 
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
54
4
12
4
12
20 
60 
14
42
Example usage for unreleased recipe
Markup Renders as
  {{Recipe
    | Building    = Crusher
    | Input1Name  = Gravel
    | Input1Qty   = 18
    | Time        = 20
    | Output1Name = Gold
    | Output1Qty  = 14
    | Unreleased  = yes
  }}
[[File:{{{BuildingIcon}}}.png|72x72px|link=Crusher]]
:
20
60
20 
60 
1
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.)