Template:Grid/Crafting/doc: Difference between revisions

From Vintage Story Wiki
(Added explanatory table.)
 
(8 intermediate revisions by 2 users not shown)
Line 4: Line 4:


<pre>{{Grid/Crafting
<pre>{{Grid/Crafting
|A1=c1r1 |A1N=num |A1_name
|A1=c1r1 |A1N=num |A1-link=link |A1_name
|A2=c1r2 |A2N=num |A2_name
|A2=c1r2 |A2N=num |A2-link=link |A2_name
|A3=c1r3 |A3N=num |A3_name
|A3=c1r3 |A3N=num |A3-link=link |A3_name
|B1=c2r1 |B1N=num |B1_name
|B1=c2r1 |B1N=num |B1-link=link |B1_name
|B2=c2r2 |B2N=num |B2_name
|B2=c2r2 |B2N=num |B2-link=link |B2_name
|B3=c2r3 |B3N=num |B3_name
|B3=c2r3 |B3N=num |B3-link=link |B3_name
|C1=c3r1 |C1N=num |C1_name
|C1=c3r1 |C1N=num |C1-link=link |C1_name
|C2=c4r2 |C2N=num |C2_name
|C2=c4r2 |C2N=num |C2-link=link |C2_name
|C3=c3r3 |C3N=num |C3_name
|C3=c3r3 |C3N=num |C3-link=link |C3_name
|Output=out |OA=num |Output_name
|Output=out |OA=num |Output-link=link |Output_name=name
|NoBreak=y
|NoBreak=y
}}</pre>
}}</pre>
Line 25: Line 25:
| Cell number (e.g. A1N) || Optional || The number of items that need to be placed in this cell.
| Cell number (e.g. A1N) || Optional || The number of items that need to be placed in this cell.
|-
|-
| Cell name (e.g. A1_name) || Optional || The name of the item in the cell, if it differs from the filename.
| Cell link (e.g. A1-link) || Optional || Link to the wiki page of the item. May be preceded by ''Special:MyLanguage/'' to link to that wiki page in your preferd language.
|-
| Cell name (e.g. A1_name) || Optional || The name of the item in the cell, if it differs from the image name. It will be displayed in the tooltip of the item's icon.
|-
|-
| Output || Required || The item that is created by this recipe.
| Output || Required || The item that is created by this recipe.
|-
|-
| OA || Optional || The number of items created by the recipe.
| OA || Optional || The number of items created by the recipe.
|-
| Output link (e.g. Output-link) || Optional || Link to the wiki page of the item. May be preceded by ''Special:MyLanguage/'' to link to that wiki page in your prefered language.
|-
|-
| Output_name || Optional || The name of the item created by the recipe.
| Output_name || Optional || The name of the item created by the recipe.
Line 39: Line 43:
|}
|}


* '''Cell positions''':
== Example ==
 
Displays the icon for each item.


== Example ==
{{Grid/Crafting
{{Grid/Crafting
|B2=CopperPickHead|B3=Stick|
|B2=CopperPickHead
|B2_name=Copper Pickheads|B3_name=Sticks
|B3=Stick
|B2N=10|B3N=10
|Output=CopperPick
|Output=CopperPick|Output_name=Copper Pickaxes|OA=10
|NoBreak=y
|float=left
}}
{{-}}
 
 
'''Code:'''
<pre>{{Grid/Crafting
|B2=CopperPickHead
|B3=Stick
|Output=CopperPick
|NoBreak=y
|NoBreak=y
|float=left}}
|float=left
}}</pre>
 
== Example with quantities ==
 
Displays the icon and the quantity for each item.
 
{{Grid/Crafting
|B2=CopperPickHead|B2N=4
|B3=Stick|B3N=5
|Output=CopperPick|OA=10
}}
{{-}}
'''Code:'''
<pre>{{Grid/Crafting
|B2=CopperPickHead|B2N=4
|B3=Stick|B3N=5
|Output=CopperPick|OA=10
}}</pre>
 
== Example with tooltips ==
 
If you leave your cursor over one of the icons, the correct name of the item will appear in its tooltip instead of the filename of its image.
 
{{Grid/Crafting
|B2=CopperPickHead|B2N=4|B2_name=Pickaxe head
|B3=Stick|B3N=5|B3_name=Stick
|Output=CopperPick|OA=10|Output_name=Pickaxe
}}
{{-}}
'''Code:'''
<pre>{{Grid/Crafting
|B2=CopperPickHead|B2N=4|B2_name=Pickaxe head
|B3=Stick|B3N=5|B3_name=Stick
|Output=CopperPick|OA=10|Output_name=Pickaxe
}}</pre>
 
== Example with links ==
 
If you click on one of the icons, you will go to the related wiki page (in your prefered language) of that item.
 
If you still arrive on the English version of the related page, it means that this page has not been translated yet into your language.
 
{{Grid/Crafting
|B2=CopperPickHead|B2N=4|B2-link=Special:MyLanguage/Casting|B2_name=Pickaxe head
|B3=Stick|B3N=5|B3-link=Special:MyLanguage/Stick|B3_name=Stick
|Output=CopperPick|OA=10|Output-link=Special:MyLanguage/Pickaxe|Output_name=Pickaxe
}}
{{-}}
'''Code:'''
<pre>{{Grid/Crafting
|B2=CopperPickHead|B2N=4|B2-link=Special:MyLanguage/Casting|B2_name=Pickaxe head
|B3=Stick|B3N=5|B3-link=Special:MyLanguage/Stick|B3_name=Stick
|Output=CopperPick|OA=10|Output-link=Special:MyLanguage/Pickaxe|Output_name=Pickaxe
}}</pre>
 
== Example prepared for an easy translation ==
 
The translator will not see any code. He will only see 3 sentences to translate:
*Pickaxe head
*Stick
*Pickaxe
 
{| class="wikitable"
|-
|
<font style="font-family: Consolas,monospace;">'''<nowiki></translate></nowiki>'''<br>
<nowiki>{{Grid/Crafting</nowiki><br>
<nowiki>|B2=CopperPickHead|B2N=4|B2-link=Special:MyLanguage/Casting|B2_name=</nowiki>'''<nowiki><translate></nowiki>'''Pickaxe head'''<nowiki></translate></nowiki>'''<br>
<nowiki>|B3=Stick|B3N=5|B3-link=Special:MyLanguage/Stick|B3_name=</nowiki>'''<nowiki><translate></nowiki>'''Stick'''<nowiki></translate></nowiki>'''<br>
<nowiki>|Output=CopperPick|OA=10|Output-link=Special:MyLanguage/Pickaxe|Output_name=</nowiki>'''<nowiki><translate></nowiki>'''Pickaxe'''<nowiki></translate></nowiki>'''<br>
'''<nowiki><translate></nowiki>'''<br></font>
|}


<noinclude>[[Category:Template documentation|{{PAGENAME}}]]
<noinclude>[[Category:Template documentation|{{PAGENAME}}]]</noinclude>
[[Category:Grid templates]]</noinclude>

Latest revision as of 09:46, 1 August 2023

This template allows editors to visually represent crafting grid recipes. Currently due to the way it's hardcoded it requires highly specific image filenames to work - this is under review and may change in the future.

Usage

{{Grid/Crafting
|A1=c1r1 |A1N=num |A1-link=link |A1_name
|A2=c1r2 |A2N=num |A2-link=link |A2_name
|A3=c1r3 |A3N=num |A3-link=link |A3_name
|B1=c2r1 |B1N=num |B1-link=link |B1_name
|B2=c2r2 |B2N=num |B2-link=link |B2_name
|B3=c2r3 |B3N=num |B3-link=link |B3_name
|C1=c3r1 |C1N=num |C1-link=link |C1_name
|C2=c4r2 |C2N=num |C2-link=link |C2_name
|C3=c3r3 |C3N=num |C3-link=link |C3_name
|Output=out |OA=num |Output-link=link |Output_name=name
|NoBreak=y
}}
Variable Optional? Description
Cell positions (e.g. A1) Required The columns are labelled A, B and C; the rows are 1, 2 and 3. Therefore, cell "A1" is the top left corner, "B2" is the middle cell, and so on. At least one cell must be filled. It takes only image filenames in a specific format.
Cell number (e.g. A1N) Optional The number of items that need to be placed in this cell.
Cell link (e.g. A1-link) Optional Link to the wiki page of the item. May be preceded by Special:MyLanguage/ to link to that wiki page in your preferd language.
Cell name (e.g. A1_name) Optional The name of the item in the cell, if it differs from the image name. It will be displayed in the tooltip of the item's icon.
Output Required The item that is created by this recipe.
OA Optional The number of items created by the recipe.
Output link (e.g. Output-link) Optional Link to the wiki page of the item. May be preceded by Special:MyLanguage/ to link to that wiki page in your prefered language.
Output_name Optional The name of the item created by the recipe.
NoBreak Optional Boolean (takes only y or n). Creates a line break after the block if set to "yes".
float Optional Sets the float style for the crafting grid.

Example

Displays the icon for each item.



CopperPickHead

Stick


CopperPick








Code:

{{Grid/Crafting
|B2=CopperPickHead
|B3=Stick
|Output=CopperPick
|NoBreak=y
|float=left
}}

Example with quantities

Displays the icon and the quantity for each item.



CopperPickHead

Stick


CopperPick

CopperPick

CopperPick



CopperPickHead

CopperPickHead

Stick

Stick




Code:

{{Grid/Crafting
|B2=CopperPickHead|B2N=4
|B3=Stick|B3N=5
|Output=CopperPick|OA=10
}}

Example with tooltips

If you leave your cursor over one of the icons, the correct name of the item will appear in its tooltip instead of the filename of its image.



CopperPickHead

Stick


CopperPick

CopperPick

CopperPick



CopperPickHead

CopperPickHead

Stick

Stick




Code:

{{Grid/Crafting
|B2=CopperPickHead|B2N=4|B2_name=Pickaxe head
|B3=Stick|B3N=5|B3_name=Stick
|Output=CopperPick|OA=10|Output_name=Pickaxe
}}

Example with links

If you click on one of the icons, you will go to the related wiki page (in your prefered language) of that item.

If you still arrive on the English version of the related page, it means that this page has not been translated yet into your language.



CopperPickHead

Stick


CopperPick

CopperPick

CopperPick



CopperPickHead

CopperPickHead

Stick

Stick




Code:

{{Grid/Crafting
|B2=CopperPickHead|B2N=4|B2-link=Special:MyLanguage/Casting|B2_name=Pickaxe head
|B3=Stick|B3N=5|B3-link=Special:MyLanguage/Stick|B3_name=Stick
|Output=CopperPick|OA=10|Output-link=Special:MyLanguage/Pickaxe|Output_name=Pickaxe
}}

Example prepared for an easy translation

The translator will not see any code. He will only see 3 sentences to translate:

  • Pickaxe head
  • Stick
  • Pickaxe

</translate>
{{Grid/Crafting
|B2=CopperPickHead|B2N=4|B2-link=Special:MyLanguage/Casting|B2_name=<translate>Pickaxe head</translate>
|B3=Stick|B3N=5|B3-link=Special:MyLanguage/Stick|B3_name=<translate>Stick</translate>
|Output=CopperPick|OA=10|Output-link=Special:MyLanguage/Pickaxe|Output_name=<translate>Pickaxe</translate>
<translate>