Template:Item/doc: Difference between revisions

From Vintage Story Wiki
(floatleft docu)
(Update due to new Template:Item/Food/Category)
 
(64 intermediate revisions by 2 users not shown)
Line 1: Line 1:
<languages />
<noinclude><languages /></noinclude>
<translate>
<translate>
<!--T:1-->
<!--T:1-->
Line 7: Line 7:


<!--T:3-->
<!--T:3-->
The item infobox template should be placed at the top of the article, '''above''' the starting introductory text but below any translation tags where possible. Not every item infobox requires all the parameters - delete them as appropriate.  
The item infobox template should be placed at the top of the article, '''above''' the starting introductory text but below any translation tags where possible. Not every item infobox requires all the parameters - delete them as appropriate.


<!--T:4-->
</translate>
<pre style="width: 75%">
<pre style="width: 75%">
{{Item
{{Item
|Name= Name of the item
|Name=<translate><!--T:16--> Name of the item</translate>
|Image=Full image name with File: prefix and file extension
|Image=<translate><!--T:17--> Full image name with "File:" prefix and file extension ".png"</translate>
|Stackable=Maximum stack size, defaults to 64
|Material=<translate><!--T:18--> Material of the item</translate>
|Stackable=<translate><!--T:19--> Maximum stack size, defaults to 64</translate>


<!--T:5-->
|Temp=<translate><!--T:20--> Temperature at which the object burns as fuel</translate>
|Temp=Burning temperature
|Duration=<translate><!--T:21--> Burn duration in seconds</translate>
|Duration=Burn duration in seconds


<!--T:6-->
|SmeltTemp=<translate><!--T:22--> Smelting temp of the metal</translate>
|SmeltTemp=Smelting temp
|RequiresContainer=<translate><!--T:23--> Whether or not smelting requires a container</translate>
|SmeltDuration=Smelt duration in seconds
|OutputLink=<translate><!--T:24--> Link to the container's (e.g. a mold) wiki page in your prefered language (you do not need to write Special:MyLanguage/)</translate>
|SmeltRatio=(Unsure)
|OutputName=<translate><!--T:25--> Container name to be displayed (or its translation)</translate>
|RequiresContainer=Whether or not smelting requires a container
|OutputAmount=<translate><!--T:26--> Number of items obtained after emptying the container, defaults to 1</translate>
|Output=Smelting output


<!--T:7-->
|FreshTime=<translate><!--T:27--> Time the item stays fresh (e.g. time before you see it as 0% spoiled)</translate>
|FreshTime=Time in seconds the item stays fresh
|TransitionTime=<translate><!--T:28--> Time the item takes to turn into something else (e.g. time between 0% spoiled to 100% spoiled)</translate>
|TransitionTime=Time in seconds the item takes to turn into something else (e.g. rotten food)
|TransitionRatio=<translate><!--T:29--> Conversion ratio of fresh stacksize to transitioned stack size (e.g. 10 onions turned into 5 rot: 0.5)</translate>
|TransitionRatio=(Unsure)


<!--T:8-->
|Satiety=<translate><!--T:30--> Satiety points the item provides</translate>
|Satiety=Satiety points the item provides
|Category=<translate><!--T:31--> Satiety category of the item. One of the 7 allowed options (e.g. Protein)</translate>
|Category=Satiety category of the item


<!--T:9-->
|FloatRight=<translate><!--T:32--> Whether or not the box should float on the right side of the page (so you don't have to use a <nowiki><div></div></nowiki> tag)</translate>
|NoBreak= Whether or not the item box should end in a line break
|NoBreak=<translate><!--T:33--> Whether or not the item box should end in a line break</translate>
|FloatLeft= if this param is used, the infobox will float to the left instead of the right
}}</pre>
}}</pre>
<translate>


<!--T:10-->
<!--T:10-->
Line 46: Line 43:
=== Parameters === <!--T:11-->
=== Parameters === <!--T:11-->


</translate>
<!--T:12-->
<!--T:12-->
{| class="wikitable"
{| class="wikitable"
|-
|-
! Parameters !! Description !! Type !! Required
! <translate><!--T:34--> Parameters</translate> !! <translate><!--T:35--> Description</translate> !! <translate><!--T:36--> Type</translate> !! <translate><!--T:37--> Required</translate>
|-
|-
| Name || Name of the item || string || yes
| <translate><!--T:38--> parameter1</translate> || <translate><!--T:39--> Description of what parameter1 is</translate> || <translate><!--T:40--> string/boolean/file/number/any</translate> || <translate><!--T:41--> yes/no/suggested</translate>
|-
|-
| Image || Filename of an image || file || yes
| ''Name'' || <translate><!--T:42--> Name of the item</translate> || <translate><!--T:43--> string</translate> || <translate><!--T:44--> yes</translate>
|-
|-
| Stackable || Maximum stack size, default 64 || number || suggested
| ''Image'' || <translate><!--T:45--> Filename of an image, including "File:" prefix and ".png" suffix</translate> || <translate><!--T:46--> file</translate> || <translate><!--T:47--> yes</translate>
|-
|-
| Temp || Burning temperature || number || no
| ''Material'' || <translate><!--T:48--> Material of the item</translate> || <translate><!--T:49--> string</translate> || <translate><!--T:50--> no</translate>
|-
|-
| Duration || Burn duration in seconds || number || no
| ''Stackable'' || <translate><!--T:51--> Maximum stack size, default 64</translate> || <translate><!--T:52--> number</translate> || <translate><!--T:53--> suggested</translate>
|-
|-
| SmeltTemp || Smelting temperature || number || yes for Item/Smeltable
| ''Temp'' || <translate><!--T:54--> Burning temperature</translate> || <translate><!--T:55--> number</translate> || <translate><!--T:56--> no</translate>
|-
|-
|SmeltDuration || Smelt duration in seconds || number || yes for Item/Smeltable
| ''Duration'' || <translate><!--T:57--> Burn duration in seconds</translate> || <translate><!--T:58--> number</translate> || <translate><!--T:59--> no</translate>
|-
|-
|SmeltRatio || (Unsure) || float || unsure
| ''SmeltTemp'' || <translate><!--T:60--> Smelting temperature of the metal</translate> || <translate><!--T:61--> number</translate> || <translate><!--T:62--> yes for ''Item/Smeltable''</translate>
|-
|-
|RequiresContainer || Whether or not smelting requires a container || boolean (y/n) || no
| ''RequiresContainer'' || <translate><!--T:63--> Whether or not smelting requires a container</translate> || <translate><!--T:64--> string<br>(write anything for "yes"<br>remove this line for "no")</translate> || <translate><!--T:65--> no</translate>
|-
|-
|Output || Smelting output || string || no
| ''OutputLink'' || <translate><!--T:66--> Smelting output container page link</translate> || <translate><!--T:67--> string</translate> || <translate><!--T:68--> yes if ''RequiresContainer'' is present</translate>
|-
|-
|FreshTime || Time in seconds the item stays fresh || number || yes for Item/Transitionable
| ''OutputName'' || <translate><!--T:69--> Smelting output container name</translate> || <translate><!--T:70--> string</translate> || <translate><!--T:71--> yes if ''RequiresContainer'' is present</translate>
|-
|-
|TransitionTime || Time in seconds the item takes to turn into something else (e.g. rotten food) || number || yes for Item/Transitionable
| ''OutputAmount'' || <translate><!--T:72--> Amount of items obtained after emptying the container</translate> || <translate><!--T:73--> number</translate> || <translate><!--T:74--> yes if ''OutputName'' is present</translate>
|-
|-
|TransitionRatio || (Unsure) || float || no
| ''FreshTime'' || <translate><!--T:75--> The amount of time this item stays fresh / untransitioned</translate> || <translate><!--T:76--> string</translate> || <translate><!--T:77--> yes for ''Item/Transitionable''</translate>
|-
|-
|Satiety || Satiety points the item provides || number || yes for Item/Food
| ''TransitionTime'' || <translate><!--T:78--> The amount of time it takes for the item to transition e.g. from 0% spoiled to 100% spoiled</translate> || <translate><!--T:79--> string</translate> || <translate><!--T:80--> yes for ''Item/Transitionable''</translate>
|-
|-
|Category || Satiety category of the item || string || yes for Item/Food
| ''TransitionRatio'' || <translate><!--T:81--> Conversion ratio of fresh stacksize to transitioned stack size e.g. 10 apples transition to 5 rots = 0.50</translate> || <translate><!--T:82--> float</translate> || <translate><!--T:83--> no</translate>
|-
|-
|NoBreak || Whether or not the item box should end in a line break || any || no
| ''Satiety'' || <translate><!--T:84--> Satiety points the item provides</translate> || <translate><!--T:85--> number</translate> || <translate><!--T:86--> yes for ''Item/Food''</translate>
|-
|-
|FloatLeft || Whether or not the infobox should float left (by default, no) || any || no
| ''Category'' || <translate><!--T:87--> Satiety category of the item. One of the [[Template:Item/Food/Category|7 allowed options]] (e.g. Protein)</translate> || <translate><!--T:88--> string</translate> || <translate><!--T:89--> yes for ''Item/Food''</translate>
|-
| ''FloatRight'' || <translate><!--T:90--> Whether or not the box should float on the right side of the page<br>(so you don't have to use a <nowiki><div></div></nowiki> tag)</translate> || <translate><!--T:91--> any</translate> || <translate><!--T:92--> no</translate>
|-
| ''NoBreak'' || <translate><!--T:93--> Whether or not the item box should end in a line break</translate> || <translate><!--T:94--> any</translate> || <translate><!--T:95--> no</translate>
|}
|}
<translate>


=== Examples === <!--T:13-->
=== Examples === <!--T:13-->
</translate>
</translate>
{| class="wikitable" style="width: 75%"
{| class="wikitable" style="width: 75%"
|-
|-
! Code !! Result
! <translate><!--T:96--> Code</translate> !! <translate><!--T:97--> Result</translate>
|-
|-
| <pre>
| <pre>
{{Item
{{Item
|Name=Copper
|Name=Copper Ingot
|Image=File:Grid Copper Ingot.png
|Image=File:Grid Copper Ingot.png
|Material=Metal
|Stackable=16
|Stackable=16
|SmeltTemp=1084
|SmeltTemp=1084
|SmeltDuration=
|RequiresContainer=Yes
|RequiresContainer=Yes
|FloatLeft=yes
|OutputLink=Ingot_mold
|OutputName=Ingot mold
|OutputAmount=1
|FloatRight=yes
|NoBreak=yes
}}
}}
</pre>  
</pre>  
|| {{Item
|| {{Item
|Name=Copper
|Name=Copper Ingot
|Image=File:Grid Copper Ingot.png
|Image=File:Grid Copper Ingot.png
|Material=Metal
|Stackable=16
|Stackable=16
|SmeltTemp=1084
|SmeltTemp=1084
|SmeltDuration=
|RequiresContainer=Yes
|RequiresContainer=Yes
|FloatLeft=yes
|OutputLink=Ingot_mold
|OutputName=Ingot mold
|OutputAmount=1
|FloatRight=yes
|NoBreak=yes
}}
}}
|-
|-
| <pre>
| <font style="font-family: Consolas,monospace;">'''<nowiki></translate></nowiki>'''<br>
{{Item
<nowiki>{{Item</nowiki><br>
|Name=&lt;translate>Turnip&lt;/translate>
<nowiki>|Name=</nowiki>'''<nowiki><translate></nowiki>'''Turnip'''<nowiki></translate></nowiki>'''<br>
|Image=File:Grid turnip.png
<nowiki>|Image=File:Grid turnip.png</nowiki><br>
|Stackable=64
<nowiki>|Stackable=64</nowiki><br>
|FreshTime=504
<nowiki>|FreshTime=</nowiki>'''<nowiki><translate></nowiki>'''21 days'''<nowiki></translate></nowiki>'''<br>
|TransitionTime=96
<nowiki>|TransitionTime=</nowiki>'''<nowiki><translate></nowiki>'''48 hours'''<nowiki></translate></nowiki>'''<br>
|TransitionRatio=0.5
<nowiki>|TransitionRatio=0.5</nowiki><br>
|Satiety=100
<nowiki>|Satiety=100</nowiki><br>
|Category=&lt;translate>Vegetable&lt;/translate>
<nowiki>|Category=</nowiki>Vegetable<br>
}}</pre> n.b. the translate tags "disappear" when put on a page that is properly [[Vintage_Story_Wiki:How_to_translate_the_wiki|marked for translation]].
<nowiki>|FloatRight=yes</nowiki><br>
<nowiki>|NoBreak=yes</nowiki><br>
<nowiki>}}</nowiki><br>
'''<nowiki><translate></nowiki>'''<br><br><br></font>
<translate><!--T:98-->
n.b. the translate tags "disappear" when put on a page that is properly [[Special:MyLanguage/Vintage_Story_Wiki:How_to_translate_the_wiki|marked for translation]].
 
<!--T:99-->
The translator will not see any code. He will only see 3 sentences to translate:</translate>
*Turnip
*21 days
*48 hours
The <code>Category</code> parameter for foods should not be marked for translation anymore. It auto-translates if [[Template:Item/Food/Category]] itself is translated.
||
||
{{Item
{{Item
Line 129: Line 153:
|Image=File:Grid turnip.png
|Image=File:Grid turnip.png
|Stackable=64
|Stackable=64
|FreshTime=504
|FreshTime=21 days
|TransitionTime=96
|TransitionTime=48 hours
|TransitionRatio=0.5
|TransitionRatio=0.5
|Satiety=100
|Satiety=100
|Category=<translate><!--T:15--> Vegetable</translate>
|Category=Vegetable
|FloatRight=yes
|NoBreak=yes
}}
}}
|}
|}

Latest revision as of 15:37, 11 December 2023

Other languages:

This template creates an infobox for items in the game. It has the subcategories {{Item/Food}}, {{Item/Fuel}}, {{Item/Smeltable}}, {{Item/Transitionable}} for specific types of item.

Usage

The item infobox template should be placed at the top of the article, above the starting introductory text but below any translation tags where possible. Not every item infobox requires all the parameters - delete them as appropriate.

{{Item
|Name=Name of the item
|Image=Full image name with "File:" prefix and file extension ".png"
|Material=Material of the item
|Stackable=Maximum stack size, defaults to 64

|Temp=Temperature at which the object burns as fuel
|Duration=Burn duration in seconds

|SmeltTemp=Smelting temp of the metal
|RequiresContainer=Whether or not smelting requires a container
|OutputLink=Link to the container's (e.g. a mold) wiki page in your prefered language (you do not need to write Special:MyLanguage/)
|OutputName=Container name to be displayed (or its translation)
|OutputAmount=Number of items obtained after emptying the container, defaults to 1

|FreshTime=Time the item stays fresh (e.g. time before you see it as 0% spoiled)
|TransitionTime=Time the item takes to turn into something else (e.g. time between 0% spoiled to 100% spoiled)
|TransitionRatio=Conversion ratio of fresh stacksize to transitioned stack size (e.g. 10 onions turned into 5 rot: 0.5)

|Satiety=Satiety points the item provides
|Category=Satiety category of the item. One of the 7 allowed options (e.g. Protein)

|FloatRight=Whether or not the box should float on the right side of the page (so you don't have to use a <div></div> tag)
|NoBreak=Whether or not the item box should end in a line break
}}

When translation tagging, enclose strings in translation tags rather than the entire template - see the example below.

Parameters

Parameters Description Type Required
parameter1 Description of what parameter1 is string/boolean/file/number/any yes/no/suggested
Name Name of the item string yes
Image Filename of an image, including "File:" prefix and ".png" suffix file yes
Material Material of the item string no
Stackable Maximum stack size, default 64 number suggested
Temp Burning temperature number no
Duration Burn duration in seconds number no
SmeltTemp Smelting temperature of the metal number yes for Item/Smeltable
RequiresContainer Whether or not smelting requires a container string
(write anything for "yes"
remove this line for "no")
no
OutputLink Smelting output container page link string yes if RequiresContainer is present
OutputName Smelting output container name string yes if RequiresContainer is present
OutputAmount Amount of items obtained after emptying the container number yes if OutputName is present
FreshTime The amount of time this item stays fresh / untransitioned string yes for Item/Transitionable
TransitionTime The amount of time it takes for the item to transition e.g. from 0% spoiled to 100% spoiled string yes for Item/Transitionable
TransitionRatio Conversion ratio of fresh stacksize to transitioned stack size e.g. 10 apples transition to 5 rots = 0.50 float no
Satiety Satiety points the item provides number yes for Item/Food
Category Satiety category of the item. One of the 7 allowed options (e.g. Protein) string yes for Item/Food
FloatRight Whether or not the box should float on the right side of the page
(so you don't have to use a <div></div> tag)
any no
NoBreak Whether or not the item box should end in a line break any no

Examples

Code Result
{{Item
|Name=Copper Ingot
|Image=File:Grid Copper Ingot.png
|Material=Metal
|Stackable=16
|SmeltTemp=1084
|RequiresContainer=Yes
|OutputLink=Ingot_mold
|OutputName=Ingot mold
|OutputAmount=1
|FloatRight=yes
|NoBreak=yes
}}
Copper Ingot
Grid Copper Ingot.png
Material Metal
Stackable 16
Smeltable
Smelt Point 1084°C
Requires Container Yes
Output Ingot mold
Output Amount 1
Items
</translate>

{{Item
|Name=<translate>Turnip</translate>
|Image=File:Grid turnip.png
|Stackable=64
|FreshTime=<translate>21 days</translate>
|TransitionTime=<translate>48 hours</translate>
|TransitionRatio=0.5
|Satiety=100
|Category=Vegetable
|FloatRight=yes
|NoBreak=yes
}}
<translate>


n.b. the translate tags "disappear" when put on a page that is properly marked for translation.

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

  • Turnip
  • 21 days
  • 48 hours

The Category parameter for foods should not be marked for translation anymore. It auto-translates if Template:Item/Food/Category itself is translated.

Turnip
Grid turnip.png
Stackable 64
Food
Satiety 100
Category

Vegetable

Transitionable
Fresh Time 21 days
Transition Time 48 hours
Transition Ratio 0.5
Items