Module:FactionData/doc

From Heroes of Might and Magic: Olden Era Official Wiki
Revision as of 21:44, 25 May 2026 by akesha.taladim (talk | contribs)
(diff) ← Older revision | Latest revision (diff) | Newer revision → (diff)

This is the documentation page for Module:FactionData

This module provides dynamic extraction methods to pull technical properties, asset files, localized titles, and structural city pool names for game factions stored within the wiki's Cargo database (specifically querying the Faction and Translation tables). It automatically handles localization fallbacks to English if a translation record is missing.

Basic Syntax

Standard Fields

To extract standard metadata, files, or core texts:

{{#invoke:FactionData|get|FACTION_ID|VARIABLE|LANGUAGE_CODE}}

Affiliated City Names

To query the regional city registry bound to a faction via an index number:

{{#invoke:FactionData|get_city|FACTION_ID|CITY_INDEX|LANGUAGE_CODE}}
  • FACTION_ID : The technical database key of the faction (e.g., human, dungeon, necro).
  • VARIABLE : The specific variable keyword node to display (see the index below).
  • CITY_INDEX : The integer position slot of the city from the faction pool registry (e.g., from 1 to 14).
  • LANGUAGE_CODE : (Optional) The localization language code (e.g., en, fr, pl). Defaults to English (en).

---

Technical Reference Index

📝 Localized Text (Language-Dependent)

These fields query localized entries and dynamically adapt to the requested language code.

Variable Description Example Output (en)
name The localized public name of the faction alignment. Temple
description The historical lore synopsis and gameplay overview background block text. The Church of the Sun strives to forge...

⚙️ Core Technical Properties

Standard mechanical values extracted directly from the primary Faction table rows.

Variable Description Example Output
icon Core faction asset emblem token identifier. Forced automatic Title Case formatting applies natively. Fraction_Human
icon_faction_laws Religious law scroll illustration token identifier. Forced automatic Title Case formatting applies natively. Scroll_Faction_Human
biome The native graphical map grid terrain ecosystem type assigned to the faction. Grass
resource The primary unique rare trading material specialized by this faction. gemstones
source_path The server file track directory location of the original repository JSON structure data dump. DB/fractions/1_human.json

---

Practical Examples

Example 1: Localized Description Call

To fetch the French description of a specific faction layout block:

{{#invoke:FactionData|get|human|description|fr}}

Output: L’Église du Soleil s’efforce de forger la meilleure version de ses troupes polyvalentes...

Example 2: Compiling Faction Capital and Fort Names

You can easily list out structural localized strongholds from the pool registry using numerical indexes:

* '''Faction Capital:''' {{#invoke:FactionData|get_city|human|1|fr}}
* '''Secondary Keep:''' {{#invoke:FactionData|get_city|human|2|fr}}
* '''Holy Bastion:''' {{#invoke:FactionData|get_city|human|14|en}}

Output:

  • Faction Capital: Luminastra
  • Secondary Keep: L’étendue d’Arina
  • Holy Bastion: Sunspire

Example 3: Parsing Graphical Asset Headers

Render faction banners dynamically on overview hubs:

[[File:Banner {{#invoke:FactionData|get|human|icon}}.png|128px]]