Template:Recipes: Difference between revisions

From Official Barotrauma Wiki
Jump to: navigation, search
(test not like)
(added exclusion parameters (e.g. to exclude "abyss" when trying to match "diving suit" only, etc))
Line 19: Line 19:


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
-->{{#switch:{{{1}}}|fabricator=Items.fabricatormaterials NOT LIKE "%{{{material|{{PAGENAME}}}}}%"<!-- if {{{1}}} = fabricator, list fab recipes for PAGENAME/material
-->{{#switch:{{{1}}}|fabricator=Items.fabricatormaterials LIKE "%{{{material|{{PAGENAME}}}}}%" {{#if:{{{exclude|}}}|AND NOT LIKE "%{{{exclude}}}%" {{#if:{{{exclude2|}}}|AND NOT LIKE "%{{{exclude2}}}%"|}}|}}<!-- if {{{1}}} = fabricator, list fab recipes for PAGENAME/material
-->|medicalfabricator=Items.medicalfabricator {{=}} "1" AND Items.fabricatormaterials LIKE "%{{{material|{{PAGENAME}}}}}%"<!-- if {{{1}}} = medicalfabricator, list medfab recipes for PAGENAME/material
-->|medicalfabricator=Items.medicalfabricator {{=}} "1" AND Items.fabricatormaterials LIKE "%{{{material|{{PAGENAME}}}}}%" {{#if:{{{exclude|}}}|AND NOT LIKE "%{{{exclude}}}%" {{#if:{{{exclude2|}}}|AND NOT LIKE "%{{{exclude2}}}%"|}}|}}<!-- if {{{1}}} = medicalfabricator, list medfab recipes for PAGENAME/material
-->|deconstructor=Items.fabricator {{=}} "0" AND Items.deconstructormaterials LIKE "%{{{material|{{PAGENAME}}}}}%"<!-- if {{{1}}} = deconstructor, list non-craftable decons recipes for PAGENAME/material
-->|deconstructor=Items.fabricator {{=}} "0" AND Items.deconstructormaterials LIKE "%{{{material|{{PAGENAME}}}}}%" {{#if:{{{exclude|}}}|AND NOT LIKE "%{{{exclude}}}%" {{#if:{{{exclude2|}}}|AND NOT LIKE "%{{{exclude2}}}%"|}}|}}<!-- if {{{1}}} = deconstructor, list non-craftable decons recipes for PAGENAME/material
-->|#default= }}<!--    ######### TODO: exclude medfab items from decons table... #########
-->|#default= }}<!--    ######### TODO: exclude medfab items from decons table... #########
-->}}
-->}}

Revision as of 18:58, 18 November 2021

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.
  • Shows fabricator recipes for all items if "everything=yes" is defined.
medicalfabricator displays the list of items that can be fabricated in the medical fabricator with the current item.
  • Shows medical fabricator recipes for all items if "everything=yes" is defined.
deconstructor displays the list of items that can be deconstructed into the current item, but can't be crafted using the current item.
  • Shows deconstructor recipes for all items if "everything=yes" is defined.
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
Diving Suit
Titanium-Aluminum Alloy (x2)
Rubber
Mechanical 60
  45

Abyss Diving Suit
30 Titanium-Aluminum Alloy (x3)
Rubber
Diving Suit
Ballistic Fiber
Titanium-Aluminum Alloy
Rubber
Mechanical 60
  45

Combat Diving Suit
30 Ballistic Fiber
Titanium-Aluminum Alloy x2
Rubber x2
Combat Diving Suit
Lead
Physicorium Bar
Electrical 60
Talent: Ph.D in Nuclear Physics
80

PUCS
45 Titanium-Aluminum Alloy (x2)
Rubber
Lead
Physicorium Bar
Combat Diving Suit
Rubber
Mechanical 20
Talent: Boarding Party
45

Slipsuit
30 Ballistic Fiber
Titanium-Aluminum Alloy (x2)
Rubber (x2)


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

Deconstructor Items
Item Deconstruction Time Deconstruction Yield

Deadeye Carbine
10 Steel Bar
Plastic

Machine Pistol
10 Steel Bar
Plastic

Prototype Steam Cannon
10 Steel Bar
Plastic


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

Deconstructor Items
Item Deconstruction Time Deconstruction Yield

Boom Stick
10 Steel Bar
Titanium-Aluminum Alloy

Grenade Launcher
10 Steel Bar
Titanium-Aluminum Alloy


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

Deconstructor Items
Item Deconstruction Time Deconstruction Yield
Error 1064: You have an error in your SQL syntax; check the manual that corresponds to your MariaDB server version for the right syntax to use near 'LIKE "%Alloy%" ORDER BY `cargo__Items`.`_pageID`,`cargo__Items`.`name`,`carg...' at line 1

Function: CargoSQLQuery::run Query: SELECT `cargo__Items`.`_pageID` AS `cargo_backlink_page_id_Items`,`cargo__Items`.`name` AS `name`,`cargo__Items`.`icon` AS `icon`,`cargo__Items`.`fabricatormaterials` AS `fabricatormaterials`,`cargo__Items`.`fabricatortime` AS `fabricatortime`,`cargo__Items`.`fabricatorskill` AS `fabricatorskill`,`cargo__Items`.`fabricatorskill2` AS `fabricatorskill2`,`cargo__Items`.`fabricatorskilllevel` AS `fabricatorskilllevel`,`cargo__Items`.`fabricatorskilllevel2` AS `fabricatorskilllevel2`,`cargo__Items`.`fabricatormaterialsalt` AS `fabricatormaterialsalt`,`cargo__Items`.`fabricatortimealt` AS `fabricatortimealt`,`cargo__Items`.`fabricatorskilllevelalt` AS `fabricatorskilllevelalt`,`cargo__Items`.`deconstructormaterials` AS `deconstructormaterials`,`cargo__Items`.`deconstructortime` AS `deconstructortime`,`cargo__Items`.`talent` AS `talent`,`cargo__Items`.`fabricator` AS `fabricator`,`cargo__Items`.`deconstructor` AS `deconstructor`,`cargo__Items`.`medicalfabricator` AS `medicalfabricator` FROM `cargo__Items` WHERE `cargo__Items`.`fabricator` = "0" AND `cargo__Items`.`deconstructormaterials` LIKE "%Titanium%" AND NOT LIKE "%Alloy%" ORDER BY `cargo__Items`.`_pageID`,`cargo__Items`.`name`,`cargo__Items`.`icon`,`cargo__Items`.`fabricatormaterials`,`cargo__Items`.`fabricatortime` LIMIT 100


{{Recipes|deconstructor|material=Sodium|allowfab=1|width=40}}
gives:

Deconstructor Items
Item Deconstruction Time Deconstruction Yield

40mm Mini Nuke
5 Iron
Sodium
Saline (x2)
Alien Blood (x2)
Stabilozine
Medical 31
  25

Blood Pack
20 Sodium
Stabilozine
Chloral Hydrate
Sodium (x3)
  60
Cyanide
20 Chloral Hydrate
Sodium (x2)