Difference between revisions of "Template:Required Resources"

From RimWorld Wiki
Jump to navigation Jump to search
(Fixing the spacing issue.)
Line 1: Line 1:
<includeonly>{{#if: {{Q|{{{1|{{PAGENAME}}}}}|Resource 1}} | {{#ifeq: {{Q|{{{1|{{PAGENAME}}}}}|Resource 1}} | Stuff | {{Icon|buildingmat}} | {{Icon Small|{{Q|{{{1|{{PAGENAME}}}}}|Resource 1}}|16}}}} {{Q|{{{1|{{PAGENAME}}}}}|Resource 1 Amount}} {{#if: {{{simple|}}}||[[{{Q|{{{1|{{PAGENAME}}}}}|Resource 1}}]]}}{{#ifeq: {{Q|{{{1|{{PAGENAME}}}}}|Resource 1}} | Stuff |<nowiki> </nowiki>({{#if: {{#pos:{{lc:{{Q|{{{1|{{PAGENAME}}}}}|Stuff Tags}}}}|leathery}} |[[Leather]]{{#vardefine:notfirst|1}}}}{{#if: {{#pos:{{lc:{{Q|{{{1|{{PAGENAME}}}}}|Stuff Tags}}}}|fabric}}  |{{#if:{{#var:notfirst}}|/|}}[[Fabric]]{{#vardefine:notfirst|1}}}}{{#if: {{#pos:{{lc:{{Q|{{{1|{{PAGENAME}}}}}|Stuff Tags}}}}|woody}}    |{{#if:{{#var:notfirst}}|/|}}[[Wood]]{{#vardefine:notfirst|1}}}}{{#if: {{#pos:{{lc:{{Q|{{{1|{{PAGENAME}}}}}|Stuff Tags}}}}|metallic}} |{{#if:{{#var:notfirst}}|/|}}[[Metals]]{{#vardefine:notfirst|1}}}}{{#if: {{#pos:{{lc:{{Q|{{{1|{{PAGENAME}}}}}|Stuff Tags}}}}|stony}}    |{{#if:{{#var:notfirst}}|/|}}[[Stone]]}})}}{{#if:
+
<includeonly>{{#vardefine:notfirst|0}}{{#if: {{Q|{{{1|{{PAGENAME}}}}}|Resource 1}} | {{#ifeq: {{Q|{{{1|{{PAGENAME}}}}}|Resource 1}} | Stuff | {{Icon|buildingmat}} | {{Icon Small|{{Q|{{{1|{{PAGENAME}}}}}|Resource 1}}|16}}}} {{Q|{{{1|{{PAGENAME}}}}}|Resource 1 Amount}} {{#if: {{{simple|}}}||[[{{Q|{{{1|{{PAGENAME}}}}}|Resource 1}}]]}}{{#ifeq: {{Q|{{{1|{{PAGENAME}}}}}|Resource 1}} | Stuff |<nowiki> </nowiki>({{#if: {{#pos:{{lc:{{Q|{{{1|{{PAGENAME}}}}}|Stuff Tags}}}}|leathery}} |[[Leather]]{{#vardefine:notfirst|1}}}}{{#if: {{#pos:{{lc:{{Q|{{{1|{{PAGENAME}}}}}|Stuff Tags}}}}|fabric}}  |{{#if:{{#var:notfirst}}|/|}}[[Fabric]]{{#vardefine:notfirst|1}}}}{{#if: {{#pos:{{lc:{{Q|{{{1|{{PAGENAME}}}}}|Stuff Tags}}}}|woody}}    |{{#if:{{#var:notfirst}}|/|}}[[Wood]]{{#vardefine:notfirst|1}}}}{{#if: {{#pos:{{lc:{{Q|{{{1|{{PAGENAME}}}}}|Stuff Tags}}}}|metallic}} |{{#if:{{#var:notfirst}}|/|}}[[Metals]]{{#vardefine:notfirst|1}}}}{{#if: {{#pos:{{lc:{{Q|{{{1|{{PAGENAME}}}}}|Stuff Tags}}}}|stony}}    |{{#if:{{#var:notfirst}}|/|}}[[Stone]]}})}}{{#if:
 
{{Q|{{{1|{{PAGENAME}}}}}|Resource 2}} |{{{sep|, }}} {{Icon Small|{{Q|{{{1|{{PAGENAME}}}}}|Resource 2}}|16}} {{Q|{{{1|{{PAGENAME}}}}}|Resource 2 Amount}} {{#if: {{{simple|}}}||[[{{Q|{{{1|{{PAGENAME}}}}}|Resource 2}}]]}} }}{{#if:
 
{{Q|{{{1|{{PAGENAME}}}}}|Resource 2}} |{{{sep|, }}} {{Icon Small|{{Q|{{{1|{{PAGENAME}}}}}|Resource 2}}|16}} {{Q|{{{1|{{PAGENAME}}}}}|Resource 2 Amount}} {{#if: {{{simple|}}}||[[{{Q|{{{1|{{PAGENAME}}}}}|Resource 2}}]]}} }}{{#if:
 
{{Q|{{{1|{{PAGENAME}}}}}|Resource 3}} |{{{sep|, }}} {{Icon Small|{{Q|{{{1|{{PAGENAME}}}}}|Resource 3}}|16}} {{Q|{{{1|{{PAGENAME}}}}}|Resource 3 Amount}} {{#if: {{{simple|}}}||[[{{Q|{{{1|{{PAGENAME}}}}}|Resource 3}}]]}} }}{{#if:
 
{{Q|{{{1|{{PAGENAME}}}}}|Resource 3}} |{{{sep|, }}} {{Icon Small|{{Q|{{{1|{{PAGENAME}}}}}|Resource 3}}|16}} {{Q|{{{1|{{PAGENAME}}}}}|Resource 3 Amount}} {{#if: {{{simple|}}}||[[{{Q|{{{1|{{PAGENAME}}}}}|Resource 3}}]]}} }}{{#if:

Revision as of 11:54, 6 January 2022

Documentation icon Template documentation[view] [edit] [history] [purge]

Returns a list of the resources required to make an item.

Parameters

First parameter is the item whose required resources are to be returned (optional, default = PAGENAME).

Second parameter is a multiplier (optional, default = 1).

sep is the seperator parameter (optional, default = ",").

simple removes the name of the time and only leaves the icon (set to any text or value, usually "1").

Examples

{{Required Resources|Plate armor}}

Building Material (steel, wood, plasteel, etc.) 170 Stuff (/Wood/Metals)


{{Required Resources|Plate armor|3}}

Building Material (steel, wood, plasteel, etc.) 170 Stuff (/Wood/Metals)


{{Required Resources|Phoenix armor}}

Plasteel 150 Plasteel, Uranium 50 Uranium, Advanced component 6 Advanced component, Steel 75 Steel, Component 4 Component, Chemfuel 40 Chemfuel


{{Required Resources|Phoenix armor|sep=&nbsp;+}}

Plasteel 150 Plasteel + Uranium 50 Uranium + Advanced component 6 Advanced component + Steel 75 Steel + Component 4 Component + Chemfuel 40 Chemfuel


{{Required Resources|Phoenix armor|sep=&nbsp;+|simple=1}}

Plasteel 150  + Uranium 50 + Advanced component 6 + Steel 75 + Component 4 + Chemfuel 40


{{Required Resources|Phoenix armor|sep=&nbsp;+|simple=1|2}}

Plasteel 150  + Uranium 50 + Advanced component 6 + Steel 75 + Component 4 + Chemfuel 40