User:RustyVanBurace/Sandbox5: Difference between revisions

Jump to navigation Jump to search
Module parameter table taken from Rman's sandbox.
(Module parameter table taken from Rman's sandbox.)
Line 96: Line 96:


====Resistances====
====Resistances====
====Skills====
Skills can be added to the <code>skills=</code> parameter using [[Template:Skill]]. This template requires that the game's [[Guidelines:Media_Abbreviations#List of Abbreviations|abbreviation]] and the skill's name be added as template parameters, whereupon the Skill template will automatically fill in the skill's information from the game's skill data module. Some games can have additional parameters, such as the level the skill is learned at.
For example: adding <code><nowiki>skills={{Skill|SMT4|Hama|3}}</nowiki></code> will display the Hama skill from ''Shin Megami Tensei IV'' learned at level 3. If the skill is known by default, adding a hyphen in the level parameter will automatically render it as "Innate".
Skill information is stored within skill data modules, which allow other pages on the wiki to recall and automatically insert the relevant information. This ensures that skill information is always kept accurate and consistent wherever they are used. Skill data modules are titled as <code>Module:Data/Skill/(Game abbreviation)</code>. For example: [[Module:Data/Skill/smt5]] stores all the skill data from the original version of ''Shin Megami Tensei V''. For a detailed explanation of skill data modules, see the [[#Skill Data Modules|skill data modules]] section.
Skills will be added so long as the game's skill data module exists and the skill's information is available. If either of these do not exist, the Skill template will result in a Lua error.
Errors can potentially arise from misspelled skills. Make sure that skills are properly spelled, '''including any accents if present.''' Some games have multiple variations of skills with the same name; in these cases, skill data modules differentiate each variant by giving them an additional label, such as a number, element, or a character's name. It is advised to look over a game's skill data module before adding skill variants.
==Skill Data Modules==
In order to ensure that all skill information across the wiki is kept consistent and accurate, the wiki compiles skills into data modules. This allows [[Template:Skill]] to automatically call and insert the skill's information into skill listings and stat tables.
Skill data modules use the [[MW:Lua|Lua]] programming language to compile and store skill information. For the most part, this involves a series of named parameters used to store specific information on a skill, such as its [[Attribute]], base power, in-game description, and so on.
Skills must be added to modules in a certain format in order to avoid Lua errors. This tends to look like:
<pre>
['skill name in lowercase'] = {
    attribute = 'attribute name',
    effect = 'Effect explanation.',
    cost = Number,
    costtype = 'Cost type',
    description = 'In-game description.',
    name = 'Skill Name'
},
</pre>
With <code><nowiki>},</nowiki></code> used to separate each additional skill. With the exception of numbers, data entered into parameters must be enclosed by apostrophes. All parameters must be closed with a comma. If any parameters are entered incorrectly, the editor will highlight the error and require this be fixed before the module can be saved. If there is a possessive case in a skill name or description (such as [[Bael's Bane]], a backlash should be added before the apostrophe. For example: <code>Bael\'s Bane</code>.
Because the Skill template and skill data modules are made to be universal, skill data parameters must be kept consistent with each module on the wiki. Inconsistently named parameters will cause Lua errors. Some common skill data parameters are listed below.
Any parameter that is omitted from a skill will not be given its own cell, with a few exceptions.
{| class="wikitable"
!Parameter
!Description
!Necessity
|-
|'''name'''
|The name of the skill. Will also act as the '''link''' of a skill if that is not manually set.
|Always necessary
|-
|'''link'''
|A manually set link to the skill, separate from the display name.
|Optional
|-
|'''name_note'''
|A note to be attached to the name of a skill as a tooltip.
|Optional
|-
|'''attribute'''
|The attribute/element of the skill in lowercase. Filled with '—' if not set.
|Necessary if icon data exists
|-
|'''attribute_link'''
|A manually set link to the attribute, separate from its display name.
|Optional
|-
|'''cost'''
|The cost of a skill. If there is no cost, this should be set to '—' if the game has cost for other skills.
|Optional
|-
|'''costtype'''
|The cost type of a skill, as in what unit is depleted when the skill is used. Should not be set if cost is unset.
|Optional
|-
|'''range'''
|A range parameter, used for a few games.
|Optional
|-
|-
|'''description'''
|A description taken from the game. Will default to '''effect''' if unset.
|Optional
|-
|'''effect'''
|A description provided by the wiki users. Will fall back to nothing if unset.
|Optional
|}
For security purposes, skill data modules can only be edited by Autoconfirmed users. '''It is strongly advised to read a module's documentation before editing one.'''


==Formatting==
==Formatting==

Navigation menu