Difference between revisions of "Template:Recipe define"

From Captain of Industry Wiki
Jump to: navigation, search
(Add ability for air/water polution in dumping and flaring)
(Overhaul to reprecate Venting, DumpingLiq, and Flare params. Incorporate variables for code reuse and ease of reconfig. Detect building param from Template:Infobox machine. Some debug code included to find/fix errors once I submit this edit.)
Line 1: Line 1:
<includeonly><templatestyles src="Template:Recipe/styles.css" /><!--
<includeonly><templatestyles src="Template:Recipe/styles.css" /><!--
  ** Clear variables in case of multiple uses on one page **
-->{{#vardefine: accepts | no}}<!--
-->{{#vardefine: provides | no}}<!--
  ** Set up variables to specify desired settings and reuse code **
-->{{#vardefine: img_arrow | [[File:Icon arrow right.svg|30x45px]] }}<!--
-->{{#vardefine: imgsz_bldg | 72x72px }}<!--
-->{{#vardefine: imgsz_large | 64x64px }}<!--
-->{{#vardefine: imgsz_reg | 48x48px }}<!--
--><div class="recipe-wrapper"><!--
--><div class="recipe-wrapper"><!--


   -->{{#if: {{{Mining|}}} |<!-- Only executes if the `Mining` param is set (to any value)
   ** Special output for when `Mining = yes` **
    --><div class="block">[[File:Mining.png{{!}}64x64px{{!}}link=Mining]]</div><!--
 
    --><div class="block">[[File:Icon arrow right.svg|30x45px]]</div><!--
-->{{#if: {{{Mining|}}} |<!--
    --><div class="block">[[File:{{{Output1Name}}}.png{{!}}64x64px{{!}}link={{{Output1Name}}}]]</div><!--
  --><div class="block">[[File:Mining.png{{!}}{{#var: imgsz_large}}{{!}}link=Mining]]</div><!--
  --><div class="block">{{#var: img_arrow}}</div><!--
  --><div class="block">[[File:{{{Output1Name}}}.png{{!}}{{#var: imgsz_large}}{{!}}link={{{Output1Name}}}]]</div><!--
-->}}<!--
 
  ** Special output for when `Dumping = yes` **
 
-->{{#if: {{{Dumping|}}} |<!--
  --><div class="block">[[File:{{{Input1Name}}}.png{{!}}{{#var: imgsz_large}}{{!}}link={{{Input1Name}}}]]</div><!--
  --><div class="block">{{#var: img_arrow}}</div><!--
  --><div class="block">[[File:Dumping.png{{!}}{{#var: imgsz_large}}{{!}}link=Dumping]]</div><!--
-->}}<!--
 
  ** Stop output if we we drew Mining or Dumping **
 
-->{{#if: {{{Mining|}}}{{{Dumping|}}} ||<!--
 
  ** Check if Template:Infobox_machine already knows the building. If not, try the `Building` param. **
  ** Then if we still don't know the building, halt execution and display an error message. **
 
-->{{#if: {{#varexists: info_bldg}}||<!--
  -->{{#if: {{{Building|}}}|<!--
    -->{{#vardefine: bldg | {{{Building}}} }}|<!--
    --><span style="font-size: 24px; color: red; font-weight: bold">Building not defined</span><!--
    -->[[Category:Broken recipe template usage]]<!-- DEBUG DEBUG DEBUG
   -->}}<!--
   -->}}<!--
-->}}<!--


   -->{{#if: {{{Dumping|}}} |<!-- Only executes if the `Dumping` param is set (to any value)
   ** Main sequence starts here **
    --><div class="block">[[File:{{{Input1Name}}}.png{{!}}64x64px{{!}}link={{{Input1Name}}}]]</div><!--
 
    --><div class="block">[[File:Icon arrow right.svg|30x45px]]</div><!--
-->{{#if: {{#varexists: bldg}} |<!--
    --><div class="block">[[File:Dumping.png{{!}}64x64px{{!}}link=Dumping]]</div><!--
 
  -->}}<!--
  ** Determine if we should display the "PROVIDES" or "ACCEPTS" text in the output **
 
-->{{#switch: {{#var: bldg}}
    | Flare   
    | Smoke Stack
    | Liquid Dump = {{#vardefine: accepts | yes}}
    | Groundwater Pump
    | Air Separator
    | Seawater Pump
    | Oil Pump = {{#vardefine: provides | yes}}
  }}<!--
 
  ** Draw the building (and colon) unless the user or Template:Infobox_machine set it to hidden. **
 
-->{{#if: {{{HideBldg|}}}{{#varexists:hidebldg}} ||<!--
  --><div class="block">[[File:{{{Building}}}.png{{!}}{{#var: imgsz_bldg}}{{!}}link={{{Building}}}]]</div><!--
  --><div class="block colon">:</div><!--
-->}}<!--
 
  ** Draw "ACCEPTS" or "PROVIDES", if appropriate **
 
-->{{#ifeq: {{#var: accepts}} | yes | <div class="block accepts-provides">ACCEPTS</div> }}<!--
-->{{#ifeq: {{#var: provides}} | yes | <div class="block accepts-provides">PROVIDES</div> }}<!--
 
  ** Draw 1st input **


   -->{{#if: {{{Venting|}}}{{{DumpingLiq|}}}{{{Flare|}}} |<!-- Only executes if the `Venting` or `DumpingLiq` param is set (to any value)
-->{{#if: {{{Input1Name|}}} |<!--
     --><div class="block">[[File:{{{Building}}}.png{{!}}64x64px{{!}}link={{{Building}}}]]</div><!--
   --><div class="block"><!--
     --><div class="block colon">:</div><!--
    --><div class="upper">{{#if: {{{Input1Unit|}}} | &nbsp; | {{{Input1Qty|}}}&nbsp;{{{Input1Unit|}}} }}</div><!--
      -->{{#switch: {{{Building|}}}
     -->[[File:{{{Input1Name}}}.png{{!}}{{#var: imgsz_reg}}{{!}}link={{{Input1Name}}}]]<!--
          | Flare    <!-- * Purposely omitted above. Doesn't make sense, even if the in-game UI lists it like this* -->
     -->{{#if: {{{Input1Unit|}}} | <!--
          | Smoke Stack
       --><div class="lower">{{{Input1Qty|}}}&nbsp;{{{Input1Unit|}}}</div>|<!--
          | Liquid Dump = <div class="block accepts-provides">ACCEPTS</div>
        }}<!--
    --><div class="block"><!--
       --><div class="quantity">{{{Input1Qty|}}}</div><!--
      -->[[File:{{{Input1Name}}}.png{{!}}48x48px{{!}}link={{{Input1Name}}}]]<!--
       --><div class="lower blue">{{#expr: 60/{{{Time|1}}}*{{{Input1Qty|}}} }}</div><!--
       --><div class="lower blue">{{#expr: 60/{{{Time|1}}}*{{{Input1Qty|}}} }}</div><!--
    --></div><!--
    --><div class="block time"><!--
      --><div class="upper">/&nbsp;{{{Time|}}}&nbsp;[[File:Clock.png|link=|16x16px]]</div><!--
      -->{{#if: {{{Output1Name|}}}<div>[[File:Icon arrow right.svg|30x45px]]</div>|<br/>}}<!--
      --><div class="lower blue" class="lower blue">/&nbsp;60&nbsp;[[File:Clock 60s.png|link=|16x16px]]</div><!--
    --></div><!--
    -->{{#if: {{{Output1Name|}}} |<!--
      --><div class="block"><!--
        --><div class="upper"><!--
        -->{{#if: {{{Output1Unit|}}} |<!--
          -->&nbsp;|<!--
          -->{{{Output1Qty|}}}&nbsp;{{{Output1Unit|}}}<!--
        -->}}</div><!--
        -->[[File:{{{Output1Name}}}.png{{!}}48x48px{{!}}link={{{Output1Name}}}]]<!--
        -->{{#if: {{{Output1Unit|}}} | <!--
          --><div class="lower">{{{Output1Qty|}}}&nbsp;{{{Output1Unit|}}}</div>|<!--
          --><div class="lower blue">{{#expr: 60/{{{Time|1}}}*{{{Output1Qty|}}} }}</div><!--
        -->}}<!--
      --></div><!--
     -->}}<!--
     -->}}<!--
   -->}}<!--
   --></div><!--
-->}}<!--
 
  ** Draw 2nd input **


  -->{{#if: {{{Mining|}}}{{{Dumping|}}}{{{Venting|}}}{{{DumpingLiq|}}}{{{Flare|}}} ||<!-- Only executes if none of the above params are set (to any value)
-->{{#if: {{{Input2Name|}}} |<!--
   
  --><div class="block plus">+</div><!--
     -->{{#if: {{{Building|}}} |<!--
  --><div class="block"><!--
      -->{{#if: {{{HideBldg|}}} ||<!--
    --><div class="upper">{{#if: {{{Input2Unit|}}} | &nbsp; | {{{Input2Qty|}}}&nbsp;{{{Input2Unit|}}} }}</div><!--
        --><div class="block">[[File:{{{Building}}}.png{{!}}72x72px{{!}}link={{{Building}}}]]</div><!--
     -->[[File:{{{Input2Name}}}.png{{!}}{{#var: imgsz_reg}}{{!}}link={{{Input2Name}}}]]<!--
       --><div class="block colon">:</div><!--
    -->{{#if: {{{Input2Unit|}}} | <!--
      -->}}<!--
      --><div class="lower">{{{Input2Qty|}}}&nbsp;{{{Input2Unit|}}}</div>|<!--
      -->{{#switch: {{{Building|}}}
       --><div class="lower blue">{{#expr: 60/{{{Time|1}}}*{{{Input2Qty|}}} }}</div><!--
          | Groundwater Pump
          | Air Separator
          | Seawater Pump
          | Oil Pump = <div class="block accepts-provides">PROVIDES</div>
        }}<!--
     -->}}<!--
     -->}}<!--
  --></div><!--
-->}}<!--
  ** Draw 3rd input **


    -->{{#if: {{{Input1Name|}}} |<!--
-->{{#if: {{{Input3Name|}}} |<!--
      --><div class="block"><!--
  --><div class="block plus">+</div><!--
        --><div class="upper"><!--
  --><div class="block"><!--
        -->{{#if: {{{Input1Unit|}}} |<!--
    --><div class="upper">{{#if: {{{Input3Unit|}}} | &nbsp; | {{{Input3Qty|}}}&nbsp;{{{Input3Unit|}}} }}</div><!--
          -->&nbsp;|<!--
    -->[[File:{{{Input3Name}}}.png{{!}}{{#var: imgsz_reg}}{{!}}link={{{Input3Name}}}]]<!--
          -->{{{Input1Qty|}}}&nbsp;{{{Input1Unit|}}}<!--
    -->{{#if: {{{Input3Unit|}}} | <!--
        -->}}</div><!--
      --><div class="lower">{{{Input3Qty|}}}&nbsp;{{{Input3Unit|}}}</div>|<!--
        -->[[File:{{{Input1Name}}}.png{{!}}48x48px{{!}}link={{{Input1Name}}}]]<!--
      --><div class="lower blue">{{#expr: 60/{{{Time|1}}}*{{{Input3Qty|}}} }}</div><!--
        -->{{#if: {{{Input1Unit|}}} | <!--
          --><div class="lower">{{{Input1Qty|}}}&nbsp;{{{Input1Unit|}}}</div>|<!--
          --><div class="lower blue">{{#expr: 60/{{{Time|1}}}*{{{Input1Qty|}}} }}</div><!--
        -->}}<!--
      --></div><!--
     -->}}<!--
     -->}}<!--
    -->{{#if: {{{Input2Name|}}} |<!--
  --></div><!--
      --><div class="block plus">+</div><!--
-->}}<!--
      --><div class="block"><!--
 
        --><div class="upper"><!--
  ** Draw 4th input **
        -->{{#if: {{{Input2Unit|}}} |<!--
 
          -->&nbsp;|<!--
-->{{#if: {{{Input4Name|}}} |<!--
          -->{{{Input2Qty|}}}&nbsp;{{{Input2Unit|}}}<!--
  --><div class="block plus">+</div><!--
        -->}}</div><!--
  --><div class="block"><!--
        -->[[File:{{{Input2Name}}}.png{{!}}48x48px{{!}}link={{{Input2Name}}}]]<!--
    --><div class="upper">{{#if: {{{Input4Unit|}}} | &nbsp; | {{{Input4Qty|}}}&nbsp;{{{Input4Unit|}}} }}</div><!--
        -->{{#if: {{{Input2Unit|}}} | <!--
    -->[[File:{{{Input4Name}}}.png{{!}}{{#var: imgsz_reg}}{{!}}link={{{Input4Name}}}]]<!--
          --><div class="lower">{{{Input2Qty|}}}&nbsp;{{{Input2Unit|}}}</div>|<!--
    -->{{#if: {{{Input4Unit|}}} | <!--
          --><div class="lower blue">{{#expr: 60/{{{Time|1}}}*{{{Input2Qty|}}} }}</div><!--
      --><div class="lower">{{{Input4Qty|}}}&nbsp;{{{Input4Unit|}}}</div>|<!--
        -->}}<!--
      --><div class="lower blue">{{#expr: 60/{{{Time|1}}}*{{{Input4Qty|}}} }}</div><!--
      --></div><!--
     -->}}<!--
     -->}}<!--
    -->{{#if: {{{Input3Name|}}} |<!--
  --></div><!--
      --><div class="block plus">+</div><!--
-->}}<!--
      --><div class="block"><!--
 
        --><div class="upper"><!--
  ** Draw 5th input **
        -->{{#if: {{{Input3Unit|}}} |<!--
 
          -->&nbsp;|<!--
-->{{#if: {{{Input5Name|}}} |<!--
          -->{{{Input3Qty|}}}&nbsp;{{{Input3Unit|}}}<!--
  --><div class="block plus">+</div><!--
        -->}}</div><!--
  --><div class="block"><!--
        -->[[File:{{{Input3Name}}}.png{{!}}48x48px{{!}}link={{{Input3Name}}}]]<!--
    --><div class="upper">{{#if: {{{Input5Unit|}}} | &nbsp; | {{{Input5Qty|}}}&nbsp;{{{Input5Unit|}}} }}</div><!--
        -->{{#if: {{{Input3Unit|}}} | <!--
    -->[[File:{{{Input5Name}}}.png{{!}}{{#var: imgsz_reg}}{{!}}link={{{Input5Name}}}]]<!--
          --><div class="lower">{{{Input3Qty|}}}&nbsp;{{{Input3Unit|}}}</div>|<!--
    -->{{#if: {{{Input5Unit|}}} | <!--
          --><div class="lower blue">{{#expr: 60/{{{Time|1}}}*{{{Input3Qty|}}} }}</div><!--
      --><div class="lower">{{{Input5Qty|}}}&nbsp;{{{Input5Unit|}}}</div>|<!--
        -->}}<!--
      --><div class="lower blue">{{#expr: 60/{{{Time|1}}}*{{{Input5Qty|}}} }}</div><!--
      --></div><!--
     -->}}<!--
     -->}}<!--
    -->{{#if: {{{Input4Name|}}} |<!--
  --></div><!--
      --><div class="block plus">+</div><!--
-->}}<!--
      --><div class="block"><!--
 
        -->{{#if: {{{Input4Unit|}}} || <div class="quantity">{{{Input4Qty|}}}&nbsp;{{{Input4Unit|}}}</div> }}<!--
  ** Draw 6th input **
        -->[[File:{{{Input4Name}}}.png{{!}}48x48px{{!}}link={{{Input4Name}}}]]<!--
 
        -->{{#if: {{{Input4Unit|}}} | <!--
-->{{#if: {{{Input6Name|}}} |<!--
          --><div class="quantity">{{{Input41Qty|}}}&nbsp;{{{Input4Unit|}}}</div>|<!--
  --><div class="block plus">+</div><!--
          --><div class="lower blue">{{#expr: 60/{{{Time|1}}}*{{{Input4Qty|}}} }}</div><!--
  --><div class="block"><!--
        -->}}<!--
    --><div class="upper">{{#if: {{{Input6Unit|}}} | &nbsp; | {{{Input6Qty|}}}&nbsp;{{{Input6Unit|}}} }}</div><!--
      --></div><!--
    -->[[File:{{{Input6Name}}}.png{{!}}{{#var: imgsz_reg}}{{!}}link={{{Input6Name}}}]]<!--
    -->{{#if: {{{Input6Unit|}}} | <!--
      --><div class="lower">{{{Input6Qty|}}}&nbsp;{{{Input6Unit|}}}</div>|<!--
      --><div class="lower blue">{{#expr: 60/{{{Time|1}}}*{{{Input6Qty|}}} }}</div><!--
     -->}}<!--
     -->}}<!--
    -->{{#if: {{{Input5Name|}}} |<!--
  --></div><!--
      --><div class="block plus">+</div><!--
-->}}<!--
      --><div class="block"><!--
 
        --><div class="upper"><!--
  ** Draw the recipe times unless it has a unit defined (electricity). **
        -->{{#if: {{{Input5Unit|}}} |<!--
  ** Draw the arrow unless (accepts OR provides is set) AND output1 is empty (e.g., venting non-polluting gasses) **
          -->&nbsp;|<!--
 
          -->{{{Input5Qty|}}}&nbsp;{{{Input5Unit|}}}<!--
-->{{#if: {{{Time|}}} |<!--
        -->}}</div><!--
  --><div class="block time"><!--
        -->[[File:{{{Input5Name}}}.png{{!}}48x48px{{!}}link={{{Input5Name}}}]]<!--
    -->{{#ifeq: {{lc:{{{Time}}}}} | instant || <!--
        -->{{#if: {{{Input5Unit|}}} | <!--
      --><div class="upper">/&nbsp;{{{Time}}}&nbsp;[[File:Clock.png|link=|16x16px]]</div><!--
          --><div class="lower">{{{Input5Qty|}}}&nbsp;{{{Input5Unit|}}}</div>|<!--
          --><div class="lower blue">{{#expr: 60/{{{Time|1}}}*{{{Input5Qty|}}} }}</div><!--
        -->}}<!--
      --></div><!--
     -->}}<!--
     -->}}<!--
     -->{{#if: {{{Input6Name|}}} |<!--
 
      --><div class="block plus">+</div><!--
     --><div><!--
       --><div class="block"><!--
       -->{{#if: {{{Output1Name|}}} |<!--
        --><div class="upper"><!--
        -->{{#var: img_arrow}} |<!--
        -->{{#if: {{{Input6Unit|}}} |<!--
         -->{{#ifeq: {{#var: accepts}} | yes | <br/>}}{{#ifeq: {{#var: provides}} | yes | <br/>}}<!--
          -->&nbsp;|<!--
      -->}}<!--
          -->{{{Input6Qty|}}}&nbsp;{{{Input6Unit|}}}<!--
    --></div><!--
         -->}}</div><!--
 
        -->[[File:{{{Input6Name}}}.png{{!}}48x48px{{!}}link={{{Input6Name}}}]]<!--
    -->{{#ifeq: {{lc:{{{Time}}}}} | instant || <!--
        -->{{#if: {{{Input6Unit|}}} | <!--
      --><div class="lower blue">/&nbsp;60&nbsp;[[File:Clock 60s.png|link=|16x16px]]</div><!--
          --><div class="lower">{{{Input6Qty|}}}&nbsp;{{{Input6Unit|}}}</div>|<!--
          --><div class="lower blue">{{#expr: 60/{{{Time|1}}}*{{{Input6Qty|}}} }}</div><!--
        -->}}<!--
      --></div><!--
     -->}}<!--
     -->}}<!--
  --></div><!--
-->}}<!--


    -->{{#if: {{{Time|}}} |<!--
  ** Draw 1st output **
      --><div class="block time"><!--
 
        -->{{#ifeq: {{lc:{{{Time}}}}} | instant || <!--
-->{{#if: {{{Output1Name|}}} |<!--
          --><div class="upper">/&nbsp;{{{Time}}}&nbsp;[[File:Clock.png|link=|16x16px]]</div><!--
  --><div class="block"><!--
        -->}}<!--
    --><div class="upper">{{#if: {{{Output1Unit|}}} | &nbsp; | {{{Output1Qty|}}}&nbsp;{{{Output1Unit|}}} }}</div><!--
        --><div>[[File:Icon arrow right.svg|30x45px]]</div><!--
    -->[[File:{{{Output1Name}}}.png{{!}}{{#var: imgsz_reg}}{{!}}link={{{Output1Name}}}]]<!--
        -->{{#ifeq: {{lc:{{{Time}}}}} | instant || <!--
    -->{{#if: {{{Output1Unit|}}} | <!--
          --><div class="lower blue">/&nbsp;60&nbsp;[[File:Clock 60s.png|link=|16x16px]]</div><!--
      --><div class="lower">{{{Output1Qty|}}}&nbsp;{{{Output1Unit|}}}</div>|<!--
        -->}}<!--
      --><div class="lower blue">{{#expr: 60/{{{Time|1}}}*{{{Output1Qty|}}} }}</div><!--
      --></div><!--
     -->}}<!--
     -->}}<!--
  --></div><!--
-->}}<!--


    -->{{#if: {{{Output1Name|}}} |<!--
  ** Draw 2nd output **
      --><div class="block"><!--
 
        --><div class="upper"><!--
-->{{#if: {{{Output2Name|}}} |<!--
        -->{{#if: {{{Output1Unit|}}} |<!--
  --><div class="block plus">+</div><!--
          -->&nbsp;|<!--
  --><div class="block"><!--
          -->{{{Output1Qty|}}}&nbsp;{{{Output1Unit|}}}<!--
    --><div class="upper">{{#if: {{{Output2Unit|}}} | &nbsp; | {{{Output2Qty|}}}&nbsp;{{{Output2Unit|}}} }}</div><!--
        -->}}</div><!--
    -->[[File:{{{Output2Name}}}.png{{!}}{{#var: imgsz_reg}}{{!}}link={{{Output2Name}}}]]<!--
        -->[[File:{{{Output1Name}}}.png{{!}}48x48px{{!}}link={{{Output1Name}}}]]<!--
    -->{{#if: {{{Output2Unit|}}} | <!--
        -->{{#if: {{{Output1Unit|}}} | <!--
      --><div class="lower">{{{Output2Qty|}}}&nbsp;{{{Output2Unit|}}}</div>|<!--
          --><div class="lower">{{{Output1Qty|}}}&nbsp;{{{Output1Unit|}}}</div>|<!--
      --><div class="lower blue">{{#expr: 60/{{{Time|1}}}*{{{Output2Qty|}}} }}</div><!--
          --><div class="lower blue">{{#expr: 60/{{{Time|1}}}*{{{Output1Qty|}}} }}</div><!--
        -->}}<!--
      --></div><!--
     -->}}<!--
     -->}}<!--
    -->{{#if: {{{Output2Name|}}} |<!--
  --></div><!--
      --><div class="block plus">+</div><!--
-->}}<!--
      --><div class="block"><!--
 
        --><div class="upper"><!--
 
        -->{{#if: {{{Output2Unit|}}} |<!--
  ** Draw 3rd output **
          -->&nbsp;|<!--
 
          -->{{{Output2Qty|}}}&nbsp;{{{Output2Unit|}}}<!--
-->{{#if: {{{Output3Name|}}} |<!--
        -->}}</div><!--
  --><div class="block plus">+</div><!--
        -->[[File:{{{Output2Name}}}.png{{!}}48x48px{{!}}link={{{Output2Name}}}]]<!--
  --><div class="block"><!--
        -->{{#if: {{{Output2Unit|}}} | <!--
    --><div class="upper">{{#if: {{{Output3Unit|}}} | &nbsp; | {{{Output3Qty|}}}&nbsp;{{{Output3Unit|}}} }}</div><!--
          --><div class="lower">{{{Output2Qty|}}}&nbsp;{{{Output2Unit|}}}</div>|<!--
    -->[[File:{{{Output3Name}}}.png{{!}}{{#var: imgsz_reg}}{{!}}link={{{Output3Name}}}]]<!--
          --><div class="lower blue">{{#expr: 60/{{{Time|1}}}*{{{Output2Qty|}}} }}</div><!--
    -->{{#if: {{{Output3Unit|}}} | <!--
        -->}}<!--
      --><div class="lower">{{{Output3Qty|}}}&nbsp;{{{Output3Unit|}}}</div>|<!--
      --></div><!--
      --><div class="lower blue">{{#expr: 60/{{{Time|1}}}*{{{Output3Qty|}}} }}</div><!--
     -->}}<!--
     -->}}<!--
    -->{{#if: {{{Output3Name|}}} |<!--
  --></div><!--
      --><div class="block plus">+</div><!--
-->}}<!--
      --><div class="block"><!--
 
        --><div class="upper"><!--
  ** Draw 4th output **
        -->{{#if: {{{Output3Unit|}}} |<!--
 
          -->&nbsp;|<!--
-->{{#if: {{{Output4Name|}}} |<!--
          -->{{{Output3Qty|}}}&nbsp;{{{Output3Unit|}}}<!--
  --><div class="block plus">+</div><!--
        -->}}</div><!--
  --><div class="block"><!--
        -->[[File:{{{Output3Name}}}.png{{!}}48x48px{{!}}link={{{Output3Name}}}]]<!--
    --><div class="upper">{{#if: {{{Output4Unit|}}} | &nbsp; | {{{Output4Qty|}}}&nbsp;{{{Output4Unit|}}} }}</div><!--
        -->{{#if: {{{Output3Unit|}}} | <!--
    -->[[File:{{{Output4Name}}}.png{{!}}{{#var: imgsz_reg}}{{!}}link={{{Output4Name}}}]]<!--
          --><div class="lower">{{{Output3Qty|}}}&nbsp;{{{Output3Unit|}}}</div>|<!--
    -->{{#if: {{{Output4Unit|}}} | <!--
          --><div class="lower blue">{{#expr: 60/{{{Time|1}}}*{{{Output3Qty|}}} }}</div><!--
      --><div class="lower">{{{Output4Qty|}}}&nbsp;{{{Output4Unit|}}}</div>|<!--
        -->}}<!--
      --><div class="lower blue">{{#expr: 60/{{{Time|1}}}*{{{Output4Qty|}}} }}</div><!--
      --></div><!--
     -->}}<!--
     -->}}<!--
    -->{{#if: {{{Output4Name|}}} |<!--
  --></div><!--
      --><div class="block plus">+</div><!--
-->}}<!--
      --><div class="block"><!--
 
        --><div class="upper"><!--
  ** Draw 5th output **
        -->{{#if: {{{Output4Unit|}}} |<!--
 
          -->&nbsp;|<!--
-->{{#if: {{{Output5Name|}}} |<!--
          -->{{{Output4Qty|}}}&nbsp;{{{Output4Unit|}}}<!--
  --><div class="block plus">+</div><!--
        -->}}</div><!--
  --><div class="block"><!--
        -->[[File:{{{Output4Name}}}.png{{!}}48x48px{{!}}link={{{Output4Name}}}]]<!--
    --><div class="upper">{{#if: {{{Output5Unit|}}} | &nbsp; | {{{Output5Qty|}}}&nbsp;{{{Output5Unit|}}} }}</div><!--
        -->{{#if: {{{Output4Unit|}}} | <!--
    -->[[File:{{{Output5Name}}}.png{{!}}{{#var: imgsz_reg}}{{!}}link={{{Output5Name}}}]]<!--
          --><div class="lower">{{{Output4Qty|}}}&nbsp;{{{Output4Unit|}}}</div>|<!--
    -->{{#if: {{{Output5Unit|}}} | <!--
          --><div class="lower blue">{{#expr: 60/{{{Time|1}}}*{{{Output4Qty|}}} }}</div><!--
      --><div class="lower">{{{Output5Qty|}}}&nbsp;{{{Output5Unit|}}}</div>|<!--
        -->}}<!--
      --><div class="lower blue">{{#expr: 60/{{{Time|1}}}*{{{Output5Qty|}}} }}</div><!--
      --></div><!--
     -->}}<!--
     -->}}<!--
    -->{{#if: {{{Output5Name|}}} |<!--
  --></div><!--
      --><div class="block plus">+</div><!--
-->}}<!--
      --><div class="block"><!--
 
        --><div class="upper"><!--
  ** Draw 6th output **
        -->{{#if: {{{Output5Unit|}}} |<!--
 
          -->&nbsp;|<!--
-->{{#if: {{{Output6Name|}}} |<!--
          -->{{{Output5Qty|}}}&nbsp;{{{Output5Unit|}}}<!--
  --><div class="block plus">+</div><!--
        -->}}</div><!--
  --><div class="block"><!--
        -->[[File:{{{Output5Name}}}.png{{!}}48x48px{{!}}link={{{Output5Name}}}]]<!--
    --><div class="upper">{{#if: {{{Output6Unit|}}} | &nbsp; | {{{Output6Qty|}}}&nbsp;{{{Output6Unit|}}} }}</div><!--
        -->{{#if: {{{Output5Unit|}}} | <!--
    -->[[File:{{{Output6Name}}}.png{{!}}{{#var: imgsz_reg}}{{!}}link={{{Output6Name}}}]]<!--
          --><div class="lower">{{{Output5Qty|}}}&nbsp;{{{Output5Unit|}}}</div>|<!--
    -->{{#if: {{{Output6Unit|}}} | <!--
          --><div class="lower blue">{{#expr: 60/{{{Time|1}}}*{{{Output5Qty|}}} }}</div><!--
      --><div class="lower">{{{Output6Qty|}}}&nbsp;{{{Output6Unit|}}}</div>|<!--
        -->}}<!--
      --><div class="lower blue">{{#expr: 60/{{{Time|1}}}*{{{Output6Qty|}}} }}</div><!--
      --></div><!--
    -->}}<!--
    -->{{#if: {{{Output6Name|}}} |<!--
      --><div class="block plus">+</div><!--
      --><div class="block"><!--
        --><div class="upper"><!--
        -->{{#if: {{{Output6Unit|}}} |<!--
          -->&nbsp;|<!--
          -->{{{Output6Qty|}}}&nbsp;{{{Output6Unit|}}}<!--
        -->}}</div><!--
        -->[[File:{{{Output6Name}}}.png{{!}}48x48px{{!}}link={{{Output6Name}}}]]<!--
        -->{{#if: {{{Output6Unit|}}} | <!--
          --><div class="lower">{{{Output6Qty|}}}&nbsp;{{{Output6Unit|}}}</div>|<!--
          --><div class="lower blue">{{#expr: 60/{{{Time|1}}}*{{{Output6Qty|}}} }}</div><!--
        -->}}<!--
      --></div><!--
     -->}}<!--
     -->}}<!--
  --></div><!--
-->}}<!--
  ** Debug code. Remove once completed. **
-->{{#if: {{{Venting|}}}{{{DumpingLiq|}}}{{{Flare|}}} | [[Category:Clean me up Scotty]]}}<!--
-->}}<!-- End of building check
-->}}<!-- End of Mining/Dumping check


  -->}}<!--
--></div></includeonly><!--
--></div></includeonly><!--
--><noinclude>{{documentation}}</noinclude>
--><noinclude>{{documentation}}</noinclude>

Revision as of 12:34, 17 January 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
  }}
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.)