Template:Skill info/doc: Difference between revisions

From RuneRealm Wiki
Jump to navigation Jump to search
Content added Content deleted
(Created page with "{{Documentation}} This template functions as a general-purpose version of the different skill-specific info templates. Generally, if a skill-specific template exists, it is ''highly recommended'' to use the template for the specific skill. Those templates preload the info box with several useful properties, which keeps the formatting for that skill consistent. Skills that have very few interactions that are not a Template:Recipe|Rec...")
(No difference)

Revision as of 16:37, 15 October 2024

This is a documentation subpage for Template:Skill info.
It contains usage information, categories, and other content that is not part of the original template page.
Template:Skill info invokes function main in Module:Skill info using Lua.

This template functions as a general-purpose version of the different skill-specific info templates. Generally, if a skill-specific template exists, it is highly recommended to use the template for the specific skill. Those templates preload the info box with several useful properties, which keeps the formatting for that skill consistent.

Skills that have very few interactions that are not a Recipe (such as Crafting or Strength, among others) do not have a set preload, so should be represented by this general-purpose template. Interactions that award experience in multiple skills should make use of the skill-specific template of one of the skills, where possible.

Usage

This template features essentially two groups of data. First are several skill-related parameters, for up to 5 skills, that relate to the top of the info box. These represent levels and experience rates. Secondly there are several free-text inputs that have a customisable label. Most of the parameters listed serve the same function in terms of visible output, but they differ in their associated SMW properties (if applicable). Any of the

The template parameters are as follows:

{{Skill info
|versionX = Switch infobox version X label
|name = Subject name
|skill#name = Skill # name
|skill#lvl = Skill # level
|skill#exp = Skill # experience
|skill#note = Skill # note
|skill#label = Skill # label
|itemname = Label for the 'item' row (Default: "Uses item") (e.g. "Bait")
|item = Items used in the interaction
|locname = Label for the location (Default: "Location")
|loc = Location of the interaction
|facilityname = Label for the facility (Default: "Facility") (e.g. "Rock", "Fishing spot")
|facility = The facility 
|typename = Label for the interaction type (Default: "Type")
|type = The type of interaction
|toolname = Label for the 'tool' row (Default: "Required tool") (e.g. "Trap")
|tool = Tools required for the interaction
|timename = Label for the associated amount of time (Default: "Respawn time")
|time = Respawn time of the resource
|smw = set to 'No' to disable SMW properties.
}}

All of these parameters, with the exception of skill1name, skill1lvl and skill1exp are optional. Any inputs that are omitted are not shown in the info box. This template uses the same underlying module as Infoboxes, so switch infobox syntax can be used by appending a number at the end of a parameter, to indicate the parameter only applies to a single version of the infobox; parameters without numbers will serve as the default if no numbered parameter is specified.

If a switch infobox is used, rows that occur in at least one version will be shown for all versions. This means that, for example, specifying a tool for only one of the versions will show '? (edit)' for all other versions. This can only be disabled for the rows that display experience amounts, by specifying a negative amount of experience for that skill (e.g. skill2exp3 = -1 to hide the second skill for infobox version 3).

Example

Even though this template allows endless customisation options, most simple templates work fine with just a few parameters.

No switch versions

For example, a broken plough rewards Crafting experience when repaired. This information only applies to a single version of the plough, so only version1 is specified (to sync the SMW properties with that Template:Infobox Scenery version):

{{Skill info
|version1 = Broken
|name = Plough
|skill1name = Farming
|skill1lvl = 1
|skill1exp = 10
|loc = [[Hosidius]]
|tool = [[Hammer]]
}}
Broken
Plough
Level requiredFarming 1
Farming XP10 xp
LocationHosidius
Required toolHammer

Switch versions

Like other infobox templates, a switch infobox can be created by specifying a versionX parameter for every version X you want to include, and appending a number to each parameter that only applies to a single version. For example the different tiers of Sq'irk tree fruit give different amounts of experience. Note that no experience is specified for the second skill, Thieving, so no box appears for its experience.

{{Skill info
|version1 = Winter
|version2 = Spring
|version3 = Autumn
|version4 = Summer
|name = Sq'irk tree
|skill1name = Farming
|skill2name = Thieving
|skill1lvl = 1
|skill2lvl1 = 1
|skill2lvl2 = 25
|skill2lvl3 = 45
|skill2lvl4 = 65
|skill1exp1 = 30
|skill1exp2 = 40
|skill1exp3 = 50
|skill1exp4 = 60
|tool = None
}}
WinterSpringAutumnSummer
Sq'irk tree
Level requiredFarming 1 Thieving 1
Farming XP30 xp
Required toolNone

Parameters

This section lists more in-depth information for each of the parameters can be used in this template. Note that all of these parameters can have a number appended to it to specify that it applies to a single switch version only.

versionX

Generates a switch infobox label for version X with the specified value. This syncs up with other main infoboxes used on the page.

smwname

For skill information that is used on a page that already has a switch infobox, and only applies to a single version of that infobox, use smwname to specify which infobox version it applies to. For example, Strut can only be repaired in its broken state, so it should specify the smwname the skill info applies to.

name

The name appearing at the top of the skill info box. By default this is the page name.

skill#name

The name for a given skill. If this is omitted for a skill, no icon will be displayed. This also automatically becomes the skill label (format: [[Skill|Skill XP]]), except when skill#label overrides this.

skill#lvl

The level for the associated skill. This is only used if the skill name for the same # is given.

skill#exp

Experience for the specified skill box. Specifying experience requires either skill#name or skill#label to be specified. If this is set to a negative number for any version, the experience box will be hidden for that version.

Bug: Currently, either all switch versions or no switch versions should have a valid number entered in this parameter. If this is not the case (e.g. skill1exp1 = 10 and skill1exp2 = 5 or 10), switching between the different versions will cause a bug to occur which deletes the experience counter.

skill#note

Notes for the #th skill. This appears as a reference link after the skill label.

skill#label

Overrides the default skill name label for the #th skill row. Experience may still be specified for skill # to indicate an alternate experience source, which requires the label to be specified for that number #. This implies that this secondary experience source is for the same skill as the first row. See Big bones for an example of this: skill2label is specified to relate to the Bonecrusher, and skill2name is not specified.

itemname

Label for the item parameter.

item

Any items used in the interaction. This specifies Property:Uses material, and expects a comma separated list of either links to pages, or {{plink}} links.

locname

Label for the loc parameter.

loc

Location of the interaction, if applicable. Not to be confused with the facility, which refers to the object or NPC that facilitates the interaction.

facilityname

Labels for the facility parameter.

facility

The NPC or scenery object involved in this interaction. For example a rock, tree, fishing spot, etc.

typename

Label for the type parameter.

type

Type of interaction. Used to indicate a categoristaion of the interaction.

toolname

Label for the tool parameter.

tool

The tool used in the interaction.

timename

Label for the time parameter.

time

Typically used to indicate the respawn time, but can be used to indicate any time amount specific to the interaction. Not meant to indicate amount of ticks required for an interaction.

smw

Set to No to disable SMW properties.

dropversion

A name representing which drop tables are associated with this skill action. Should be defined if there are multiple distinct drop tables on the same page. The dropversion is set as the version parameter in Template:DropsTableHead, and is displayed next to the name of the skilling action in Template:Drop sources.

See also