Template:Infobox NPC/doc

From RuneScape Classic Wiki
Jump to: navigation, search
Information icon-grey.svg
This is a documentation subpage for Template:Infobox NPC.
It contains usage information, categories, and other content that is not part of the original template page.
Template:Infobox NPC invokes function main in Module:Infobox NPC using Lua.

Infobox NPC should be used for NPCs that do not engage in combat. NPCs that do engage in combat should use Infobox Monster instead.


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.

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.

__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 NPC exactly as it appears in game. Should match the capitalization, including if the first letter is lowercase.

image

An image of the NPC.

release

The release date of the NPC.

update

The update post associated with the release date.

members

Whether the NPC is accessible only to members. Must be "Yes" or "No".

race

The race of the NPC.

quest

(Optional) The quest that the NPC is associated with. Omit if the NPC is not involved in any quest.

location

The location of the NPC.

shop

(Optional) A link to the shop owned by the NPC.

gender

(Optional) The gender of the NPC. Omit if not applicable.

actions

(Optional) The right-click actions on the NPC. Omit if the Examine is the only option.

examine

The examine text of the NPC, exactly as it appears in game.

skillrequired

(Optional, Deprecated) Skills required to interact with the NPC. This parameter is being phased out in favor of including this text in the prose of the article.

questrequired

(Optional, Deprecated) Quests required to interact with the NPC. This parameter is being phased out in favor of including this text in the prose of the article.

features

(Optional, Deprecated) General important features of the NPC. This parameter is being phased out in favor of including this text in the prose of the article.

map

A map showing the location of the NPC. Should be a map image or an interactive mapframe, or set to "No" if no map is applicable.

id

The internal game ID for this NPC. Must be a comma separated list of IDs. Monsters that have been removed from the cache should have IDs prefixed by "hist".

Example values for this field:

  • 1234
  • 123,124,125
  • hist12,hist13


Quick copy

{{Infobox NPC
|name = 
|image = 
|release = 
|update = 
|members = 
|race = 
|quest = (Optional)
|location = 
|shop = (Optional)
|gender = (Optional)
|actions = (Optional)
|examine = 
|skillrequired = (Optional, Deprecated)
|questrequired = (Optional, Deprecated)
|features = (Optional, Deprecated)
|map = 
|id = 
}}