Difference between revisions of "Template:Recipes"

From Official Barotrauma Wiki
Jump to: navigation, search
(so yeah, I forgot to hook up to the medical items table. Maybe not such a good idea to have a separate infobox/cargo table, after all.)
(it's actually way more complicated than it should be with two tables)
Line 14: Line 14:
  
 
if everything is defined, then list all things
 
if everything is defined, then list all things
-->{{#switch: {{{1}}}|medicalfabricator=Items.medicalfabricator {{=}} "1"<!-- if {{{1}}} = medicalfabricator, list all medfab recipes
+
-->{{#switch: {{{1}}}|medicalfabricator=Items.medicalfabricator {{=}} "1" OR Medical_Items.medicalfabricator {{=}} "1"<!-- if {{{1}}} = medicalfabricator, list all medfab recipes
 
-->|fabricator=Items.fabricator {{=}} "1"<!-- if {{{1}}} = fabricator, list all fab recipes
 
-->|fabricator=Items.fabricator {{=}} "1"<!-- if {{{1}}} = fabricator, list all fab recipes
-->|deconstructor=Items.deconstructor {{=}} "1" AND Items.fabricator {{=}} "0"<!-- if {{{1}}} = deconstructor, list all non-craftable decons recipes
+
-->|deconstructor=Items.deconstructor {{=}} "1" OR Medical_Items.deconstructor {{=}} "1" AND Items.fabricator {{=}} "0" OR Medical_Items.medicalfabricator {{=}} "0"<!-- if {{{1}}} = deconstructor, list all non-craftable decons recipes
-->|#default= }}|<!--  
+
-->|#default=error in switch 1 }}|<!--  
  
 
if everything is NOT defined, list things about {{{material}}} (or PAGENAME by default) only
 
if everything is NOT defined, list things about {{{material}}} (or PAGENAME by default) only
Line 28: Line 28:
 
if {{{1}}} = deconstructor, list non-craftable decons recipes for PAGENAME/material
 
if {{{1}}} = deconstructor, list non-craftable decons recipes for PAGENAME/material
 
-->|deconstructor=Items.fabricator {{=}} "0" AND Items.medicalfabricator {{=}} "0" AND Medical_Items.medicalfabricator {{=}} "0" AND Items.deconstructormaterials LIKE "%{{{material|{{PAGENAME}}}}}%" {{#if:{{{exclude|}}}|AND Items.deconstructormaterials NOT LIKE "%{{{exclude}}}%" {{#if:{{{exclude2|}}}|AND Items.deconstructormaterials NOT LIKE "%{{{exclude2}}}%"|}}|}}<!--  
 
-->|deconstructor=Items.fabricator {{=}} "0" AND Items.medicalfabricator {{=}} "0" AND Medical_Items.medicalfabricator {{=}} "0" AND Items.deconstructormaterials LIKE "%{{{material|{{PAGENAME}}}}}%" {{#if:{{{exclude|}}}|AND Items.deconstructormaterials NOT LIKE "%{{{exclude}}}%" {{#if:{{{exclude2|}}}|AND Items.deconstructormaterials NOT LIKE "%{{{exclude2}}}%"|}}|}}<!--  
-->|#default= }}<!--    ######### TODO: exclude medfab items from decons table... #########
+
-->|#default=error in switch 2 }}<!--    ######### TODO: exclude medfab items from decons table... #########
 
-->}}
 
-->}}
 
| format = template
 
| format = template

Revision as of 14:19, 23 November 2021

Template-info.png Documentation

This template is used to display a list of items, and their crafting requirements / deconstruction yields.

Syntax

{{ Recipes | fabricator OR medicalfabricator OR deconstructor | width = <customwidth> (default 70) | everything = yes | material = <Custom Material> | exclude = <Term to exclude>}}

everything If this is set to yes (or any non-null value), then all the items are displayed. This is meant to be used on the main fabricator/deconstructor pages for example. For individual pages, this parameter shouldn't be specified.
fabricator displays the list of items that can be fabricated in the standard fabricator with the current item (or all items if "everything=yes" is set).
medicalfabricator displays the list of items that can be fabricated in the medical fabricator with the current item (or all items if "everything=yes" is set).
deconstructor displays the list of items that can deconstructed into the current item (or all items if "everything=yes" is set), AND that cannot be crafted (since those recipes are listed in the previous tables already).
material sets a custom material to be listed. If omitted, it will default to the page name. Note that all items which have this term in their name will be listed, so the "exclude" parameter may be necessary as well.
exclude excludes a string from the query. This is useful in case the current item's name is also contained in another item's name, such as "Diving Suit" is contained in "Combat Diving Suit".
exclude2 same as above, useful if one exclusion isn't enough.

Examples

In the following examples, "material" is always specified because it would otherwise default to the page name. On an item's page, it can be omitted.

{{Recipes|fabricator|material=Diving Suit}}
gives:

Fabricator Items
Crafting Materials Crafting Talent, Skill, Time Item Deconstruction Time Deconstruction Yield
50px
[[]]
Cannot be deconstructed
50px
[[]]
Cannot be deconstructed
50px
[[]]
Cannot be deconstructed


{{Recipes|deconstructor|material=Plastic|width=40}}
gives:

Deconstructor Items
Item Deconstruction Time Deconstruction Yield 
Cargo didn't find any items that are crafted with this item in the database.
  • Either such an item exists in the game, in which case it doesn't have a wiki page yet, you can create it, and it will then show up here (it may take a few minutes);
  • Or it has a page but its fabricatoritems aren't properly set;
  • Or such an item doesn't exist in the game, in which case you can remove this table from this page.
    For reference: Crafting Materials - Medical Items - Medical Fabricator - Fabricator & Deconstructor


{{Recipes|deconstructor|material=Titanium|width=40}}
gives:

Deconstructor Items
Item Deconstruction Time Deconstruction Yield 
Cargo didn't find any items that are crafted with this item in the database.
  • Either such an item exists in the game, in which case it doesn't have a wiki page yet, you can create it, and it will then show up here (it may take a few minutes);
  • Or it has a page but its fabricatoritems aren't properly set;
  • Or such an item doesn't exist in the game, in which case you can remove this table from this page.
    For reference: Crafting Materials - Medical Items - Medical Fabricator - Fabricator & Deconstructor


{{Recipes|deconstructor|material=Titanium|exclude=Alloy|width=40}}
gives:

Deconstructor Items
Item Deconstruction Time Deconstruction Yield 
Cargo didn't find any items that are crafted with this item in the database.
  • Either such an item exists in the game, in which case it doesn't have a wiki page yet, you can create it, and it will then show up here (it may take a few minutes);
  • Or it has a page but its fabricatoritems aren't properly set;
  • Or such an item doesn't exist in the game, in which case you can remove this table from this page.
    For reference: Crafting Materials - Medical Items - Medical Fabricator - Fabricator & Deconstructor