Module:Unit/doc: Difference between revisions

From Heroes of Might and Magic: Olden Era Official Wiki
No edit summary
No edit summary
Line 92: Line 92:
| {{#invoke:Unit|get|Angel|damageMax}}
| {{#invoke:Unit|get|Angel|damageMax}}
|-
|-
| morale
| moral
| Default morale
| Default morale
| <pre>{{#invoke:Unit|get|Angel|morale}}</pre>
| <pre>{{#invoke:Unit|get|Angel|moral}}</pre>
| {{#invoke:Unit|get|Angel|morale}}
| {{#invoke:Unit|get|Angel|moral}}
|-
|-
| moralMin
| moralMin

Revision as of 12:45, 7 January 2026

Module for requesting characteristics of all existing units in Olden Era. Actual data is stored in Data:units.json.

Supported Commands

get

The module supports the main get command, through which you can retrieve individual unit attributes (listed below). The basic syntax of the command is:

{{#invoke:Unit|get|Unit Name|Property Name}}
Name Description Example Result
name Unit name (localized)
{{#invoke:Unit|get|Angel|name}}
Angel
description Narrative description (localized with data substitutions)
{{#invoke:Unit|get|Angel|description}}
The inquisition’s greatest belief is that angels still accompany their mission. The beings that aid the Templars in combat are but a mere imitation — a human soul willingly fused with winged armor, destined to continue the fight.
faction Unit faction
{{#invoke:Unit|get|Angel|faction}}
Temple
tier Unit tier
{{#invoke:Unit|get|Angel|tier}}
VII
nativeBiome Native biome
{{#invoke:Unit|get|Angel|nativeBiome}}
Grass
cost Hiring cost
{{#invoke:Unit|get|Angel|cost}}
2400Gold 1Gemstones
cost.gold
cost.resource
Access to specific property in unitCost object
{{#invoke:Unit|get|Angel|cost.gold}}
{{#invoke:Unit|get|Angel|cost.gemstones}}
2400
1
weeklyIncrement Base weekly increment from main building
{{#invoke:Unit|get|Angel|weeklyIncrement}}
1
expBonus Experience gained when defeating the unit
{{#invoke:Unit|get|Angel|expBonus}}
366
squadValue Squad value of the unit (used for army composition calculations)
{{#invoke:Unit|get|Angel|squadValue}}
3660
hp Maximum health
{{#invoke:Unit|get|Angel|hp}}
225
offence Offence parameter
{{#invoke:Unit|get|Angel|offence}}
30
defence Defence parameter
{{#invoke:Unit|get|Angel|defence}}
30
damageMin Minimum damage dealt
{{#invoke:Unit|get|Angel|damageMin}}
50
damageMax Maximum damage dealt
{{#invoke:Unit|get|Angel|damageMax}}
75
moral Default morale
{{#invoke:Unit|get|Angel|moral}}
0
moralMin Minimum morale value
{{#invoke:Unit|get|Angel|moralMin}}
-3
moralMax Maximum morale value
{{#invoke:Unit|get|Angel|moralMax}}
3
luck Default luck
{{#invoke:Unit|get|Angel|luck}}
0
luckMin Minimum luck value
{{#invoke:Unit|get|Angel|luckMin}}
-3
luckMax Maximum luck value
{{#invoke:Unit|get|Angel|luckMax}}
3
initiative Initiative
{{#invoke:Unit|get|Angel|initiative}}
8
speed Speed (movement per turn in hexes during combat)
{{#invoke:Unit|get|Angel|speed}}
4
baseClass Base class (describes basic passive abilities of the creature)
{{#invoke:Unit|get|Angel|baseClass}}
table
activeAbilities List of active abilities (activated manually during the unit's turn)
{{#invoke:Unit|get|Angel|activeAbilities}}
passiveAbilities List of passive abilities (act continuously)
{{#invoke:Unit|get|Angel|passiveAbilities}}
alternativeAttacks List of alternative attacks (selected manually during the unit's turn)
{{#invoke:Unit|get|Angel|alternativeAttacks}}
table
hireBuildingsInCity Buildings where the unit can be hired in the city
{{#invoke:Unit|get|Angel|hireBuildingsInCity}}
hireBuildingsOnMap Buildings where the unit can be hired on the map
{{#invoke:Unit|get|Angel|hireBuildingsOnMap}}
stats.property Access to specific property in stats object
{{#invoke:Unit|get|Angel|stats.hp}}
baseClass.property Access to specific property in baseClass object
{{#invoke:Unit|get|Angel|baseClass.name}}
Embodiment
cost.property Access to specific property in unitCost object
{{#invoke:Unit|get|Angel|cost.gold}}
2400
arrayName.index.property Access to specific property in array elements (e.g., activeAbilities.1.name)
{{#invoke:Unit|get|Angel|activeAbilities.1.name}}

Localization Support

The module supports localization in multiple languages. You can specify the language as an optional third parameter:

{{#invoke:Unit|get|Unit Name|Property Name|Language Code}}

For example:

  • {{#invoke:Unit|get|Angel|name|pl}}
    Anioł - Polish
  • {{#invoke:Unit|get|Angel|name|ru}}
    Ангел - Russian