Template:UnitAbilityDef: Difference between revisions

From Heroes of Might and Magic: Olden Era Official Wiki
obelisk-bot: uploading initial Cargo templates
 
obelisk-bot: Pushing translation table rework
 
(2 intermediate revisions by the same user not shown)
Line 2: Line 2:
Parent table. One row per ability slot on every unit, regardless of type. Identity + L10n keys only — type-specific scalars live in splinter tables joined on <code>ability_id</code>.
Parent table. One row per ability slot on every unit, regardless of type. Identity + L10n keys only — type-specific scalars live in splinter tables joined on <code>ability_id</code>.


The wiki-side templates (<code>{{ActiveAbility}}</code>, <code>{{PassiveAbility}}</code>, …) each call <code>#cargo_store</code> against this table AND against their respective splinter table in a single template invocation. The bot picks the right template name per row based on <code>ability_type</code>.
The wiki-side templates (<code><nowiki>{{ActiveAbility}}</nowiki></code>, <code><nowiki>{{PassiveAbility}}</nowiki></code>, …) each call <code>#cargo_store</code> against this table AND against their respective splinter table in a single template invocation. The bot picks the right template name per row based on <code>ability_type</code>.


== Schema ==
== Schema ==
Line 11: Line 11:
| ordinal = Integer
| ordinal = Integer
| variant = String (allowed values=base,advanced,upg,upg_alt)
| variant = String (allowed values=base,advanced,upg,upg_alt)
| name = String
| desc = Wikitext
| name_sid = String
| name_sid = String
| desc_sid = String
| desc_sid = String
Line 24: Line 22:
| ordinal = Integer
| ordinal = Integer
| variant = String (allowed values=base,advanced,upg,upg_alt)
| variant = String (allowed values=base,advanced,upg,upg_alt)
| name = String
<!-- Localization references — display text lives in the Translation table, type='unit_ability' -->
| desc = Wikitext
| name_sid = String
| name_sid = String
| desc_sid = String
| desc_sid = String
Line 38: Line 35:
** <code>buff</code> / <code>debuff</code> / <code>selfbuff</code> / <code>additionbuff</code> / <code>copy_buff</code> / <code>curse</code> / <code>blood</code> / <code>other</code> — discovered via SID family but have no unit-side splinter. Their payload lives in a future <code>Buff</code> table keyed on <code>name_sid</code>.
** <code>buff</code> / <code>debuff</code> / <code>selfbuff</code> / <code>additionbuff</code> / <code>copy_buff</code> / <code>curse</code> / <code>blood</code> / <code>other</code> — discovered via SID family but have no unit-side splinter. Their payload lives in a future <code>Buff</code> table keyed on <code>name_sid</code>.
* '''<code>variant</code>''' is <code>null</code> for the base/default form, <code>"advanced"</code> / <code>"upg"</code> / <code>"upg_alt"</code> for the appropriate variant SID family. Two rows with the same <code>(unit_id, ability_type, ordinal)</code> but different <code>variant</code> represent the same ability slot in different unit tiers.
* '''<code>variant</code>''' is <code>null</code> for the base/default form, <code>"advanced"</code> / <code>"upg"</code> / <code>"upg_alt"</code> for the appropriate variant SID family. Two rows with the same <code>(unit_id, ability_type, ordinal)</code> but different <code>variant</code> represent the same ability slot in different unit tiers.
* '''<code>name</code> / <code>desc</code>''' are the English defaults. Translations are in <code>UnitAbilityTranslation</code>, joined on <code>ability_id</code>.
* '''Display name / description''' for every language (English included) live in the [[Template:TranslationDef|Translation]] table, <code>type='unit_ability'</code>, joined on <code>ability_id = Translation.target_id</code>. <code>name_sid</code>/<code>desc_sid</code> stay here for traceability only.


== Related tables ==
== Related tables ==
Line 47: Line 44:
* [[Template:UnitAbilityAuraDef|UnitAbilityAura]] — splinter for <code>aura</code>.
* [[Template:UnitAbilityAuraDef|UnitAbilityAura]] — splinter for <code>aura</code>.
* [[Template:UnitAbilityStatPassiveDef|UnitAbilityStatPassive]] — splinter for <code>stat_passive</code>.
* [[Template:UnitAbilityStatPassiveDef|UnitAbilityStatPassive]] — splinter for <code>stat_passive</code>.
* [[UnitAbilityTranslation]] — i18n companion (1:1).
* [[Template:TranslationDef|Translation]] — display text in every language (English included), joined on <code>ability_id = Translation.target_id WHERE Translation.type='unit_ability' AND Translation.language='{{{lang|en}}}'</code> (1:N, one row per language).
* [[Template:UnitDef|Unit]] — parent on <code>unit_id = id</code> (N:1).
* [[Template:UnitDef|Unit]] — parent on <code>unit_id = id</code> (N:1).


Line 59: Line 56:
| ordinal = {{{ordinal|}}}
| ordinal = {{{ordinal|}}}
| variant = {{{variant|}}}
| variant = {{{variant|}}}
| name = {{{name|}}}
| desc = {{{desc|}}}
| name_sid = {{{name_sid|}}}
| name_sid = {{{name_sid|}}}
| desc_sid = {{{desc_sid|}}}
| desc_sid = {{{desc_sid|}}}
}}</includeonly>
}}
Created <code>UnitAbility</code> entry: <code>{{{ability_id|}}}</code></includeonly>

Latest revision as of 20:48, 14 May 2026

Parent table. One row per ability slot on every unit, regardless of type. Identity + L10n keys only — type-specific scalars live in splinter tables joined on ability_id.

The wiki-side templates ({{ActiveAbility}}, {{PassiveAbility}}, …) each call #cargo_store against this table AND against their respective splinter table in a single template invocation. The bot picks the right template name per row based on ability_type.

Schema

This template defines the table "UnitAbility". View table.

{{UnitAbilityDef
| ability_id = String                         <!-- synthetic; primary join key -->
| unit_id = String
| ability_type = String (allowed values=active,passive,conditional_passive,global_passive,aura,stat_passive,buff,debuff,selfbuff,additionbuff,copy_buff,curse,blood,other)
| ordinal = Integer
| variant = String (allowed values=base,advanced,upg,upg_alt)
<!-- Localization references — display text lives in the Translation table, type='unit_ability' -->
| name_sid = String
| desc_sid = String
}}

Field notes

  • ability_id is the universal join key. Format: <unit_id>[_<ability_type>]<ordinal>[<variant>], where active is omitted from the type slot and base is omitted from the variant slot. See docs/cargo/README.md for the full convention.
  • ability_type is the discriminator. The wiki layer uses it to decide which splinter to join against.
    • active — formerly named ability in older patches. Joined to UnitAbilityActiveDef.
    • passive / conditional_passive / global_passive / aura / stat_passive — each joined to its like-named splinter.
    • buff / debuff / selfbuff / additionbuff / copy_buff / curse / blood / other — discovered via SID family but have no unit-side splinter. Their payload lives in a future Buff table keyed on name_sid.
  • variant is null for the base/default form, "advanced" / "upg" / "upg_alt" for the appropriate variant SID family. Two rows with the same (unit_id, ability_type, ordinal) but different variant represent the same ability slot in different unit tiers.
  • Display name / description for every language (English included) live in the Translation table, type='unit_ability', joined on ability_id = Translation.target_id. name_sid/desc_sid stay here for traceability only.

Related tables

Notes