Template:Item infobox: Difference between revisions
added support for specifying up to 8 categories |
added example for suffix |
||
(37 intermediate revisions by the same user not shown) | |||
Line 1: | Line 1: | ||
<includeonly><templatestyles src="Template:Item infobox/styles.css"></templatestyles><!-- | <includeonly><templatestyles src="Template:Item infobox/styles.css"></templatestyles><!-- | ||
-->{{reset solution count}}<!-- | |||
-->{{#invoke:Infobox|main | -->{{#invoke:Infobox|main | ||
|kind= | |kind=item | ||
|sep=, | |sep=, | ||
|title={{{title|}}} | |title={{{title|}}} | ||
|image={{#if:{{{image|{{{img|}}}}}}|[[File:{{{image|{{{img}}}}}}|250px]]}} | |image={{#if:{{{image|{{{img|}}}}}}|[[File:{{{image|{{{img}}}}}}|250px]]}} | ||
|sections=Main, Technical Information | |caption={{#if: {{{caption|}}}|''{{{caption}}}''}} | ||
|sections=Main, Weapon, Food, Processing, Chemical composition, Technical Information | |||
|Main=Categories, Type, Max stack, Size, Meow, | |Main=Categories, Type, Max stack, Size, Meow, Inventory size | ||
|Main_nolabel = yes | |Main_nolabel = yes | ||
|Categories = {{#invoke: | |Categories = {{#invoke:Item infobox|generate_categories}} | ||
|Categories_class = flat-bullet-list | |Categories_class = flat-bullet-list | ||
|Type = {{{type|}}} | |Type = {{{type|}}} <!-- TODO remove once all pages using it are using categories --> | ||
|Max stack = {{{max stack|}}} | |Max stack = {{{max stack|}}} | ||
|Size = {{{size|}}} | |Size = {{#if: {{{size|}}}<!-- | ||
-->|{{#if: {{{size in inventory|}}}<!-- | |||
-->|{{#ifeq: {{#invoke:String|match|{{{size in inventory}}}|*|plain=true|nomatch=}}|*<!-- | |||
# has a "*" inside = likely has a bullet list; place at separate strings | |||
-->|{{{size}}}<br>{{{size in inventory}}}<!-- | |||
# likely a single size - place in parens | |||
-->|{{{size}}} ({{{size in inventory}}})<!-- | |||
-->}}<!-- | |||
# doesn't have an in-inventory size but has adjective size | |||
-->|{{{size}}}<!-- | |||
-->}}<!-- | |||
# has no size; might have size in inventory | |||
-->|{{{size in inventory|}}}<!-- | |||
-->}} | |||
|Size_class = flat-bullet-list list-gap-medium | |Size_class = flat-bullet-list list-gap-medium | ||
|Meow = {{{meoow|}}} | |Meow = {{{meoow|}}} | ||
|Internal | |Inventory size = {{{inventory size|{{{internal size|}}}}}} | ||
|Weapon = Fire mode, Wieldable, Damage, Fire rate, Range, Spread, Projectile prototype, Projectile speed, Projectile lifetime, Auto-recharge, Auto-recharge rate, Internal magazine, Internal magazine capacity | |||
|Fire mode = {{{fire mode|}}} | |||
|Wieldable = {{#ifeq: {{yesno|{{{wieldable|}}}}}|yes|{{colored text|chartreuse|'''Yes'''}}<!---->}} | |||
|Damage = {{{damage|}}} | |||
|Damage_class = flat-bullet-list | |||
|Fire rate = {{{fire rate|}}} | |||
|Range = {{{range|}}} | |||
|Spread = {{{spread|}}} | |||
|Spread_class = flat-bullet-list | |||
|Projectile prototype = {{{projectile proto|}}} | |||
|Projectile speed = {{{projectile speed|}}} | |||
|Projectile lifetime = {{{projectile lifetime|}}} | |||
|Auto-recharge = {{#ifeq: {{yesno|{{{auto recharge|}}}}}|yes|{{colored text|chartreuse|'''Yes'''}}<!---->}} | |||
|Auto-recharge rate = {{{auto recharge rate|}}} | |||
|Internal magazine = {{#ifeq: {{yesno|{{{internal magazine|}}}}}|yes|{{colored text|chartreuse|'''Yes'''}}<!---->}} | |||
|Internal magazine capacity = {{{internal magazine capacity|}}} | |||
|Food = Edible by: | |||
|Edible by: = {{#invoke:Item infobox|generate_edible_by}} | |||
|Processing = Grindable, Juiceable | |||
|Grindable = {{#ifeq: {{yesno|{{{grindable|}}}}}|yes|Yes}} | |||
|Grindable_label = {{Tooltip|Grindable|Can be grinded in a grinder.}} | |||
|Juiceable = {{#ifeq: {{yesno|{{{juiceable|}}}}}|yes|Yes}} | |||
|Juiceable_label = {{Tooltip|Juiceable|Can be juiced in a grinder.}} | |||
|Chemical composition=Capacity, Solution | |||
|Capacity = {{{solution capacity|}}} | |||
|Solution = {{#if: {{{solution|}}} | |||
|{{{solution}}}<br><br>'''Total: {{u|{{solution count}}}}''' | |||
}} | |||
|Solution_class = flat-bullet-list | |||
|Technical Information = ID | |Technical Information = ID, Suffix | ||
|ID = {{{id|}}} | |ID = {{{id|}}} | ||
|ID_class = flat-bullet-list list-gap-medium | |ID_class = flat-bullet-list list-gap-medium | ||
|Suffix = {{{suffix|}}} | |||
}}<!-- | }}<!-- | ||
-->[[Category:Items]]</includeonly><noinclude> | -->[[Category:Items]]</includeonly><noinclude> | ||
{{docs|bb= | {{docs|bb= | ||
{{uses lua|Item infobox}} | |||
{{uses template styles}} | {{uses template styles}} | ||
{{template populates categories|Items|<category>}} | {{template populates categories|Items|<category>}} | ||
Line 52: | Line 101: | ||
"img" | "img" | ||
] | ] | ||
}, | }, | ||
"size": { | "size": { | ||
"label": "Size", | "label": "Size", | ||
"description": "How big is this item? | "description": "How big is this item? For actual size in inventory, see the \"size in inventory\" parameter.", | ||
"example": " | "example": "Large", | ||
"type": "string", | "type": "string", | ||
"suggested": true | "suggested": true, | ||
"suggestedvalues": [ | |||
"Tiny", | |||
"Small", | |||
"Medium", | |||
"Normal", | |||
"Large", | |||
"Huge", | |||
"Ginormous" | |||
] | |||
}, | }, | ||
"max stack": { | "max stack": { | ||
"label": "Max Stack", | "label": "Max Stack", | ||
"example": "10, 30, 1", | "example": "10, 30, 1", | ||
"type": "line", | "type": "line", | ||
"suggested": true | "suggested": true | ||
Line 91: | Line 136: | ||
"type": "line", | "type": "line", | ||
"suggested": true, | "suggested": true, | ||
"description": "Item category. If it has multiple, use other category fields. All specified categories will also be added as categories to the page.", | "description": "Item category. If it has multiple, use other category fields. All specified categories will also be added as categories to the page. DO NOT put links are any formatting here.", | ||
"suggestedvalues": [ | "suggestedvalues": [ | ||
"Medical items", | "Medical items", | ||
Line 136: | Line 181: | ||
"type": "line", | "type": "line", | ||
"suggested": true | "suggested": true | ||
}, | |||
"solution": { | |||
"label": "Solution composition", | |||
"description": "If an item holds a solution, which chemicals it is composed of? List them using a bullet list, each item starting on a new line.", | |||
"example": "* {{r|nutriment|6}} * {{r|amatoxin|3}} * {{r|vitamin|4}}", | |||
"type": "string", | |||
"suggested": true | |||
}, | |||
"solution capacity": { | |||
"label": "Solution capacity", | |||
"description": "If an item can hold a solution, how much can it hold? Use {{u|<amount>}} template to specify.", | |||
"example": "{{u|13}}", | |||
"type": "line", | |||
"suggested": true | |||
}, | |||
"caption": { | |||
"label": "Image caption", | |||
"type": "line", | |||
"suggested": true | |||
}, | |||
"edible by reptilians": { | |||
"label": "[FOOD] Edible by reptilians", | |||
"description": "If item is food, whether it's edible by reptilians (lizards).", | |||
"type": "boolean", | |||
"suggested": true, | |||
"autovalue": "0" | |||
}, | |||
"edible by moths": { | |||
"label": "[FOOD] Edible by moths", | |||
"description": "If item is food, whether it's edible by moth people (moffs).", | |||
"type": "boolean", | |||
"suggested": true, | |||
"autovalue": "0" | |||
}, | |||
"edible by rest": { | |||
"label": "[FOOD] Edible by everyone else", | |||
"description": "If item is food, whether it's edible by everyone except those in previous \"Edible by X\" parameters.", | |||
"type": "boolean", | |||
"suggested": true, | |||
"autovalue": "0" | |||
}, | |||
"grindable": { | |||
"label": "[PROCESSING] Grindable", | |||
"description": "Can be grinded in a grinder?", | |||
"type": "boolean", | |||
"autovalue": "0", | |||
"suggested": true | |||
}, | |||
"juiceable": { | |||
"label": "[PROCESSING] Juiceable", | |||
"description": "Can be juiced in a grinder?", | |||
"type": "boolean", | |||
"autovalue": "0", | |||
"suggested": true | |||
}, | |||
"damage": { | |||
"label": "[WEAPON] Damage", | |||
"example": "{{blunt|25}} (single type of damage) | * {{blunt|10}} * {{poison|10}} (multiple types; use multiple lines)", | |||
"type": "string", | |||
"suggested": true | |||
}, | |||
"fire rate": { | |||
"label": "[WEAPON] Fire rate", | |||
"description": "Shots per second", | |||
"example": "5 shots/sec", | |||
"type": "string", | |||
"suggested": true | |||
}, | |||
"range": { | |||
"label": "[WEAPON] Range", | |||
"description": "Range in tiles.", | |||
"example": "3 tiles", | |||
"type": "string", | |||
"suggested": true | |||
}, | |||
"fire mode": { | |||
"label": "[WEAPON] Fire mode", | |||
"type": "line", | |||
"suggestedvalues": [ | |||
"Semi-auto", | |||
"Burst", | |||
"Full-auto" | |||
], | |||
"suggested": true | |||
}, | |||
"wieldable": { | |||
"label": "[WEAPON] Can be wielded?", | |||
"type": "boolean", | |||
"autovalue": "0", | |||
"suggested": true | |||
}, | |||
"spread": { | |||
"label": "[WEAPON] Spread", | |||
"description": "Spread when shooting, in degrees.", | |||
"type": "string", | |||
"example": "30° (5° wielded)", | |||
"suggested": true | |||
}, | |||
"auto recharge": { | |||
"label": "[WEAPON] Auto recharge?", | |||
"description": "Whether the weapon recharges by itself.", | |||
"type": "boolean", | |||
"autovalue": "0", | |||
"suggested": true | |||
}, | |||
"auto recharge rate": { | |||
"label": "[WEAPON] Auto recharge rate", | |||
"description": "Rate of auto recharge, if any.", | |||
"example": "0.8 bullets/sec", | |||
"type": "line", | |||
"suggested": true | |||
}, | |||
"internal magazine": { | |||
"label": "[WEAPON] Has internal magazine?", | |||
"description": "Does the weapon has an internal unequipable magazine?", | |||
"type": "boolean", | |||
"autovalue": "0", | |||
"suggested": true | |||
}, | |||
"internal magazine capacity": { | |||
"label": "[WEAPON] Internal magazine capacity", | |||
"example": "1 bullet", | |||
"type": "line", | |||
"suggested": true | |||
}, | |||
"projectile proto": { | |||
"label": "[WEAPON] Projectile prototype", | |||
"example": "{{c|BulletKinetic}}", | |||
"type": "line", | |||
"suggested": true | |||
}, | |||
"projectile speed": { | |||
"label": "[WEAPON] Projectile speed", | |||
"example": "1.5 tiles/sec", | |||
"type": "string", | |||
"suggested": true | |||
}, | |||
"projectile lifetime": { | |||
"label": "[WEAPON] Projectile lifetime", | |||
"description": "Does the projectile despawns after a certain time?", | |||
"example": "1.5 seconds", | |||
"type": "line", | |||
"suggested": true | |||
}, | |||
"size in inventory": { | |||
"label": "Size in inventory", | |||
"description": "Size of this item in a inventory (for example, backpack). Use the smaller number first (for example, 3x5, NOT 5x3). If it has multiple sizes (for example an on/off welding tool), specify them in a bullet list.", | |||
"example": "3x5 / * 2x2 * 5x2", | |||
"type": "string", | |||
"suggested": true | |||
}, | |||
"inventory size": { | |||
"aliases": [ | |||
"internal size" | |||
], | |||
"label": "Inventory size", | |||
"description": "How big is this item on the inside? Use {{infobox storage grid|grid1|grid2|grid3}} from the ingame YML files to define this.", | |||
"example": "{{infobox storage grid|0,0,1,3|3,0,6,3|8,0,9,3}} (smugglers satchel)", | |||
"type": "line", | |||
"suggested": true | |||
}, | |||
"suffix": { | |||
"label": "Suffix", | |||
"description": "Suffix used in spawn menu.", | |||
"type": "line", | |||
"suggested": true, | |||
"example": "[Debug]" | |||
} | } | ||
}, | }, | ||
Line 141: | Line 353: | ||
"title", | "title", | ||
"image", | "image", | ||
"caption", | |||
"category 1", | "category 1", | ||
"category 2", | "category 2", | ||
Line 149: | Line 362: | ||
"category 7", | "category 7", | ||
"category 8", | "category 8", | ||
" | "edible by reptilians", | ||
"edible by moths", | |||
"edible by rest", | |||
"grindable", | |||
"juiceable", | |||
"fire mode", | |||
"wieldable", | |||
"damage", | |||
"fire rate", | |||
"range", | |||
"spread", | |||
"projectile proto", | |||
"projectile speed", | |||
"projectile lifetime", | |||
"auto recharge", | |||
"auto recharge rate", | |||
"internal magazine", | |||
"internal magazine capacity", | |||
"max stack", | "max stack", | ||
"size", | "size", | ||
" | "size in inventory", | ||
"id" | "inventory size", | ||
"solution capacity", | |||
"solution", | |||
"id", | |||
"suffix" | |||
], | ], | ||
"description": "Infobox templates for roles/jobs.", | "description": "Infobox templates for roles/jobs.", |
Latest revision as of 17:36, 27 May 2025
(though on what conditions — consult with the template itself)
- Category:Items
- [[:Category:<category>]]
Template:Item infobox/doc
Infobox templates for roles/jobs.
Parameter | Description | Type | Status | |
---|---|---|---|---|
Infobox title | title | {{PAGENAME}} by default, using the title of the page.
| Line | required |
Image | image img | no description
| File | suggested |
Image caption | caption | no description | Line | suggested |
Category 1 | category 1 category | Item category. If it has multiple, use other category fields. All specified categories will also be added as categories to the page. DO NOT put links are any formatting here.
| Line | suggested |
Category 2 | category 2 | no description | Line | suggested |
Category 3 | category 3 | no description | Line | suggested |
Category 4 | category 4 | no description | Line | suggested |
Category 5 | category 5 | no description | Line | suggested |
Category 6 | category 6 | no description | Line | suggested |
Category 7 | category 7 | no description | Line | suggested |
Category 8 | category 8 | no description | Line | suggested |
[FOOD] Edible by reptilians | edible by reptilians | If item is food, whether it's edible by reptilians (lizards).
| Boolean | suggested |
[FOOD] Edible by moths | edible by moths | If item is food, whether it's edible by moth people (moffs).
| Boolean | suggested |
[FOOD] Edible by everyone else | edible by rest | If item is food, whether it's edible by everyone except those in previous "Edible by X" parameters.
| Boolean | suggested |
[PROCESSING] Grindable | grindable | Can be grinded in a grinder?
| Boolean | suggested |
[PROCESSING] Juiceable | juiceable | Can be juiced in a grinder?
| Boolean | suggested |
[WEAPON] Fire mode | fire mode | no description
| Line | suggested |
[WEAPON] Can be wielded? | wieldable | no description
| Boolean | suggested |
[WEAPON] Damage | damage | no description
| String | suggested |
[WEAPON] Fire rate | fire rate | Shots per second
| String | suggested |
[WEAPON] Range | range | Range in tiles.
| String | suggested |
[WEAPON] Spread | spread | Spread when shooting, in degrees.
| String | suggested |
[WEAPON] Projectile prototype | projectile proto | no description
| Line | suggested |
[WEAPON] Projectile speed | projectile speed | no description
| String | suggested |
[WEAPON] Projectile lifetime | projectile lifetime | Does the projectile despawns after a certain time?
| Line | suggested |
[WEAPON] Auto recharge? | auto recharge | Whether the weapon recharges by itself.
| Boolean | suggested |
[WEAPON] Auto recharge rate | auto recharge rate | Rate of auto recharge, if any.
| Line | suggested |
[WEAPON] Has internal magazine? | internal magazine | Does the weapon has an internal unequipable magazine?
| Boolean | suggested |
[WEAPON] Internal magazine capacity | internal magazine capacity | no description
| Line | suggested |
Max Stack | max stack | no description
| Line | suggested |
Size | size | How big is this item? For actual size in inventory, see the "size in inventory" parameter.
| String | suggested |
Size in inventory | size in inventory | Size of this item in a inventory (for example, backpack). Use the smaller number first (for example, 3x5, NOT 5x3). If it has multiple sizes (for example an on/off welding tool), specify them in a bullet list.
| String | suggested |
Inventory size | inventory size internal size | How big is this item on the inside? Use {{infobox storage grid|grid1|grid2|grid3}} from the ingame YML files to define this.
| Line | suggested |
Solution capacity | solution capacity | If an item can hold a solution, how much can it hold? Use {{u|<amount>}} template to specify.
| Line | suggested |
Solution composition | solution | If an item holds a solution, which chemicals it is composed of? List them using a bullet list, each item starting on a new line.
| String | suggested |
Item ID | id | Can be found in .yml files. If there are multiple IDs, use a bullet list.
| String | suggested |
Suffix | suffix | Suffix used in spawn menu.
| Line | suggested |