Module:HeroData/doc

From Heroes of Might and Magic: Olden Era Official Wiki
Revision as of 17:06, 25 May 2026 by akesha.taladim (talk | contribs) (Created page with "This module allows for the dynamic extraction of all variables, stats, and translations for a specific hero 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:HeroData|get|HERO_ID|VARIABLE|LANGUAGE_CODE}}</pre> * '''<code>HERO_ID</code>''' : The technical identifier of the hero (e.g., <cod...")
(diff) ← Older revision | Latest revision (diff) | Newer revision → (diff)

This is the documentation page for Module:HeroData

This module allows for the dynamic extraction of all variables, stats, and translations for a specific hero 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:HeroData|get|HERO_ID|VARIABLE|LANGUAGE_CODE}}
  • HERO_ID : The technical identifier of the hero (e.g., dungeon_hero_10, necro_hero_16).
  • 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, pt_br). Defaults to English (en).

---

Available Variables

📝 Text & Translations (Language-Dependent)

These variables query the Translation table and dynamically adapt to the requested language code.

Variable Description Example Output (en)
name The full display name of the hero. Kelarr, son of Navarr
description The official lore biography / background story of the hero. Kelarr, a young minotaur, grew up in...
motto The hero's personal quote or motto. (Motto text)

⚔️ Core Combat Statistics

These variables return the initial numerical attributes of the hero from the main Hero table.

Variable Description
offence Starting Attack attribute.
defence Starting Defense attribute.
spell_power Starting Spell Power attribute.
intelligence Starting Knowledge / Intelligence attribute (Mana pool).
luck The hero's base Luck value.
morale The hero's base Morale value.
start_level Initial level when recruiting the hero (usually 1).
view_radius Sight radius / fog-of-war clearing range on the adventure map.

🎨 Identity & Assets

Technical variables describing the hero's classification and visual file naming conventions.

Variable Description Example Value
faction The hero's internal faction name (ideal for Navboxes and queries). dungeon, undead, temple, etc.
class_id The exact class ID assigned to the hero. magic_dungeon, might_undead, etc.
class_type The core archetype profile of the hero. magic or might
icon The exact file name string used for their profile avatar. hero_dungeon_10_Kelarr
source_path The file location path of the original data dump JSON. DB/heroes/dungeon/dungeon_hero_10.json

🧙‍♂️ Starting Skills & Spells (Lists)

These variables return comma-separated lists of raw database string identifiers.

Variable Description Example Output
start_skills Comma-joined list of starting skill IDs. skill_faction_dungeon,skill_enlightenment
start_skill_levels Skill mastery levels aligned positionally with the starting skills. 1,1
start_magics Comma-joined list of starting spell IDs. day_17_magic_clear_view
specialization_id Unique trait / passive capability ID for the hero. dungeon_hero_10_specialization

---

Practical Examples

Example 1: Creating a Dynamic Introduction Sentence

'''{{#invoke:HeroData|get|dungeon_hero_10|name|en}}''' is a ''{{#invoke:HeroData|get|dungeon_hero_10|class_type}}'' hero belonging to the '''{{#invoke:HeroData|get|dungeon_hero_10|faction}}''' faction.

Output:

**Kelarr, son of Navarr** is a *magic* hero belonging to the **dungeon** faction.

Example 2: Rendering a Hero Profile Picture

[[File:{{#invoke:HeroData|get|dungeon_hero_10|icon}}.png|64px|link=]]

Output: Dynamically embeds the image file hero_dungeon_10_Kelarr.png rendered at a 64px width constraint.