Template:Infobox Item/doc: Difference between revisions

From Discord Dungeons Wiki
Jump to navigation Jump to search
(Created page with "{{Documentation}} {{invokes|Infobox Item}} {{ToC|left}} {{clear}} {{Standard infobox parameters}} ==Parameters== ===name=== The name of the item '''exactly''' as it appears in game (identical case and spacing). ===image=== The inventory image of the item, formatted as <nowiki>File:Image.png</nowiki>. Ideally in PNG format (or GIF format if the image is animated). For stackable items with multiple images, a...")
 
No edit summary
 
(10 intermediate revisions by the same user not shown)
Line 12: Line 12:


===image===
===image===
The inventory image of the item, formatted as <nowiki>[[File:Image.png]]</nowiki>. Ideally in [[Wikipedia:Portable_Network_Graphics|PNG]] format (or [[Wikipedia:GIF|GIF]] format if the image is animated). For stackable items with multiple images, all images should be included in increasing order.
The inventory image of the item, formatted as <nowiki>[[File:Image.png]]</nowiki>. Ideally in [[Wikipedia:Portable_Network_Graphics|PNG]] format (or [[Wikipedia:GIF|GIF]] format if the image is animated).


===release===
===release===
Release date of the item. Should follow the format <nowiki>[[DD Month]] [[YYYY]]</nowiki>.
Release date of the item. Should follow the format <nowiki>[[DD Month]] [[YYYY]]</nowiki>.


===update===
===id===
Update page that the item was released with. Do not include brackets (<nowiki>[[ & ]]</nowiki>) or the Update: prefix.
The item's game ID. Meta item IDs should be prefixed by "m:".


===removal===
Example values for this field:
(Optional)
* 1234
Removal date of the item. Should follow the format <nowiki>[[DD Month]] [[YYYY]]</nowiki>.
* m:1234


===removalupdate===
===description===
(Optional)
The description of the item that appears in the game.
Update page that the item was removed with. Do not include brackets (<nowiki>[[ & ]]</nowiki>) or the Update: prefix.
 
===aka===
(Optional)
Other names commonly associated with the item.


===members===
===members===
Whether or not the item is a members only item. Must be the string "Yes" or "No".
Whether or not the item is a members only item. Must be the string "Yes" or "No".
===donator===
Whether or not the item is a donator only item. Must be the string "Yes" or "No".
===level===
The level of the item.
===cost===
The price of the item, or <code>Not Buyable</code> if not buyable.
Example values for this field:
* 123 [[Gold]]
* 123 [[Lux]]
* Not Buyable
===sell===
The sell price of the item, or <code>Not Sellable</code> if not sellable.
Example values for this field:
* 123 [[Gold]]
* 123 [[Lux]]
* Not Sellable
===tradeable===
Whether the item is [[tradeable]] between players.
'''Examples:'''
* Yes
* No
===craftable===
Whether the item is craftable.
'''Examples:'''
* Yes
* No
===brewable===
Whether the item is brewable.
'''Examples:'''
* Yes
* No


===quest===
===quest===
Line 42: Line 82:
* No
* No


===tradeable===
===market_sp_limit===
Whether the item is [[tradeable]] between players. For example, [[Barrows gloves]] are bought from a "shop" ([[Culinaromancer's Chest]]), but these gloves cannot be sold to other players as the Barrows gloves are not tradeable.  
Sell price limits on the global market, as they appear in game.
 
'''Examples:'''
* 0 - 0
* 12 - 21
 
===market_bp_limit===
Buy price limits on the global market, as they appear in game.


'''Examples:'''
'''Examples:'''
* Yes
* 0 - 0
* No
* 12 - 21
 
===type===
The type of the item


===bankable===
The possible values for this field are:
(Optional)
* <nowiki>[[''Item Type'']]</nowiki>
Whether the item can be put in the bank. Can omit if "Yes", otherwise must be the string "Yes" or "No".


===stacksinbank===
===potion_type===
(Optional)
The potion type, if the item is a potion.
Whether the item will stack in one bank space. Can omit if "Yes", otherwise must be the string "Yes" or "No".


===placeholder===
The possible values for this field are:
(Optional)
* <nowiki>[[''Health Potion'']]</nowiki>
Whether this item can be removed with a placeholder in the bank. (Not currently used)
* <nowiki>[[''Effect Potion'']]</nowiki>


===equipable===
===potion_effect===
Whether the item is equipable. For instance, a [[Rune sword]] may be wielded (Yes), while a tinderbox may not be equipped (No). Must be the string "Yes" or "No".
If the item is a potion effect, specify the effect here.


===stackable===
===book_author===
Whether the item stacks in the player's inventory, in its unnoted form. For example, [[runes]] and [[arrows]] are stackable, while [[pickaxes]] are not. Must be the string "Yes" or "No".
If the item is a book, specify the author here.


===noteable===
===damage_blocked===
(Optional)
If the item blocks damage, specify it here.
Whether the item can be withdrawn from the bank as a note. Can omit if "Yes", otherwise must be the string "Yes" or "No".


===edible===
===rune_tp===
(Optional)
If the item is a rune, specify the location it teleports to.
Whether the item is edible. This should not be added on every page, only pages describing items which are actually edible or easily mistaken as edible; i.e. [[shark]] (edible) or [[cooking apple]] (easily mistaken as edible). If omitted, the field will be '''hidden'''.


===options===
The possible values for this field are:
The right-click options for an item while held in the inventory. The options "Use", "Examine", and any type of "Destroy" option (such as "Drop") should not be listed here.
* <nowiki>[[''Location name'']]</nowiki>


===destroy===
===damage===
Text displayed as a final warning when a player tries to [[destroy]] the item. Destroy is an option for some items from [[quests]] or [[Discontinued items and holiday drops]].  If there is no "Destroy" option, the value for the field is "Drop", as most items have the "Drop" option.  Certain items may behave differently when it is dropped, and this behaviour should be included in the field with " - " as a separator. For example, an [[Explosive potion]] explodes when dropped.
If the item deals damage, specify it here.


'''Examples:'''
'''Examples:'''
* ''The Oneiromancer might be able to help you get another.'' - [[Lunar staff]]
* 0 - 0
* Drop
* 12 - 21
* Drop - ''Explodes''


===examine===
===tool_type===
The [[examine]] text '''exactly''' as it appears in game (identical case, spaces, typo, etc). The text is obtained through the contextual menu "Examine" option.
If the item is a tool, specify the type of tool here.


===value===
The possible values for this field are:
The value of the item as set by Jagex. Commas are not necessary as they are included automatically. The high and low alch values are computed from this value. Must be a number.
* Fishing Rod
* Axe
* Pickaxe
* Shears


===alchable===
===tool_skill_level===
(Optional)
The level required in the skill required to use the tool.
Whether or not the item can be alchemized. Can be omitted to default to "Yes". Must be the string "Yes" or "No".


===weight===
===tool_effect===
The item's weight. The weight appears in the [[Equipment Stats]] submenu from [[Worn Equipment]] [[interface]]. The weight unit ("kilogram", "kg") need NOT be added to this field, as it is added automatically.  For special weight-reducing items which has "negative" weight, the negative "-" should be included in the field.
If the tool has any effects, put them here.


'''Examples:'''
===forage_level===
* 2
If the item can be gotten from foraging, add the minimum forage level needed to get it here.
* -4.5
 
===mine_level===
If the item can be gotten from mining, add the minimum mining level needed to get it here.
 
===fish_level===
If the item can be gotten from fishing, add the minimum fishing level needed to get it here.
 
===chop_level===
If the item can be gotten from chopping, add the minimum chop level needed to get it here.
 
 
===ring_effect===
If the item is a ring, provide the rings effect here.
 
===necklace_effect===
If the item is a necklace, provide the necklaces effect here.


===respawn===
(Optional)
The item's respawn time in ticks.


===exchange===
(Optional)
Should be set to "Yes" if the item can be traded on the [[Grand Exchange]]. May be omitted to default to "No". Must be the string "Yes" or "No".


===gemwname===
(Optional)
Should be included if the wiki exchange article for the item has a different name than the exact in-game name set in the name parameter. This occurs when there are multiple items with the same name on the grand exchange. Should be set to the name of the wiki exchange article for the item, or omitted if this is identical to the in game name.


===id===
The item's internal game ID. Must be a comma separated list of IDs. Beta IDs should be prefixed by "beta". Items that have been removed from the cache should have IDs prefixed by "hist".


Example values for this field:
* 1234
* 123,124,125
* beta22326
* hist9662,hist9663


==Quick copy==
==Quick copy==
Line 129: Line 175:
|image =  
|image =  
|release =  
|release =  
|update =  
|id =  
|removal = (Optional)
|description =  
|removalupdate = (Optional)
|aka = (Optional)
|members =  
|members =  
|level =
|cost =
|sell =
|tradeable =
|craftable =
|brewable =
|quest =  
|quest =  
|tradeable =  
|market_sp_limit = (Optional)
|bankable = (Optional)
|market_bp_limit = (Optional)
|stacksinbank = (Optional)
|type =
|placeholder = (Optional)
|potion_type = (Optional)
|equipable =  
|potion_effect = (Optional)
|stackable =
|book_author = (Optional)
|noteable = (Optional)
|damage_blocked = (Optional)
|edible = (Optional)
|rune_tp = (Optional)
|destroy =
|damage = (Optional)
|examine =
|tool_type = (Optional)
|value =
|skill_level = (Optional)
|alchable = (Optional)
|tool_effect = (Optional)
|weight =
|respawn = (Optional)
|exchange = (Optional)
|gemwname = (Optional)
|id =
}}</pre>
}}</pre>
<includeonly>[[Category:Infobox templates]]</includeonly>
<includeonly>[[Category:Infobox templates]]</includeonly>

Latest revision as of 11:31, 3 April 2022

This is a documentation subpage for Template:Infobox Item.
It contains usage information, categories, and other content that is not part of the original template page.
Template:Infobox Item invokes function main in Module:Infobox Item using Lua.
{{#replace:Template:Infobox Item/doc|/doc}} invokes Module:Infobox Item using Lua.


Standard infobox parameters

This infobox uses Module:Infobox, which provides a number of standard parameters.

Versioning

This infobox supports switching between multiple versions. Each version needs to have a name defined in a parameter called version#, numbered sequentially starting from 1. For all parameters that have different values, a number can be appended to the end of each parameter name to define the value for each version. Parameters without a version number will be shared between all versions.

For example, if the name of version 2 is called "Bob", you should define |name2 = Bob.

Linking

You can link to a page and have an alternative infobox appear by using a hash value, as if you were linking to a section. The hash value is the version name, as defined by the relevant version# parameter. For example, to link to the variant of a switch infobox with |version3 = Quest, you can use [[Example#Quest]].

Alternative versions are not visible or accessible when Javascript is disabled.

defver

If defver is defined, the infobox will switch to the specified version when the page is loaded. For example, |defver = 4 will automatically select the 4th infobox version.

smwname

This overrides the name of the Semantic MediaWiki subobject that the infobox will set the parameters into. By default, an infobox with multiple versions will save properties into subobjects with the same name as the version name. This parameter only needs to be set if the version name is different from the desired subobject name, or if an unversioned infobox needs to set properties of a specific subobject (for example, when versioned and unversioned infoboxes of different types, like Item and Bonuses, are used on the same page).

This is necessary when a version name would otherwise be an invalid SMW subobject name. The value of smwname is also not permitted to be an invalid subobject name. A subobject name must not violate the following rules:

  • The first 5 characters of the name must not contain a period (.).
  • The name must not be the number zero (0).
  • The name must not be the empty string.


If the infobox does not have multiple versions, SMW properties would normally be set on the page itself. Setting smwname overrides this default behaviour and the properties will be only be set to the specified subobjects and not the page itself.

Multiple subobjects can be specified by separating the subobject names with the broken bar character (¦). The properties will be set in all of the subobjects specified.

For example, if the infobox has |version2 = H.A.M. member, this would cause an invalid subobject name due to having a period within the first 5 characters. The infobox should therefore override the smwname using |smwname2 = HAM member or something similar.

Suppressing SMW

Setting |smw = No will suppress all SMW output for the infobox.

Setting |smwX = No will suppress all SMW output for version number X.

__dump__

This parameter is used only for debugging an infobox. If __dump__ is present with any value then a string version of the infobox object is dumped to the page, rather than displaying the infobox as normal. This should only be used when previewing the page and must never be saved in a mainspace page. Setting this adds Category:Dumping infoboxes to the page.

Specifically, this shows the result at the time the infobox is converted to a string. This will always occur when the module finally returns, but may instead occur earlier in the code. The object is dumped using mw.dumpObject(box). Dumping will not prevent a script error occurring.


Parameters

name

The name of the item exactly as it appears in game (identical case and spacing).

image

The inventory image of the item, formatted as [[File:Image.png]]. Ideally in PNG format (or GIF format if the image is animated).

release

Release date of the item. Should follow the format [[DD Month]] [[YYYY]].

id

The item's game ID. Meta item IDs should be prefixed by "m:".

Example values for this field:

  • 1234
  • m:1234

description

The description of the item that appears in the game.

members

Whether or not the item is a members only item. Must be the string "Yes" or "No".

donator

Whether or not the item is a donator only item. Must be the string "Yes" or "No".


level

The level of the item.

cost

The price of the item, or Not Buyable if not buyable.

Example values for this field:

sell

The sell price of the item, or Not Sellable if not sellable.

Example values for this field:

tradeable

Whether the item is tradeable between players.

Examples:

  • Yes
  • No

craftable

Whether the item is craftable.

Examples:

  • Yes
  • No


brewable

Whether the item is brewable.

Examples:

  • Yes
  • No

quest

See Category:Quest items for guidelines. Also applicable for miniquests.

The possible values for this field are:

  • [[''Quest name'']]
  • No

market_sp_limit

Sell price limits on the global market, as they appear in game.

Examples:

  • 0 - 0
  • 12 - 21

market_bp_limit

Buy price limits on the global market, as they appear in game.

Examples:

  • 0 - 0
  • 12 - 21

type

The type of the item

The possible values for this field are:

  • [[''Item Type'']]

potion_type

The potion type, if the item is a potion.

The possible values for this field are:

  • [[''Health Potion'']]
  • [[''Effect Potion'']]

potion_effect

If the item is a potion effect, specify the effect here.

book_author

If the item is a book, specify the author here.

damage_blocked

If the item blocks damage, specify it here.

rune_tp

If the item is a rune, specify the location it teleports to.

The possible values for this field are:

  • [[''Location name'']]

damage

If the item deals damage, specify it here.

Examples:

  • 0 - 0
  • 12 - 21

tool_type

If the item is a tool, specify the type of tool here.

The possible values for this field are:

  • Fishing Rod
  • Axe
  • Pickaxe
  • Shears

tool_skill_level

The level required in the skill required to use the tool.

tool_effect

If the tool has any effects, put them here.

forage_level

If the item can be gotten from foraging, add the minimum forage level needed to get it here.

mine_level

If the item can be gotten from mining, add the minimum mining level needed to get it here.

fish_level

If the item can be gotten from fishing, add the minimum fishing level needed to get it here.

chop_level

If the item can be gotten from chopping, add the minimum chop level needed to get it here.


ring_effect

If the item is a ring, provide the rings effect here.

necklace_effect

If the item is a necklace, provide the necklaces effect here.




Quick copy

{{Infobox Item
|name = 
|image = 
|release = 
|id = 
|description = 
|members = 
|level =
|cost =
|sell =
|tradeable = 
|craftable =
|brewable = 
|quest = 
|market_sp_limit = (Optional)
|market_bp_limit = (Optional)
|type =
|potion_type = (Optional)
|potion_effect = (Optional)
|book_author = (Optional)
|damage_blocked = (Optional)
|rune_tp = (Optional)
|damage = (Optional)
|tool_type = (Optional)
|skill_level = (Optional)
|tool_effect = (Optional)
}}