Difference between revisions of "Template:Recipe define"
From Captain of Industry Wiki
Thadius856 (talk | contribs) (add ability to have units on inputs/outputs (currently only for electricity and mechanical power applications), add the ability for param time to be "instant" (same use cases)) |
Thadius856 (talk | contribs) (Measured in game... item icons are 48x48px at 120% scale (default). Rolling with that for best re-creation of official UI) |
||
Line 10: | Line 10: | ||
-->{{#if: {{{Mining|}}} |<!-- Only executes if the `Mining` param is set (to any value) | -->{{#if: {{{Mining|}}} |<!-- Only executes if the `Mining` param is set (to any value) | ||
--><div class="block">[[File:Mining.png{{!}} | --><div class="block">[[File:Mining.png{{!}}48x48px{{!}}link=Mining]]</div><!-- | ||
--><div class="block">[[File:Icon arrow right.svg|30x45px]]</div><!-- | --><div class="block">[[File:Icon arrow right.svg|30x45px]]</div><!-- | ||
--><div class="block">[[File:{{{Output1Name}}}.png{{!}} | --><div class="block">[[File:{{{Output1Name}}}.png{{!}}48x48px{{!}}link={{{Output1Name}}}]]</div><!-- | ||
-->}}<!-- | -->}}<!-- | ||
-->{{#if: {{{Dumping|}}} |<!-- Only executes if the `Dumping` param is set (to any value) | -->{{#if: {{{Dumping|}}} |<!-- Only executes if the `Dumping` param is set (to any value) | ||
--><div class="block">[[File:{{{Input1Name}}}.png{{!}} | --><div class="block">[[File:{{{Input1Name}}}.png{{!}}48x48px{{!}}link={{{Input1Name}}}]]</div><!-- | ||
--><div class="block">[[File:Icon arrow right.svg|30x45px]]</div><!-- | --><div class="block">[[File:Icon arrow right.svg|30x45px]]</div><!-- | ||
--><div class="block">[[File:Dumping.png{{!}} | --><div class="block">[[File:Dumping.png{{!}}48x48px{{!}}link=Dumping]]</div><!-- | ||
-->}}<!-- | -->}}<!-- | ||
-->{{#if: {{{Venting|}}}{{{DumpingLiq|}}} |<!-- Only executes if the `Venting` or `DumpingLiq` param is set (to any value) | -->{{#if: {{{Venting|}}}{{{DumpingLiq|}}} |<!-- Only executes if the `Venting` or `DumpingLiq` param is set (to any value) | ||
--><div class="block">[[File:{{{Building}}}.png{{!}} | --><div class="block">[[File:{{{Building}}}.png{{!}}48x48px{{!}}link={{{Building}}}]]</div><!-- | ||
--><div class="block colon">:</div><!-- | --><div class="block colon">:</div><!-- | ||
-->{{#switch: {{{Building|}}} | -->{{#switch: {{{Building|}}} | ||
Line 29: | Line 29: | ||
| Liquid Dump = <div class="block accepts-provides">ACCEPTS</div> | | Liquid Dump = <div class="block accepts-provides">ACCEPTS</div> | ||
}}<!-- | }}<!-- | ||
--><div class="block">[[File:{{{Input1Name}}}.png{{!}} | --><div class="block">[[File:{{{Input1Name}}}.png{{!}}48x48px{{!}}link={{{Input1Name}}}]]<!-- | ||
--><div class="quantity">{{{Input1Qty}}}</div><!-- | --><div class="quantity">{{{Input1Qty}}}</div><!-- | ||
--></div><!-- | --></div><!-- | ||
Line 40: | Line 40: | ||
-->{{#if: {{{Building|}}} |<!-- | -->{{#if: {{{Building|}}} |<!-- | ||
--><div class="block">[[File:{{{Building}}}.png{{!}} | --><div class="block">[[File:{{{Building}}}.png{{!}}48x48px{{!}}link={{{Building}}}]]</div><!-- | ||
--><div class="block colon">:</div><!-- | --><div class="block colon">:</div><!-- | ||
-->{{#switch: {{{Building|}}} | -->{{#switch: {{{Building|}}} | ||
Line 51: | Line 51: | ||
-->{{#if: {{{Input1Name|}}} |<!-- | -->{{#if: {{{Input1Name|}}} |<!-- | ||
--><div class="block">[[File:{{{Input1Name}}}.png{{!}} | --><div class="block">[[File:{{{Input1Name}}}.png{{!}}48x48px{{!}}link={{{Input1Name}}}]]<!-- | ||
--><div class="quantity">{{{Input1Qty}}} {{{Input1Unit|}}}</div><!-- | --><div class="quantity">{{{Input1Qty}}} {{{Input1Unit|}}}</div><!-- | ||
--></div><!-- | --></div><!-- | ||
Line 57: | Line 57: | ||
-->{{#if: {{{Input2Name|}}} |<!-- | -->{{#if: {{{Input2Name|}}} |<!-- | ||
--><div class="block plus">+</div><!-- | --><div class="block plus">+</div><!-- | ||
--><div class="block">[[File:{{{Input2Name}}}.png{{!}} | --><div class="block">[[File:{{{Input2Name}}}.png{{!}}48x48px{{!}}link={{{Input2Name}}}]]<!-- | ||
--><div class="quantity">{{{Input2Qty}}} {{{Input2Unit|}}}</div><!-- | --><div class="quantity">{{{Input2Qty}}} {{{Input2Unit|}}}</div><!-- | ||
--></div><!-- | --></div><!-- | ||
Line 63: | Line 63: | ||
-->{{#if: {{{Input3Name|}}} |<!-- | -->{{#if: {{{Input3Name|}}} |<!-- | ||
--><div class="block plus">+</div><!-- | --><div class="block plus">+</div><!-- | ||
--><div class="block">[[File:{{{Input3Name}}}.png{{!}} | --><div class="block">[[File:{{{Input3Name}}}.png{{!}}48x48px{{!}}link={{{Input3Name}}}]]<!-- | ||
--><div class="quantity">{{{Input3Qty}}} {{{Input3Unit|}}}</div><!-- | --><div class="quantity">{{{Input3Qty}}} {{{Input3Unit|}}}</div><!-- | ||
--></div><!-- | --></div><!-- | ||
Line 69: | Line 69: | ||
-->{{#if: {{{Input4Name|}}} |<!-- | -->{{#if: {{{Input4Name|}}} |<!-- | ||
--><div class="block plus">+</div><!-- | --><div class="block plus">+</div><!-- | ||
--><div class="block">[[File:{{{Input4Name}}}.png{{!}} | --><div class="block">[[File:{{{Input4Name}}}.png{{!}}48x48px{{!}}link={{{Input4Name}}}]]<!-- | ||
--><div class="quantity">{{{Input4Qty}}} {{{Input4Unit|}}}</div><!-- | --><div class="quantity">{{{Input4Qty}}} {{{Input4Unit|}}}</div><!-- | ||
--></div><!-- | --></div><!-- | ||
Line 75: | Line 75: | ||
-->{{#if: {{{Input5Name|}}} |<!-- | -->{{#if: {{{Input5Name|}}} |<!-- | ||
--><div class="block plus">+</div><!-- | --><div class="block plus">+</div><!-- | ||
--><div class="block">[[File:{{{Input5Name}}}.png{{!}} | --><div class="block">[[File:{{{Input5Name}}}.png{{!}}48x48px{{!}}link={{{Input5Name}}}]]<!-- | ||
--><div class="quantity">{{{Input5Qty}}} {{{Input5Unit|}}}</div><!-- | --><div class="quantity">{{{Input5Qty}}} {{{Input5Unit|}}}</div><!-- | ||
--></div><!-- | --></div><!-- | ||
Line 81: | Line 81: | ||
-->{{#if: {{{Input6Name|}}} |<!-- | -->{{#if: {{{Input6Name|}}} |<!-- | ||
--><div class="block plus">+</div><!-- | --><div class="block plus">+</div><!-- | ||
--><div class="block">[[File:{{{Input6Name}}}.png{{!}} | --><div class="block">[[File:{{{Input6Name}}}.png{{!}}48x48px{{!}}link={{{Input6Name}}}]]<!-- | ||
--><div class="quantity">{{{Input6Qty}}} {{{Input6Unit|}}}</div><!-- | --><div class="quantity">{{{Input6Qty}}} {{{Input6Unit|}}}</div><!-- | ||
--></div><!-- | --></div><!-- | ||
Line 96: | Line 96: | ||
-->{{#if: {{{Output1Name|}}} |<!-- | -->{{#if: {{{Output1Name|}}} |<!-- | ||
--><div class="block">[[File:{{{Output1Name}}}.png{{!}}link={{{Output1Name}}}{{!}} | --><div class="block">[[File:{{{Output1Name}}}.png{{!}}link={{{Output1Name}}}{{!}}48x48px]]<!-- | ||
--><div class="quantity">{{{Output1Qty|}}} {{{Output1Unit|}}}</div><!-- | --><div class="quantity">{{{Output1Qty|}}} {{{Output1Unit|}}}</div><!-- | ||
--></div><!-- | --></div><!-- | ||
Line 102: | Line 102: | ||
-->{{#if: {{{Output2Name|}}} |<!-- | -->{{#if: {{{Output2Name|}}} |<!-- | ||
--><div class="block plus">+</div><!-- | --><div class="block plus">+</div><!-- | ||
--><div class="block">[[File:{{{Output2Name}}}.png{{!}}link={{{Output2Name}}}{{!}} | --><div class="block">[[File:{{{Output2Name}}}.png{{!}}link={{{Output2Name}}}{{!}}48x48px]]<!-- | ||
--><div class="quantity">{{{Output2Qty|}}} {{{Output2Unit|}}}</div><!-- | --><div class="quantity">{{{Output2Qty|}}} {{{Output2Unit|}}}</div><!-- | ||
--></div><!-- | --></div><!-- | ||
Line 108: | Line 108: | ||
-->{{#if: {{{Output3Name|}}} |<!-- | -->{{#if: {{{Output3Name|}}} |<!-- | ||
--><div class="block plus">+</div><!-- | --><div class="block plus">+</div><!-- | ||
--><div class="block">[[File:{{{Output3Name}}}.png{{!}}link={{{Output3Name}}}{{!}} | --><div class="block">[[File:{{{Output3Name}}}.png{{!}}link={{{Output3Name}}}{{!}}48x48px]]<!-- | ||
--><div class="quantity">{{{Output3Qty|}}} {{{Output3Unit|}}}</div><!-- | --><div class="quantity">{{{Output3Qty|}}} {{{Output3Unit|}}}</div><!-- | ||
--></div><!-- | --></div><!-- | ||
Line 114: | Line 114: | ||
-->{{#if: {{{Output4Name|}}} |<!-- | -->{{#if: {{{Output4Name|}}} |<!-- | ||
--><div class="block plus">+</div><!-- | --><div class="block plus">+</div><!-- | ||
--><div class="block">[[File:{{{Output4Name}}}.png{{!}}link={{{Output4Name}}}{{!}} | --><div class="block">[[File:{{{Output4Name}}}.png{{!}}link={{{Output4Name}}}{{!}}48x48px]]<!-- | ||
--><div class="quantity">{{{Output4Qty|}}} {{{Output4Unit|}}}</div><!-- | --><div class="quantity">{{{Output4Qty|}}} {{{Output4Unit|}}}</div><!-- | ||
--></div><!-- | --></div><!-- | ||
Line 120: | Line 120: | ||
-->{{#if: {{{Output5Name|}}} |<!-- | -->{{#if: {{{Output5Name|}}} |<!-- | ||
--><div class="block plus">+</div><!-- | --><div class="block plus">+</div><!-- | ||
--><div class="block">[[File:{{{Output5Name}}}.png{{!}}link={{{Output5Name}}}{{!}} | --><div class="block">[[File:{{{Output5Name}}}.png{{!}}link={{{Output5Name}}}{{!}}48x48px]]<!-- | ||
--><div class="quantity">{{{Output5Qty|}}} {{{Output5Unit|}}}</div><!-- | --><div class="quantity">{{{Output5Qty|}}} {{{Output5Unit|}}}</div><!-- | ||
--></div><!-- | --></div><!-- | ||
Line 126: | Line 126: | ||
-->{{#if: {{{Output6Name|}}} |<!-- | -->{{#if: {{{Output6Name|}}} |<!-- | ||
--><div class="block plus">+</div><!-- | --><div class="block plus">+</div><!-- | ||
--><div class="block">[[File:{{{Output6Name}}}.png{{!}}link={{{Output6Name}}}{{!}} | --><div class="block">[[File:{{{Output6Name}}}.png{{!}}link={{{Output6Name}}}{{!}}48x48px]]<!-- | ||
--><div class="quantity">{{{Output6Qty|}}} {{{Output6Unit|}}}</div><!-- | --><div class="quantity">{{{Output6Qty|}}} {{{Output6Unit|}}}</div><!-- | ||
--></div><!-- | --></div><!-- |
Revision as of 16:45, 16 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.
- Template: Recipe define: Defines a recipe. The defined recipe can be called by Template: Recipe fetch from any page in this wiki. Usually, recipes are defined on the page of a building. This template only defines recipes but does not display anything.
- Template: Recipe draw: Only displays a written recipe. The recipe written with this template cannot be called by Template: Recipe fetch.
- 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 }} |
|
- Example usage for dumping loose materials
Markup | Renders as |
---|---|
{{Recipe | Output1Name = Dumping | Input1Name = 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 }} |
|
- Example for buildings that "provide" materials (Groundwater Pump, Air Separator, etc.)
Markup | Renders as |
---|---|
{{Recipe | Building = Groundwater Pump | Time = 10 | Output1Name = Water | Output1Qty = 8 }} |
|
- Example usage for dumping/flaring/venting non-polluting liquids/gasses
Markup | Renders as |
---|---|
{{Recipe | Building = Smoke Stack | Input1Name = Oxygen | Input1Qty = 200 | Time = 20 }} |
|
- 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 }} |
|
{{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 }} |
|
- 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 }} |
|
- 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 }} |
|
- Example usage for recipes with variable quantity
Markup | Renders as |
---|---|
{{Recipe | Building = Waste Collection | Time = 60 | Output1Name = Waste | Output1Unit = ? }} |
|
- 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 }} |
|
- Example usage for unreleased recipe
Markup | Renders as |
---|---|
{{Recipe | Building = Crusher | Input1Name = Gravel | Input1Qty = 18 | Time = 20 | Output1Name = Gold | Output1Qty = 14 | Unreleased = yes }} |
|
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.)
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.)