Module:HeroSpecializationData/doc

From Heroes of Might and Magic: Olden Era Official Wiki

This is the documentation page for Module:HeroSpecializationData

This module allows for the dynamic extraction of variables, asset icons, and translations for hero specializations stored within the wiki's Cargo database (specifically from the HeroSpecialization and Translation tables). 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:HeroSpecializationData|get|SPEC_ID|VARIABLE|LANGUAGE_CODE}}
  • SPEC_ID : The technical identifier of the specialization (e.g., dungeon_hero_3_specialization).
  • 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 using the type="hero_specialization" filter and dynamically adapt to the requested language code.

Variable Description Example Output (fr)
name The localized name of the specialization. Frappe venimeuse
description The localized description detailing exact combat modifiers, formula math, and passive scaling behaviors. Son coup héroïque inflige +10 point(s) de dégâts...

🎨 Assets & Technical Properties

Technical variables mapped out in the core specialization table (queried from the HeroSpecialization table).

Variable Description Example Output
icon The exact filename string used for the specialization asset. dungeon_hero_3_specialization_icon
source_path The file path location of the original data dump JSON. DB/heroes_specializations/specializations_dungeon.json

---

Practical Examples

Example 1: Fetching Localized Names and Descriptions

To display the French name and description for the hero 3 dungeon specialization:

'''{{#invoke:HeroSpecializationData|get|dungeon_hero_3_specialization|name|fr}}'''<br>
{{#invoke:HeroSpecializationData|get|dungeon_hero_3_specialization|description|fr}}

Output:

Frappe venimeuse
Son coup héroïque inflige +10 point(s) de dégâts (+5 tous les 6 niveau(x) de héros). De plus, il empoisonne la cible...

Example 2: Complete Template Row Automatic Link Integration

If you are displaying a row from a main hero context page and have access to the hero's specialization_id variable:

[[File:{{#invoke:HeroSpecializationData|get|{{{specialization_id}}}|icon}}.png|64px]]
'''{{#invoke:HeroSpecializationData|get|{{{specialization_id}}}|name|{{{lang|en}}}}}'''