Difference between revisions of "Template:Recipe draw"

From Captain of Industry Wiki
Jump to: navigation, search
m (Undo revision 7089 by Phoenixx (talk))
Tag: Undo
(fix "provides" multiple products; fix instant)
Line 84: Line 84:


-->{{#ifeq: {{#var: provides}} | yes ||<!--
-->{{#ifeq: {{#var: provides}} | yes ||<!--
   -->{{#if: {{{Input1Name|}}} |<!--
   -->{{#if: {{{Input1Name|}}} |<!--
     --><div class="block"><!--
     --><div class="block"><!--
Line 96: Line 97:
-->}}<!--
-->}}<!--


   ** Draw the 1st output instead if {{#var: provides}} is `yes`. **
   ** Draw outputs instead if {{#var: provides}} is `yes`. **


-->{{#ifeq: {{#var: provides}} | yes |<!--
-->{{#ifeq: {{#var: provides}} | yes |<!--
  ** Draw the 1st output **
   -->{{#if: {{{Output1Name|}}} |<!--
   -->{{#if: {{{Output1Name|}}} |<!--
     --><div class="block"><!--
     --><div class="block"><!--
Line 109: Line 113:
     --></div><!--
     --></div><!--
   -->}}<!--
   -->}}<!--
  ** Draw 2nd output **
  -->{{#if: {{{Output2Name|}}} |<!--
    --><div class="block">{{#var: img_plus}}</div><!--
    --><div class="block"><!--
      --><div class="upper">{{#if: {{{Output2Unit|}}} | &nbsp; | {{{Output2Qty|}}}&nbsp;{{{Output2Unit|}}} }}</div><!--
      -->[[File:{{{Output2Name}}}.png{{!}}{{#var: imgsz_reg}}{{!}}link={{{Output2Name}}}]]<!--
      -->{{#if: {{{Output2Unit|}}} | <!--
        --><div class="lower">{{{Output2Qty|}}}&nbsp;{{{Output2Unit|}}}</div>|<!--
        --><div class="lower blue">{{#expr: 60/{{{Time|1}}}*{{{Output2Qty|}}} round 2 }}</div><!--
      -->}}<!--
    --></div><!--
  -->}}<!--
  ** Draw 3rd output **
  -->{{#if: {{{Output3Name|}}} |<!--
    --><div class="block">{{#var: img_plus}}</div><!--
    --><div class="block"><!--
      --><div class="upper">{{#if: {{{Output3Unit|}}} | &nbsp; | {{{Output3Qty|}}}&nbsp;{{{Output3Unit|}}} }}</div><!--
      -->[[File:{{{Output3Name}}}.png{{!}}{{#var: imgsz_reg}}{{!}}link={{{Output3Name}}}]]<!--
      -->{{#if: {{{Output3Unit|}}} | <!--
        --><div class="lower">{{{Output3Qty|}}}&nbsp;{{{Output3Unit|}}}</div>|<!--
        --><div class="lower blue">{{#expr: 60/{{{Time|1}}}*{{{Output3Qty|}}} round 2 }}</div><!--
      -->}}<!--
    --></div><!--
  -->}}<!--
  ** Draw 4th output **
  -->{{#if: {{{Output4Name|}}} |<!--
    --><div class="block">{{#var: img_plus}}</div><!--
    --><div class="block"><!--
      --><div class="upper">{{#if: {{{Output4Unit|}}} | &nbsp; | {{{Output4Qty|}}}&nbsp;{{{Output4Unit|}}} }}</div><!--
      -->[[File:{{{Output4Name}}}.png{{!}}{{#var: imgsz_reg}}{{!}}link={{{Output4Name}}}]]<!--
      -->{{#if: {{{Output4Unit|}}} | <!--
        --><div class="lower">{{{Output4Qty|}}}&nbsp;{{{Output4Unit|}}}</div>|<!--
        --><div class="lower blue">{{#expr: 60/{{{Time|1}}}*{{{Output4Qty|}}} round 2 }}</div><!--
      -->}}<!--
    --></div><!--
  -->}}<!--
  ** Draw 5th output **
  -->{{#if: {{{Output5Name|}}} |<!--
    --><div class="block">{{#var: img_plus}}</div><!--
    --><div class="block"><!--
      --><div class="upper">{{#if: {{{Output5Unit|}}} | &nbsp; | {{{Output5Qty|}}}&nbsp;{{{Output5Unit|}}} }}</div><!--
      -->[[File:{{{Output5Name}}}.png{{!}}{{#var: imgsz_reg}}{{!}}link={{{Output5Name}}}]]<!--
      -->{{#if: {{{Output5Unit|}}} | <!--
        --><div class="lower">{{{Output5Qty|}}}&nbsp;{{{Output5Unit|}}}</div>|<!--
        --><div class="lower blue">{{#expr: 60/{{{Time|1}}}*{{{Output5Qty|}}} round 2 }}</div><!--
      -->}}<!--
    --></div><!--
  -->}}<!--
  ** Draw 6th output **
  -->{{#if: {{{Output6Name|}}} |<!--
    --><div class="block">{{#var: img_plus}}</div><!--
    --><div class="block"><!--
      --><div class="upper">{{#if: {{{Output6Unit|}}} | &nbsp; | {{{Output6Qty|}}}&nbsp;{{{Output6Unit|}}} }}</div><!--
      -->[[File:{{{Output6Name}}}.png{{!}}{{#var: imgsz_reg}}{{!}}link={{{Output6Name}}}]]<!--
      -->{{#if: {{{Output6Unit|}}} | <!--
        --><div class="lower">{{{Output6Qty|}}}&nbsp;{{{Output6Unit|}}}</div>|<!--
        --><div class="lower blue">{{#expr: 60/{{{Time|1}}}*{{{Output6Qty|}}} round 2 }}</div><!--
      -->}}<!--
    --></div><!--
  -->}}<!--
-->}}<!--
-->}}<!--


Line 191: Line 266:
-->{{#if: {{{Time|}}} |<!--
-->{{#if: {{{Time|}}} |<!--
   --><div class="block time"><!--
   --><div class="block time"><!--
     -->{{#ifeq: {{lc:{{{Time}}}}} | instant | <div>{{#var: img_arrow}}</div> |<!--
     -->{{#ifeq: {{lc:{{{Time}}}}} | <!-- instant --> 0 | <div>{{#var: img_arrow}}</div> |<!--
       --><div class="upper"><!--
       --><div class="upper"><!--
         -->{{#ifeq: {{#var: provides}} | yes |<!--
         -->{{#ifeq: {{#var: provides}} | yes |<!--
Line 230: Line 305:
-->}}<!--
-->}}<!--


   ** Draw 1st output unless {{#var: provides}} is `yes` **
   ** Draw outputs unless {{#var: provides}} is `yes` **


-->{{#ifeq: {{#var: provides}} | yes ||<!--
-->{{#ifeq: {{#var: provides}} | yes ||<!--
  ** Draw 1st output **
   -->{{#if: {{{Output1Name|}}} |<!--
   -->{{#if: {{{Output1Name|}}} |<!--
     --><div class="block"><!--
     --><div class="block"><!--
Line 243: Line 321:
     --></div><!--
     --></div><!--
   -->}}<!--
   -->}}<!--
-->}}<!--


   ** Draw 2nd output **
   ** Draw 2nd output **


-->{{#if: {{{Output2Name|}}} |<!--
  -->{{#if: {{{Output2Name|}}} |<!--
  --><div class="block">{{#var: img_plus}}</div><!--
    --><div class="block">{{#var: img_plus}}</div><!--
  --><div class="block"><!--
    --><div class="block"><!--
    --><div class="upper">{{#if: {{{Output2Unit|}}} | &nbsp; | {{{Output2Qty|}}}&nbsp;{{{Output2Unit|}}} }}</div><!--
      --><div class="upper">{{#if: {{{Output2Unit|}}} | &nbsp; | {{{Output2Qty|}}}&nbsp;{{{Output2Unit|}}} }}</div><!--
    -->[[File:{{{Output2Name}}}.png{{!}}{{#var: imgsz_reg}}{{!}}link={{{Output2Name}}}]]<!--
      -->[[File:{{{Output2Name}}}.png{{!}}{{#var: imgsz_reg}}{{!}}link={{{Output2Name}}}]]<!--
    -->{{#if: {{{Output2Unit|}}} | <!--
      -->{{#if: {{{Output2Unit|}}} | <!--
      --><div class="lower">{{{Output2Qty|}}}&nbsp;{{{Output2Unit|}}}</div>|<!--
        --><div class="lower">{{{Output2Qty|}}}&nbsp;{{{Output2Unit|}}}</div>|<!--
      --><div class="lower blue">{{#expr: 60/{{{Time|1}}}*{{{Output2Qty|}}} round 2 }}</div><!--
        --><div class="lower blue">{{#expr: 60/{{{Time|1}}}*{{{Output2Qty|}}} round 2 }}</div><!--
    -->}}<!--
      -->}}<!--
  --></div><!--
    --></div><!--
-->}}<!--
  -->}}<!--
 


   ** Draw 3rd output **
   ** Draw 3rd output **


-->{{#if: {{{Output3Name|}}} |<!--
  -->{{#if: {{{Output3Name|}}} |<!--
  --><div class="block">{{#var: img_plus}}</div><!--
    --><div class="block">{{#var: img_plus}}</div><!--
  --><div class="block"><!--
    --><div class="block"><!--
    --><div class="upper">{{#if: {{{Output3Unit|}}} | &nbsp; | {{{Output3Qty|}}}&nbsp;{{{Output3Unit|}}} }}</div><!--
      --><div class="upper">{{#if: {{{Output3Unit|}}} | &nbsp; | {{{Output3Qty|}}}&nbsp;{{{Output3Unit|}}} }}</div><!--
    -->[[File:{{{Output3Name}}}.png{{!}}{{#var: imgsz_reg}}{{!}}link={{{Output3Name}}}]]<!--
      -->[[File:{{{Output3Name}}}.png{{!}}{{#var: imgsz_reg}}{{!}}link={{{Output3Name}}}]]<!--
    -->{{#if: {{{Output3Unit|}}} | <!--
      -->{{#if: {{{Output3Unit|}}} | <!--
      --><div class="lower">{{{Output3Qty|}}}&nbsp;{{{Output3Unit|}}}</div>|<!--
        --><div class="lower">{{{Output3Qty|}}}&nbsp;{{{Output3Unit|}}}</div>|<!--
      --><div class="lower blue">{{#expr: 60/{{{Time|1}}}*{{{Output3Qty|}}} round 2 }}</div><!--
        --><div class="lower blue">{{#expr: 60/{{{Time|1}}}*{{{Output3Qty|}}} round 2 }}</div><!--
    -->}}<!--
      -->}}<!--
  --></div><!--
    --></div><!--
-->}}<!--
  -->}}<!--


   ** Draw 4th output **
   ** Draw 4th output **


-->{{#if: {{{Output4Name|}}} |<!--
  -->{{#if: {{{Output4Name|}}} |<!--
  --><div class="block">{{#var: img_plus}}</div><!--
    --><div class="block">{{#var: img_plus}}</div><!--
  --><div class="block"><!--
    --><div class="block"><!--
    --><div class="upper">{{#if: {{{Output4Unit|}}} | &nbsp; | {{{Output4Qty|}}}&nbsp;{{{Output4Unit|}}} }}</div><!--
      --><div class="upper">{{#if: {{{Output4Unit|}}} | &nbsp; | {{{Output4Qty|}}}&nbsp;{{{Output4Unit|}}} }}</div><!--
    -->[[File:{{{Output4Name}}}.png{{!}}{{#var: imgsz_reg}}{{!}}link={{{Output4Name}}}]]<!--
      -->[[File:{{{Output4Name}}}.png{{!}}{{#var: imgsz_reg}}{{!}}link={{{Output4Name}}}]]<!--
    -->{{#if: {{{Output4Unit|}}} | <!--
      -->{{#if: {{{Output4Unit|}}} | <!--
      --><div class="lower">{{{Output4Qty|}}}&nbsp;{{{Output4Unit|}}}</div>|<!--
        --><div class="lower">{{{Output4Qty|}}}&nbsp;{{{Output4Unit|}}}</div>|<!--
      --><div class="lower blue">{{#expr: 60/{{{Time|1}}}*{{{Output4Qty|}}} round 2 }}</div><!--
        --><div class="lower blue">{{#expr: 60/{{{Time|1}}}*{{{Output4Qty|}}} round 2 }}</div><!--
    -->}}<!--
      -->}}<!--
  --></div><!--
    --></div><!--
-->}}<!--
  -->}}<!--


   ** Draw 5th output **
   ** Draw 5th output **


-->{{#if: {{{Output5Name|}}} |<!--
  -->{{#if: {{{Output5Name|}}} |<!--
  --><div class="block">{{#var: img_plus}}</div><!--
    --><div class="block">{{#var: img_plus}}</div><!--
  --><div class="block"><!--
    --><div class="block"><!--
    --><div class="upper">{{#if: {{{Output5Unit|}}} | &nbsp; | {{{Output5Qty|}}}&nbsp;{{{Output5Unit|}}} }}</div><!--
      --><div class="upper">{{#if: {{{Output5Unit|}}} | &nbsp; | {{{Output5Qty|}}}&nbsp;{{{Output5Unit|}}} }}</div><!--
    -->[[File:{{{Output5Name}}}.png{{!}}{{#var: imgsz_reg}}{{!}}link={{{Output5Name}}}]]<!--
      -->[[File:{{{Output5Name}}}.png{{!}}{{#var: imgsz_reg}}{{!}}link={{{Output5Name}}}]]<!--
    -->{{#if: {{{Output5Unit|}}} | <!--
      -->{{#if: {{{Output5Unit|}}} | <!--
      --><div class="lower">{{{Output5Qty|}}}&nbsp;{{{Output5Unit|}}}</div>|<!--
        --><div class="lower">{{{Output5Qty|}}}&nbsp;{{{Output5Unit|}}}</div>|<!--
      --><div class="lower blue">{{#expr: 60/{{{Time|1}}}*{{{Output5Qty|}}} round 2 }}</div><!--
        --><div class="lower blue">{{#expr: 60/{{{Time|1}}}*{{{Output5Qty|}}} round 2 }}</div><!--
    -->}}<!--
      -->}}<!--
  --></div><!--
    --></div><!--
-->}}<!--
  -->}}<!--


   ** Draw 6th output **
   ** Draw 6th output **


-->{{#if: {{{Output6Name|}}} |<!--
  -->{{#if: {{{Output6Name|}}} |<!--
  --><div class="block">{{#var: img_plus}}</div><!--
    --><div class="block">{{#var: img_plus}}</div><!--
  --><div class="block"><!--
    --><div class="block"><!--
    --><div class="upper">{{#if: {{{Output6Unit|}}} | &nbsp; | {{{Output6Qty|}}}&nbsp;{{{Output6Unit|}}} }}</div><!--
      --><div class="upper">{{#if: {{{Output6Unit|}}} | &nbsp; | {{{Output6Qty|}}}&nbsp;{{{Output6Unit|}}} }}</div><!--
    -->[[File:{{{Output6Name}}}.png{{!}}{{#var: imgsz_reg}}{{!}}link={{{Output6Name}}}]]<!--
      -->[[File:{{{Output6Name}}}.png{{!}}{{#var: imgsz_reg}}{{!}}link={{{Output6Name}}}]]<!--
    -->{{#if: {{{Output6Unit|}}} | <!--
      -->{{#if: {{{Output6Unit|}}} | <!--
      --><div class="lower">{{{Output6Qty|}}}&nbsp;{{{Output6Unit|}}}</div>|<!--
        --><div class="lower">{{{Output6Qty|}}}&nbsp;{{{Output6Unit|}}}</div>|<!--
      --><div class="lower blue">{{#expr: 60/{{{Time|1}}}*{{{Output6Qty|}}} round 2 }}</div><!--
        --><div class="lower blue">{{#expr: 60/{{{Time|1}}}*{{{Output6Qty|}}} round 2 }}</div><!--
    -->}}<!--
      -->}}<!--
  --></div><!--
    --></div><!--
  -->}}<!--
-->}}<!--
-->}}<!--



Revision as of 07:33, 23 July 2022

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
  }}
Building not defined
Example usage for dumping loose materials
Markup Renders as
  {{Recipe
    | Output1Name = Dumping
    | Input1Name  = Rock
  }}
Building not defined
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.png
:
12 
Limestone.png
72
Plus.png
Coal.png
12
10 Clock.png
Transform.png
60 Clock 60s.png
Cement.png
24
Plus.png
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
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.png
:
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
Waste Water.png
60
Clock.png
Transform.png
60 Clock 60s.png
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
Water.png
24
10 Clock.png
Transform.png
60 Clock 60s.png
Sulfur.png
6
Plus.png
12 
Carbon Dioxide.png
72
Plus.png
Steam Lo.png
24
Plus.png
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.png
:
Steam Lo.png
48
Clock.png
Transform.png
60 Clock 60s.png
 
Mechanical Power.png
1 MW
Plus.png
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
:
60 Clock.png
Transform.png
60 Clock 60s.png
 
Waste.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
Limestone.png
12
Plus.png
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
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 (edit | diff) and testcases (create) pages.
Please add categories and interwikis to Template:Recipe draw/doc. (View all subpages of this page.)