Template:Item infobox: Difference between revisions

From Terraria Mods Wiki
Jump to navigation Jump to search
Moonseer (talk | contribs)
No edit summary
(Fixed the sound parameters. They are now similar to the vanilla wiki (tgc:Template:Item infobox#Sound-related parameters): $sound1 with $soundcaption1, $sound2 with $soundcaption2, etc., plus $sounduse, $soundplaced, and $soundbroken which have predefined captions.)
Line 9: Line 9:
--><div class="infobox item {{lc:{{{type|}}}}} float-{{{float|right}}}" style="<!--
--><div class="infobox item {{lc:{{{type|}}}}} float-{{{float|right}}}" style="<!--
-->{{#if:{{{boxwidth|}}}|width:{{{boxwidth|}}};}}{{{css|}}};{{{style|}}}<!--
-->{{#if:{{{boxwidth|}}}|width:{{{boxwidth|}}};}}{{{css|}}};{{{style|}}}<!--
-->"><!--
-->"><!--
--><div class="title">{{#dplvar:_item_infobox:name}}{{#if:{{{namesub|}}}|<span>{{{namesub|}}}</span>}}</div><!--
--><div class="title">{{#dplvar:_item_infobox:name}}{{#if:{{{namesub|}}}|<span>{{{namesub|}}}</span>}}</div><!--
Line 68: Line 68:
-->{{#if:{{{stack|}}}|<div class="stack" title="Max Stack: {{{stack}}}">{{stack|{{{stack}}}}}</div>}}<!--
-->{{#if:{{{stack|}}}|<div class="stack" title="Max Stack: {{{stack}}}">{{stack|{{{stack}}}}}</div>}}<!--
--></div><!-- div.section.images
--></div><!-- div.section.images

--><div class="section statistics"><!--
--><div class="section statistics"><!--
-->{{#if:{{{type|}}}{{{rare|}}}|<div class="title">Statistics</div>}}<!--
-->{{#if:{{{type|}}}{{{rare|}}}|<div class="title">Statistics</div>}}<!--
Line 852: Line 853:
--></div><!-- div.section.projectile
--></div><!-- div.section.projectile
-->}}<!--
-->}}<!--

-->{{#if:{{{soundtext|}}}|<!--
// sounds array (ii:sounds): "name1:sound1_1.wav,sound1_2.wav;name2:sound2_1.wav,sound2_2.wav; ..."
--><div class="section sound"><!-- div.section.sound
--><div class="title"><!--
-->{{#vardefine:ii:sounds|<!--
// sounds with pre-defined captions, these come first
-->{{#if:{{{soundtext|}}}<!--
-->{{#if:{{{sounduse|}}}|Use:{{{sounduse|}}};}}<!--
-->|Plays Sound}}<!--
-->{{#if:{{{soundplaced|}}}|Placed:{{{soundplaced|}}};}}<!--
-->{{#if:{{{soundbreak|}}}|Broken:{{{soundbreak|}}};}}<!--
// rest: custom sounds
-->{{#forargs:sound|k|v|<!--
-->{{#if:{{#var:v}}|{{#if:{{{soundcaption{{#var:k}}|}}}|<!--
array element: "<caption n>:soundn_1.wav,soundn_2.wav, ... ;"
-->{{{soundcaption{{#var:k}}|}}}:{{#var:v}};<!--
-->}}}}<!--
-->}}<!--
-->}}<!--
-->{{#if:{{#var:ii:sounds}}|<!--
--><div class="section statistics"><!--
--><div class="title">Sounds</div><!--
--><table class="stat"><!--
-->{{#arraydefine:x|{{#var:ii:sounds}}|;}}{{#arrayprint:x||@@|<!--
-->{{#arraydefine:y|@@|:}}<!--
--><tr><!--
--><th>{{#arrayindex:y|0}}</th><!--
--><td><!--
-->{{#arraydefine:z|{{#arrayindex:y|1}}|,}}{{#arrayprint:z||%%%%|<!-- print sounds
--><span style="margin-left:2px;">{{sound||{{trim|%%%%}}}}</span><!--
-->}}<!--
--></td><!--
--></tr><!--
-->}}<!--
-->}}<!--
--></div><!--
--></table><!--
--><ul class="infobox-inline"><!--
--></div><!--
-->}}<!--

--><div class="name">{{{soundtext|}}}</div><!--
--><div class="sound">{{{sound|}}}</div><!--
--></ul><!--
--></div><!-- div.section.sound
-->{{#if:{{{soundtext2|}}}|<!--
--><div class="section sound"><!-- div.section.sound
--><div class="title"><!--
-->{{#if:{{{soundtext2|}}}<!--
-->|Plays Sound}}<!--
-->}}<!--
--></div><!--
--><ul class="infobox-inline"><!--
--><div class="name">{{{soundtext2|}}}</div><!--
--><div class="image">{{{sound2|}}}</div><!--
--></ul><!--
--></div><!-- div.section.sound
-->{{#if:{{{soundtext3|}}}|<!--
--><div class="section sound"><!-- div.section.sound
--><div class="title"><!--
-->{{#if:{{{soundtext3|}}}<!--
-->|Plays Sound}}<!--
-->}}<!--
--></div><!--
--><ul class="infobox-inline"><!--
--><div class="name">{{{soundtext3|}}}</div><!--
--><div class="image">{{{sound3|}}}</div><!--
--></ul><!--
--></div><!-- div.section.sound
-->{{#if:{{{soundtext4|}}}|<!--
--><div class="section sound"><!-- div.section.sound
--><div class="title"><!--
-->{{#if:{{{soundtext4|}}}<!--
-->|Plays Sound}}<!--
-->}}<!--
--></div><!--
--><ul class="infobox-inline"><!--
--><div class="name">{{{soundtext4|}}}</div><!--
--><div class="image">{{{sound4|}}}</div><!--
--></ul><!--
--></div><!-- div.section.sound
-->{{#if:{{{soundtext5|}}}|<!--
--><div class="section sound"><!-- div.section.sound
--><div class="title"><!--
-->{{#if:{{{soundtext5|}}}<!--
-->|Plays Sound}}<!--
-->}}<!--
--></div><!--
--><ul class="infobox-inline"><!--
--><div class="name">{{{soundtext5|}}}</div><!--
--><div class="image">{{{sound5|}}}</div><!--
--></ul><!--
--></div><!-- div.section.sound
-->{{#if:{{{soundtext6|}}}|<!--
--><div class="section sound"><!-- div.section.sound
--><div class="title"><!--
-->{{#if:{{{soundtext6|}}}<!--
-->|Plays Sound}}<!--
-->}}<!--
--></div><!--
--><ul class="infobox-inline"><!--
--><div class="name">{{{soundtext6|}}}</div><!--
--><div class="image">{{{sound6|}}}</div><!--
--></ul><!--
--></div><!-- div.section.sound
-->{{#if:{{{soundtext7|}}}|<!--
--><div class="section sound"><!-- div.section.sound
--><div class="title"><!--
-->{{#if:{{{soundtext7|}}}<!--
-->|Plays Sound}}<!--
-->}}<!--
--></div><!--
--><ul class="infobox-inline"><!--
--><div class="name">{{{soundtext7|}}}</div><!--
--><div class="image">{{{sound7|}}}</div><!--
--></ul><!--
--></div><!-- div.section.sound
-->{{#if:{{{soundtext8|}}}|<!--
--><div class="section sound"><!-- div.section.sound
--><div class="title"><!--
-->{{#if:{{{soundtext8|}}}<!--
-->|Plays Sound}}<!--
-->}}<!--
--></div><!--
--><ul class="infobox-inline"><!--
--><div class="name">{{{soundtext8|}}}</div><!--
--><div class="image">{{{sound8|}}}</div><!--
--></ul><!--
--></div><!-- div.section.sound
-->{{#if:{{{soundtext9|}}}|<!--
--><div class="section sound"><!-- div.section.sound
--><div class="title"><!--
-->{{#if:{{{soundtext9|}}}<!--
-->|Plays Sound}}<!--
-->}}<!--
--></div><!--
--><ul class="infobox-inline"><!--
--><div class="name">{{{soundtext9|}}}</div><!--
--><div class="image">{{{sound9|}}}</div><!--
--></ul><!--
--></div><!-- div.section.sound
-->{{#if:{{{soundtext10|}}}|<!--
--><div class="section sound"><!-- div.section.sound
--><div class="title"><!--
-->{{#if:{{{soundtext10|}}}<!--
-->|Plays Sound}}<!--
-->}}<!--
--></div><!--
--><ul class="infobox-inline"><!--
--><div class="name">{{{soundtext10|}}}</div><!--
--><div class="image">{{{sound10|}}}</div><!--
--></ul><!--
--></div><!--END div.infobox
--></div><!--END div.infobox


Line 1,011: Line 907:
--></includeonly><!--
--></includeonly><!--


--><noinclude><!--
--><noinclude>
{{doc}}

</noinclude>
-->{{doc}}<!--

--></noinclude>

Revision as of 04:13, 31 December 2023

Template-info.svg Documentation The documentation below is transcluded from Template:Item infobox/doc. (edit | history)

Usage

  • Everything is optional.
  • You can add a "name," "image," "imagefemale," and "imagebreak." Fill these values if the ROOTPAGENAME macro is not adequate (if the page name has a disambig qualifier for example)
{{item infobox
| boxwidth = width of infobox; default = 21em or stretches to image width
| float = default is right
| css / style = css style for infobox box, if width:xx or float:xx inclueded it will override boxwidth= or float=.
| name = custom item name; default = page name
| namesub = custom item name, displays below name
| image = inventory image; default = name.png (also used for sets)
| imagefemale = female equipped variant; default = name female.png
| imageplaced = placed image; default = name (placed).gif; if no GIF exists, default = name (placed).png
| imageequipped = equipped image; default = name (equipped).gif; if no GIF exists, default = name (equipped).png
| imagebreak = if yes, placed/equipped image is pushed to a new line below the inventory image; default = no
| type = eg. Weapon, Tool, Furniture, etc.
| type2 = secondary type; =Set for armor and vanity sets
| damage = damage inflicted per hit
| damagetype = melee, ranged, magic, summon, or thrown
| autoswing = yes, if weapon/item autoswings/autofires by holding the use key/button
| defense = defense provided
| bonus =
| setbonus = for armor sets, where type2 = Set
| pick = pickaxe power, without "%"
| axe = axe power, without "%"
| hammer = hammer power, without "%"
| bait = bait power, without "%"
| fishing = fishing power, without "%"
| knockback = knockback inflicted per hit, if more than one value needed, you should wrap the values with {{kb}}, e.g. {{kb|7.5}}/{{kb|6}}
| placeable = yes/no
| width = width when placed, tiles
| height = height when placed, in tiles
| mana = mana cost per use
| mregen = mana regeneration
| mheal = mana heal
| lregen = health (life) regeneration
| hheal = health heal
| tooltip = Tooltip
| velocity =
| critical = if no value is entered and the main Type is "Weapon", a default value of 4% is displayed
| body slot =
| use = use time
| toolspeed =
| tool = tool used to free this item if in its placed form (this field is somewhat deprecated)
| buff = buff provided (up to 5 as buff2, buff3...)
| bufflink = no: when buff doesn't have it's own page
| duration = buff duration
| buffchance = buff chance
| bufftip = buff tooltip
| debuff = debuff provided (up to 3 as debuff2, debuff3...)
| debufflink = no: when debuff doesn't have it's own page
| debuffduration = buff duration
| debuffchance = debuff chance
| debufftip = buff tooltip
| stack = max quantity of this item that can be stacked in a single inventory slot; defaults to 1 for all items
| rare = rarity value, eg. '1' for Blue, '2' for Green, 'q' for Amber (quest), 'rainbow' for expert-exclusive.
| buy = buy value in coins, enter using coin templates ({{cc}}, {{sc}}, {{gc}}, {{pc}})

Placing // within either the sell value or buy value will return separate lines for Buy and Sell.

| sell = sell value in coins, also enter using coin templates
| projectile = Name of the projectile the item creates. It can also be used for summons, i.e. to incorporate {{summoned}} into the infobox. (up to 3 as projectile2, projectile3...)
| projectiletype = Type of the projectile created; affects the section's header. Leave it empty to set the header to "Creates Projectile". Set it to minion/sentry to set the header to "Summons Minion"/"Summons Sentry". Anything else will set it to "Summons <parameter value>"; example: Set it to [[Mod of Redemption/Guardian|Guardian]] (or faster: {{+|Guardian}} on the Mod of Redemption Wiki) to set the section's header to "Summons Guardian".
| projectileimage = Image of the projectile, without brackets (e.g. File:Wooden Arrow.png). Defaults to File:<value of the projectile parameter>.png.
| sounduse = Sound effect played when the item is used, without brackets and "File:" (e.g. Item 1.wav). Can be a comma-separated list for multiple sounds. Caption is "Use".
| soundplaced = Sound effect played when the item is placed (intended for wall items), without brackets and "File:" (e.g. Item 1.wav). Can be a comma-separated list for multiple sounds. Caption is "Placed".
| soundbroken = Sound effect played when the item is broken (intended for wall items), without brackets and "File:" (e.g. Item 1.wav). Can be a comma-separated list for multiple sounds. Caption is "Broken".
| sound1 = Custom sound effect, without brackets and "File:" (e.g. Item 1.wav). Can be a comma-separated list for multiple sounds. Will only be displayed if there is a corresponding soundcaption1.
| soundcaption1 = Caption for sound1.
| sound2 = Custom sound effect, without brackets and "File:" (e.g. Item 1.wav). Can be a comma-separated list for multiple sounds. Will only be displayed if there is a corresponding soundcaption2. Can be continued nearly infinitely (sound3, sound4, etc.).
| soundcaption2 = Caption for sound2. Can be continued nearly infinitely (soundcaption3, soundcaption4, etc.).
| consumable = true: (found in source code) leaves player's inventory with Use / Attack, includes placeable items
| listcat = a supplemental category name to include the current item in a DPL list, eg. "arrows" causes the item to display at Arrows
| listcat2 ... listcat5 = identical to listcat: an additional supplemental category name
| listexclude = yes, to exclude the current template from DPL lists
| hardmode = yes, for items that only become available in Hardmode worlds
}}