Difference between revisions of "Template:Variants"
From Captain of Industry Wiki
(Supported specifying separator) |
m (Update in-code list of variants) |
||
(9 intermediate revisions by 2 users not shown) | |||
Line 1: | Line 1: | ||
<includeonly><!-- | <includeonly><!-- | ||
-->{{#ifeq: {{{2|auto}}} | auto |<!-- | |||
** Defines separator ** | |||
-->{{#vardefine: sep | <!-- | |||
-->{{{sep|•}}}<!-- | |||
-->{{#ifexpr: {{#count: ,.;: | {{{sep|x}}} }} |   }}<!-- | |||
-->}}<!-- | |||
** Lists buildings automatically when {{{2}}} is omitted or "auto." ** | |||
-->{{#ifeq: {{{2|auto}}} | auto | <!-- | |||
-->{{#switch: {{{1|}}} | -->{{#switch: {{{1|}}} | ||
| Assembly = {{Variants | |||
| Boiler = {{Variants | <!-- | ||
| Cargo Depot = {{Variants | Buildings named irregularly | ||
| | --> | ||
| Distillation = {{Variants | | Assembly = {{Variants lite|{{{1}}}|(Manual)|(Electric)|(Electric) II|(Robotic)|(Robotic) II|sep={{#var: sep}}|skipunmarked=yes }} | ||
| Evaporation Pond = {{Variants | | Boiler = {{Variants lite|{{{1}}}|(Coal)|(Gas)|(Electric)|sep={{#var: sep}}|skipunmarked=yes }} | ||
| Fluid Module= {{Variants | | Captain's Office = {{Variants lite|{{{1}}}|I|II|sep={{#var: sep}}|skipunmarked=yes }} | ||
| Loose Module= {{Variants | | Cargo Depot = {{Variants lite|{{{1}}}|(2)|(4)|(6)|(8)|sep={{#var: sep}}|skipunmarked=yes }} | ||
| Rotary Kiln = {{Variants | | Cooling Tower = {{Variants lite|{{{1}}}|(Large)|sep={{#var: sep}}|skipunmarked={{{skipunmarked|}}} }} | ||
| Seawater Pump = {{Variants | | Crusher = {{Variants lite|{{{1}}}|(Large)|sep={{#var: sep}}|skipunmarked={{{skipunmarked|}}} }} | ||
| Smoke Stack = {{Variants | | Distillation = {{Variants lite|{{{1}}}|(Stage I)|(Stage II)|(Stage III)|sep={{#var: sep}}|skipunmarked=yes }} | ||
| Solar Panel = {{Variants | | Evaporation Pond = {{Variants lite|{{{1}}}|(Heated)|sep={{#var: sep}}|skipunmarked={{{skipunmarked|}}} }} | ||
| Unit Module= {{Variants | | Fluid Module= {{Variants lite|{{{1}}}|(S)|(M)|(L)|sep={{#var: sep}}|skipunmarked=yes }} | ||
| Vehicle Ramp = {{Variants | | Loose Module= {{Variants lite|{{{1}}}|(S)|(M)|(L)|sep={{#var: sep}}|skipunmarked=yes }} | ||
| Power Generator = {{Variants lite|{{{1}}}|(Large)|sep={{#var: sep}}|skipunmarked={{{skipunmarked|}}} }} | |||
| Rotary Kiln = {{Variants lite|{{{1}}}|(Gas)|sep={{#var: sep}}|skipunmarked={{{skipunmarked|}}} }} | |||
| Seawater Pump = {{Variants lite|{{{1}}}|(Tall)|sep={{#var: sep}}|skipunmarked={{{skipunmarked|}}} }} | |||
| Smoke Stack = {{Variants lite|{{{1}}}|(Large)|sep={{#var: sep}}|skipunmarked={{{skipunmarked|}}} }} | |||
| Solar Panel = {{Variants lite|{{{1}}}|(Mono)|sep={{#var: sep}}|skipunmarked={{{skipunmarked|}}} }} | |||
| The Statue of Maintenance = {{Variants lite|{{{1}}}|(Golden)|sep={{#var: sep}}|skipunmarked={{{skipunmarked|}}} }} | |||
| Unit Module = {{Variants lite|{{{1}}}|(S)|(M)|(L)|sep={{#var: sep}}|skipunmarked=yes }} | |||
| Vehicle Ramp = {{Variants lite|{{{1}}}|(Small)|(Medium)|(Large)|sep={{#var: sep}}|skipunmarked=yes }} | |||
| Farm = {{Variants | | Farm = {{Variants lite|irregular=yes|Farm|Farm|Irrigated Farm|Irrigated|sep={{#var: sep}}|skipunmarked={{{skipunmarked|}}} }} | ||
| Maintenance Depot = {{Variants | | Maintenance Depot = {{Variants lite|irregular=yes|Maintenance Depot||Maintenance Depot (Basic)|Basic|Maintenance II Depot|II|Maintenance III Depot|III|sep={{#var: sep}}|skipunmarked={{{skipunmarked|}}} }} | ||
<!-- | |||
Buildings named regularly | |||
Listed for avoiding to using expensive parser function: "#ifexist" in "Template: Variants manual" | |||
--> | |||
| Arc Furnace = {{Variants lite|{{{1}}}|II|sep={{#var: sep}}|skipunmarked={{{skipunmarked|}}} }} | |||
| Blast Furnace = {{Variants lite|{{{1}}}|II|sep={{#var: sep}}|skipunmarked={{{skipunmarked|}}} }} | |||
| Chemical Plant = {{Variants lite|{{{1}}}|II|sep={{#var: sep}}|skipunmarked={{{skipunmarked|}}} }} | |||
| Concrete Mixer = {{Variants lite|{{{1}}}|II|III|sep={{#var: sep}}|skipunmarked={{{skipunmarked|}}} }} | |||
| Cooled Caster = {{Variants lite|{{{1}}}|II|sep={{#var: sep}}|skipunmarked={{{skipunmarked|}}} }} | |||
| Electrolyzer = {{Variants lite|{{{1}}}|II|sep={{#var: sep}}|skipunmarked={{{skipunmarked|}}} }} | |||
| Flat Conveyor = {{Variants lite|{{{1}}}|II|III|sep={{#var: sep}}|skipunmarked={{{skipunmarked|}}} }} | |||
| Fluid Storage = {{Variants lite|{{{1}}}|II|III|IV|sep={{#var: sep}}|skipunmarked={{{skipunmarked|}}} }} | |||
| Food Market = {{Variants lite|{{{1}}}|II|sep={{#var: sep}}|skipunmarked={{{skipunmarked|}}} }} | |||
| Fuel Station = {{Variants lite|{{{1}}}|II|III|sep={{#var: sep}}|skipunmarked={{{skipunmarked|}}} }} | |||
| Glass Maker = {{Variants lite|{{{1}}}|II|sep={{#var: sep}}|skipunmarked={{{skipunmarked|}}} }} | |||
| Greenhouse = {{Variants lite|{{{1}}}|II|sep={{#var: sep}}|skipunmarked={{{skipunmarked|}}} }} | |||
| High-Pressure Turbine = {{Variants lite|{{{1}}}|II|sep={{#var: sep}}|skipunmarked={{{skipunmarked|}}} }} | |||
| Housing = {{Variants lite|{{{1}}}|II|III|sep={{#var: sep}}|skipunmarked={{{skipunmarked|}}} }} | |||
| Loose Storage = {{Variants lite|{{{1}}}|II|III|IV|sep={{#var: sep}}|skipunmarked={{{skipunmarked|}}} }} | |||
| Low-Pressure Turbine = {{Variants lite|{{{1}}}|II|sep={{#var: sep}}|skipunmarked={{{skipunmarked|}}} }} | |||
| Metal Caster = {{Variants lite|{{{1}}}|II|sep={{#var: sep}}|skipunmarked={{{skipunmarked|}}} }} | |||
| Microchip Machine = {{Variants lite|{{{1}}}|II|sep={{#var: sep}}|skipunmarked={{{skipunmarked|}}} }} | |||
| Mixer = {{Variants lite|{{{1}}}|II|sep={{#var: sep}}|skipunmarked={{{skipunmarked|}}} }} | |||
| Nuclear Reactor = {{Variants lite|irregular=yes|Nuclear Reactor|Nuclear Reactor|Nuclear Reactor II|II|Fast Breeder Reactor|FBR|sep={{#var: sep}}|skipunmarked={{{skipunmarked|}}} }} | |||
| Oxygen Furnace = {{Variants lite|{{{1}}}|II|sep={{#var: sep}}|skipunmarked={{{skipunmarked|}}} }} | |||
| Pipe = {{Variants lite|{{{1}}}|II|III|sep={{#var: sep}}|skipunmarked={{{skipunmarked|}}} }} | |||
| Research Lab = {{Variants lite|{{{1}}}|II|III|IV|V|sep={{#var: sep}}|skipunmarked={{{skipunmarked|}}} }} | |||
| U-shape Conveyor = {{Variants lite|{{{1}}}|II|III|sep={{#var: sep}}|skipunmarked={{{skipunmarked|}}} }} | |||
| Unit Storage = {{Variants lite|{{{1}}}|II|III|IV|sep={{#var: sep}}|skipunmarked={{{skipunmarked|}}} }} | |||
| Vehicles Depot = {{Variants lite|{{{1}}}|II|III|sep={{#var: sep}}|skipunmarked={{{skipunmarked|}}} }} | |||
<!-- | |||
Unlisted buildings | |||
--> | |||
| #default = {{Variants manual|{{{1|}}}<!-- | | #default = {{Variants manual|{{{1|}}}<!-- | ||
-->|{{#ifexist: {{{1|}}} II | II }}<!-- | -->|{{#ifexist: {{{1|}}} II | II }}<!-- | ||
Line 28: | Line 80: | ||
-->|{{#ifexist: {{{1|}}} VII | VII }}<!-- | -->|{{#ifexist: {{{1|}}} VII | VII }}<!-- | ||
-->|{{#ifexist: {{{1|}}} VIII | VIII }}<!-- | -->|{{#ifexist: {{{1|}}} VIII | VIII }}<!-- | ||
-->|sep={{{ | -->|sep={{#var: sep}}<!-- | ||
-->}} | -->|skipunmarked={{{skipunmarked|}}}<!-- | ||
-->}}<!-- | |||
-->| {{Variants manual|{{{1|}}}|{{{2|}}}|{{{3|}}}|{{{4|}}}|{{{5|}}}|{{{6|}}}|{{{7|}}}|{{{8|}}}|sep={{{ | -->}}<!-- | ||
** Lists building specified manually ** | |||
-->| {{Variants manual|{{{1|}}}|{{{2|}}}|{{{3|}}}|{{{4|}}}|{{{5|}}}|{{{6|}}}|{{{7|}}}|{{{8|}}}|sep={{#var: sep}}|skipunmarked={{{skipunmarked|}}} }} <!-- | |||
-->}}<!-- | -->}}<!-- | ||
</includeonly><noinclude> | </includeonly><noinclude> | ||
{{documentation}} | {{documentation}} | ||
</noinclude> | </noinclude> |
Latest revision as of 00:40, 31 May 2023
Template documentation (for the above template, sometimes hidden or invisible) [view] [edit] [history] [refresh]
- Purpose
- This template provides a method to rapidly line variants of machines with the link
- Usage
- This template accepts the following parameters:
{{{1}}}
: Common part of the machine name for all tiers, such as "Pipe" and "Boiler."{{{2}}}
-{{{8}}}
: Remaining part of the machine's name, such as "II" and "Gas." If{{{2}}}
is omitted or "auto", all variants of the machine will be listed.{{{sep}}}
(optional, rare): Specify separator. Default: •(•){{{skipunmarked}}}
(optional, rare): If yes, the building whose name is an exact match as {{{1}}} (mostly tier 1) will not be listed. See also an example.
- This template requires the page of 1st tier of the machine in the wiki. Notably, all parameters are case-sensitive.
- Example
- Standard usage
- {{Variants|Pipe}} → Pipe [II•III]
- {{Variants|Boiler}} → Boiler (Coal) [Gas•Electric]
- {{Variants|Assembly}} → Assembly (Manual) [Electric•Electric II•Robotic•Robotic II]
- {{Variants|Farm}} → Farm [Irrigated]
- {{Variants|Maintenance Depot}} → Maintenance Depot [Basic•II•III]
- {{Variants|Captain's Office}} → Captain's Office I [II]
- Specify variants manually
- {{Variants|Research Lab|III|V}} → Research Lab [III•V]
- {{Variants|Research Lab|III|V|skipunmarked=yes}} → Research Lab III [V]
- {{Variants|Boiler|Coal|Gas}} → Boiler (Coal) [Gas]
- Specify format
- Error
- Details
-
- Bracket Completion
- The round brackets may be omitted if the entire parameter is covered by the brackets. For example, you can input "Gas" instead of "(Gas)." However, the brackets cannot be omitted if the parameter is covered partially such as "(Electric) II."
- Name of 1st tier machine
- This template searches the machine page in the wiki for choosing a format. If there is a page named
{{{1}}}
, it is considered as 1st tier of the machine. If there is a page named "{{{1}}}
{{{2}}}
" or "{{{1}}}
({{{2}}}
)", this name is considered as 1st tier of the machine. - Automatically listing variants
- If the variants are named regularly by Roman numerals, the variants whose page exists on the wiki are listed. If the variants are irregularly named, the variants to be listed are defined in the code of this template.
The above text is transcluded from Template:Variants/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:Variants/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 (edit | diff) and testcases (create) pages.
Please add categories and interwikis to Template:Variants/doc. (View all subpages of this page.)