Module:SkillData/doc

From Heroes of Might and Magic: Olden Era Official Wiki
Revision as of 19:51, 25 May 2026 by akesha.taladim (talk | contribs) (Created page with "{{Documentation}} This module allows for the dynamic extraction of variables, asset icons, descriptions, and tiered scaling mechanics for main skills, sub-skills, and individual skill levels stored within the wiki's Cargo database. It automatically handles localized fallback to English if a translation in the requested language is missing. == Basic Syntax == To fetch a data field, use the following syntax: <pre>{{#invoke:SkillData|get|SKILL_ID|VARIABLE|LANGUAGE_CODE|FOR...")
(diff) ← Older revision | Latest revision (diff) | Newer revision → (diff)

This is the documentation page for Module:SkillData

Template:Documentation This module allows for the dynamic extraction of variables, asset icons, descriptions, and tiered scaling mechanics for main skills, sub-skills, and individual skill levels stored within the wiki's Cargo database. It automatically handles localized fallback to English if a translation in the requested language is missing.

Basic Syntax

To fetch a data field, use the following syntax:

{{#invoke:SkillData|get|SKILL_ID|VARIABLE|LANGUAGE_CODE|FORCE_TYPE}}
  • SKILL_ID : The technical identifier of the capability (e.g., skill_faction_dungeon, sub_skill_faction_dungeon_1).
  • VARIABLE : The keyword for the specific data field you want to display (see the list below).
  • LANGUAGE_CODE : (Optional) The localization code (e.g., en, fr, de). Defaults to English (en).
  • FORCE_TYPE : (Optional) Overrides automated row-type resolution. Accepts skill, sub_skill, or skill_level.

---

Available Variables

📝 Text & Translations (Language-Dependent)

These variables query the Translation table and dynamically adapt to the requested language code. The module automatically deduces whether the ID points to a root skill, sub-skill, or level row.

Variable Description Example Output (en)
name The full display name of the skill/sub-skill/tier. Triumvirate's Strength
description The official technical capability behavior text, ratios, and battle modifiers. Once per round, the hero can activate one of the three Stances...

🎨 Assets & Layout Data

Technical data parameters queried directly from SkillDef, SkillLevelDef, or SubSkillDef records.

Variable Description Example Values / Output
icon The visual icon asset name string. Forced automatic Title Case formatting applies natively. Skill_Faction_Dungeon_1_Icon
skill_type Classification type assigned to the asset root. Faction, Might, Magic
max_level Maximum mastery tier achievable for a main skill root. 3
offered_sub_skills Comma-separated list of dependent sub-skill paths unlocked at specific tiers. sub_skill_faction_dungeon_1,sub_skill_faction_dungeon_2

---

Practical Examples

Example 1: Printing Localized Root Skill Data

To display the French translated title and performance behavior of a specific faction mechanics path:

=== {{#invoke:SkillData|get|skill_faction_dungeon|name|fr}} ===
{{#invoke:SkillData|get|skill_faction_dungeon|description|fr}}

Output:

Force du Triumvirat

Une fois par tour, le héros peut activer l’une des trois Postures en combat. La Posture active confère au héros un bonus de +2 à l’attribut correspondant.

Example 2: Dynamic Row Icon Assembly

To build a clean image list utilizing automated title capitalization rules on asset returns:

[[File:{{#invoke:SkillData|get|sub_skill_faction_dungeon_1|icon}}.png|28px]] '''{{#invoke:SkillData|get|sub_skill_faction_dungeon_1|name|{{{lang|en}}}}}'''

Output: Generates a layout rendering the formatted File:Sub_Skill_Faction_Dungeon_1_Icon.png element next to its corresponding localized title string.