User:PaladinAHOne/Sandbox/CGG

From Feed The Beast Wiki
Jump to: navigation, search

Crafting Grids are an important aspect of almost every article on the wiki, used to inform readers about how they can obtain the items and blocks they are reading about. This wiki has a dedicated set of templates, originally created by Jinbobo, for use in displaying these grids. It is extremely important that this template syntax is understood and used correctly by all editors. This guide page has been written for that purpose.

As a general note, remember to preview pages before you save them, until you fully understand how everything works and are comfortable with it. It allows you to make sure the page was built and displays correctly, and more importantly it allows you to make sure you did not make a mistake when calling a template (like, say, forgetting the brackets used to close it). Preview.png

Basics[edit | edit source]

All Crafting Grid templates are named and called using the following convention:

{{Cg/Crafting grid name}}

For example:

A full list of available crafting grid templates can be seen here. If a crafting grid is not available, please contact a staff member.

Each location within a crafting grid that can contain an item will have a specific cell name that corresponds to it. The cell names can vary across different grids, so it it is important to always read the templates' documentation pages. If no item is to be placed in a specific cell of a crafting grid, it does not need to be entered into the template call.

The cells are filled by using the templates {{G/Cell}} and {{G/O}}: Template:Grid/Cell and Template:Grid/Ore Dictionary. These will be explained later in this guide, but in short, their purpose is to take the name of an item, or an Ore Dictionary tag name, and display an image of it, which also displays a tooltip when the mouse is hovered over it. The choice between which to use is dependent upon how the recipe in question is defined by the mod that adds it. To find that out, it is usually necessary to look through the mod's source code for where the recipe is added. A program such as JD-GUI may be helpful for this, though many mods have their source visible in code repositories on websites such as GitHub and BitBucket.

Template:G/Cell[edit | edit source]

See also: Template:G/Cell

{{G/Cell}}, more commonly called {{Gc}}, is the standard template used to display items. It requests an item name and an abbreviated mod name, and displays an image of that item and a link to that item's page. A list of abbreviated mod names can be found here. {{Gc}} can also accept an alternate page for the image to link to (or link=none for no link), alternate text to use for the tooltip, and a stack size to display for the item it displays. The text to use for the tooltip is defined with the parameters title= and desc=. title= changes the displayed item name, and desc= adds additional lines of descriptive text to the tooltip. Both title= and desc= accept formatting codes, as defined in {{Tooltip}}. (Use / to produce a new line, & for formatting codes, and \ to end the use of a formatting code.) Related to link= is dis=, a true/false parameter (default true) that sets whether or not the image links to a mod-disambiguated page title. Do not define both dis= and link= in a single use of {{Gc}}.

Shown below are one incorrect and four correct uses of {{Gc}}:


{{Cg|Certus Quartz}} Incorrect usage with no mod= parameter defined. When previewing the page, an error message will appear.

{{Gc|Crowbar|mod=RC}} Correct usage for an item whose page link requires disambiguation (as multiple mods add a Crowbar).

{{Gc|Stone Fluid Pipe|mod=BC|dis=false}} Correct usage for an item whose page links do not require disambiguation.

4
{{Gc|Iron Ingot|4|mod=V|link=Iron}} Correct usage for an item, with a stack size of 4, which should link to a page different from its listed name.

{{Gc|Low Voltage Battery Buffer (1)|mod=GT|link=Battery Buffer|title=Low Voltage Battery Buffer|desc=&71 Slot}} Correct usage for an item whose tilesheet name is not the same as the name that should be displayed, should link to a page different from its name, and has additional tooltip text.

If a mod= parameter is not properly defined, the following error will be displayed: Multiple entries tilesheet.png

Shown below is the template call for the recipe of a Diamond Pickaxe, as it would be defined in vanilla Minecraft.

{{Cg/Crafting Table
|A1={{Gc|mod=V|dis=false|Diamond}}
|B1={{Gc|mod=V|dis=false|Diamond}}
|C1={{Gc|mod=V|dis=false|Diamond}}
|B2={{Gc|mod=V|dis=false|Stick}}
|B3={{Gc|mod=V|dis=false|Stick}}
|O={{Gc|mod=V|dis=false|Diamond Pickaxe}}
}}

This code produces:

Template:Grid/Ore Dictionary[edit | edit source]

The Ore Dictionary is a component of Minecraft Forge, designed to allow ores and ingots of the same type to be used by different mods and treated as the same. The FTB Wiki contains an Ore Dictionary extension, allowing Crafting Grid displays to do the same.

{{G/O}}, more commonly called {{O}}, is the normal way to display an object in a crafting grid, in which the crafting recipe uses the Ore Dictionary to determine recipe inputs. {{O}} is called using an Ore Dictionary tag name, rather than an item name. A full list of all currently registered Ore Dictionary tags and the items they correspond to can be found on Special:OreDictList. Ore Dictionary tags can be added on Special:ImportOreDict. Like {{Gc}}, {{O}} accepts an item stack size parameter, but unlike {{Gc}}, {{O}} does not request any other parameters. Additionally, {{O}} automatically animates itself, alternating its display among all possible items.

Shown below is an isolated use of {{O}}.

{{O|oreCopper}}

This code produces:





















Shown below is the template call for the recipe of a Diamond Pickaxe, using the Ore Dictionary.

{{Cg/Crafting Table
|A1={{O|gemDiamond}}
|B1={{O|gemDiamond}}
|C1={{O|gemDiamond}}
|B2={{O|stickWood}}
|B3={{O|stickWood}}
|O={{Gc|mod=V|dis=false|Diamond Pickaxe}}
}}

This code produces:

{{O}} should not be used for displaying crafting grid outputs, unless the mod does output an OreDictionary tag instead of a specific item. However, this is considered a bug in the mod, and should be reported to the author(s) immediately.

Tilesheets[edit | edit source]

The images displayed by {{Gc}} and {{O}} are retrieved from Tilesheets, large image files of every block and item added by a mod, and linked to by a server-side registry. A list of all tilesheets currently on the wiki can be found on Special:SheetList, and a list of all items stored in all sheets can be found on Special:TileList. If {{Gc}} is given the name of an item that does not appear in a tilesheet, or is given the wrong Mod name, {{Gc}} will display a flat red box. An example is shown below.

{{Gc|mod=AE|This Item Does Not Exist}}

Produces:


If this occurs, an Error will also appear under Tilesheet extension warnings in the page preview. No item tilesheet.png

If this occurs when editing a page, check to make sure the mod abbreviation and item name are set correctly (check the Item List to be sure), and if you are sure that the red box comes from a missing tilesheet entry, finish your editing, save the page, and report the missing entry to a wiki staff member.

In certain rare cases, the name of an item in a tilesheet will not match the name of the item in game. This is usually done deliberately by the wiki staff member who set up the tilesheet, as an individual tilesheet cannot contain two items with identical names. If this is the case, the {{Gc}} parameter title= should be used to change the tooltip to display the correct item name.

Mod abbreviations can be added and viewed on Module:Mods/list, as well as on the #FTB-Wikiconnect, using TheSatanicSanta's bot.

Shapeless crafting recipes[edit | edit source]

Shapeless crafting recipes are defined in the same way as shaped crafting recipes, but with one additional parameter and a somewhat different display. To define a crafting recipe as shapeless, add the parameter shapeless=true to the crafting grid template call. Shown below is an example of a shapeless crafting recipe.

{{Cg/Crafting Table
|A1={{O|dustCopper}}
|B1={{O|dustCopper}}
|A2={{O|dustCopper}}
|B2={{O|dustTin}}
|O={{Gc|mod=IC2|link=Bronze|Bronze Dust}}
|shapeless=true
}}

This code produces:

Multiple recipes in a single grid[edit | edit source]

Multiple crafting recipes can be defined within a single crafting grid. To do so, simply give multiple separate items to a single crafting grid slot. The grid will become paged, with each page displaying an individual recipe.

If an item is only defined once in a crafting grid slot, it will be used in that slot in all displayed recipes. To display a blank slot in a grid, define an empty {{Gc}} in that slot.

An example of a paged crafting grid is shown below.

{{Cg/Crafting Table
|A1={{Gc|mod=V|link=Iron|Iron Ingot}}
|B1={{Gc|mod=V|link=Iron|Iron Ingot}}
|C1={{Gc|mod=V|link=Iron|Iron Ingot}}{{Gc}}
|A2={{Gc|mod=V|link=Iron|Iron Ingot}}
|B2={{Gc|mod=V|dis=false|Stick}}{{Gc|mod=V|link=Iron|Iron Ingot}}
|C2={{Gc|mod=V|link=Iron|Iron Ingot}}{{Gc|mod=V|dis=false|Stick}}
|A3={{Gc|mod=V|link=Iron|Iron Ingot}}{{Gc}}
|B3={{Gc|mod=V|dis=false|Stick}}{{Gc|mod=V|link=Iron|Iron Ingot}}
|O={{Gc|mod=IC2|Forge Hammer}}{{Gc|mod=GT|Hammer}}
}}

This code produces:

Special crafting grid inputs[edit | edit source]

Tank Cells[edit | edit source]

Tank Cells are not a feature used in all crafting grids, but certain mods add machines that have internal fluid tanks, and have recipes that consume fluid from those tanks. Tank cells are never used in isolation; they are only ever used in crafting grids that would use them. Tank cells are filled using {{T}}, Template:Tank. {{T}} is called with a fluid name and an amount in mB, millibuckets.

A small number of alternate crafting grids also have areas in them that show internal energy storage and/or energy consumed by a recipe. These visual displays also use {{T}}. An example of this is shown below

{{Cg/Liquid Transposer
|I={{Gc|Bucket|mod=V}}
|O={{Gc|Water Bucket|mod=V}}
|tank={{T|Water|1000}}
|power={{T|Redstone Flux|4000}}
}}

This code produces:

Text strings[edit | edit source]

Certain crafting recipes require strings of text or numbers as inputs to their recipes. For cases like this, use {{S}}. Shown below is an example of a (rather complicated) crafting grid that requires string inputs.

{{Cg/Blast Furnace/RotaryCraft
|I1={{Gc|mod=V|Sand}}
|I2={{Gc|mod=V|dis=false|Coal}}
|I3={{Gc|mod=V|Gunpowder}}
|I4={{Gc|mod=V|Iron Ingot}}
|I5={{Gc|mod=V|Iron Ingot}}
|I6={{Gc|mod=V|Iron Ingot}}
|I7={{Gc|mod=V|Iron Ingot}}
|I8={{Gc|mod=V|Iron Ingot}}
|I9={{Gc|mod=V|Iron Ingot}}
|I10={{Gc|mod=V|Iron Ingot}}
|I11={{Gc|mod=V|Iron Ingot}}
|I12={{Gc|mod=V|Iron Ingot}}
|O2={{Gc|mod=ROC|link=none|HSLA Steel Ingot|9}}
|Temp=600
|T1={{S|Coal x1 (100.0%)}}
|T2={{S|Gunpowder x1 (3.6%)}}
|T3={{S|Sand x1 (0.2%)}}
|Bonus={{S|No}}
}}

This code produces:














9
Coal x1 (100.0%)
Gunpowder x1 (3.6%)
Sand x1 (0.2%)
600C
Bonus output: No

What not to do[edit | edit source]

While {{Gc}} and {{O}} can be used outside of crafting grids, the images they produce are sized and formatted specifically for use in crafting grids, and as such they do not fit well into the text of regular pages. Using them in an {{Infobox}} is, however, expected, and using them in tables is acceptable.

Over the years of this wiki, template conventions have changed. One very important convention to have changed is the use of {{G}}. {{G}} combined the functions of {{Gc}} and {{O}}, accepting an item name and returning a list of Ore Dictionary-equivalent items. The previous version of this guide said to use {{G}} almost everywhere. However, {{G}} has a few important flaws. First, it is significantly slower than {{Gc}} or {{O}}. Pages that use {{G}} can take twice as long to load as pages that use {{Gc}} and {{O}}. Second, {{G}} can display the wrong thing. Items can have more than one Ore Dictionary tag associated with them, and {{G}} does not have a way of differentiating which tag to look at when generating its list of items to display.

When in doubt, view the source of some pages recently created by staff members, or ask them for help.