Template:HeroSpecializationDef: 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 |
||
| Line 8: | Line 8: | ||
<code>Data:HeroSpecialization/<id></code> carries: | <code>Data:HeroSpecialization/<id></code> carries: | ||
# <code><nowiki>{{HeroSpecializationDef | id=… | | # <code><nowiki>{{HeroSpecializationDef | id=… | icon=… | name_sid=… | desc_sid=… | …}}</nowiki></code> | ||
# <code><nowiki>{{TranslationDef | type=hero_specialization | target_id=<id> | …}}</nowiki></code> | # N × <code><nowiki>{{TranslationDef | type=hero_specialization | target_id=<id> | language=… | …}}</nowiki></code> — one row per language | ||
# N × <code><nowiki>{{HeroSpecializationBonus | spec_id=<id> | ordinal=N | …}}</nowiki></code> (1367 total bonus rows across all 126 specs) | # N × <code><nowiki>{{HeroSpecializationBonus | spec_id=<id> | ordinal=N | …}}</nowiki></code> (1367 total bonus rows across all 126 specs) | ||
| Line 15: | Line 15: | ||
{{#cargo_declare:_table=HeroSpecialization | {{#cargo_declare:_table=HeroSpecialization | ||
| id = String | | id = String | ||
| name_sid = String | | name_sid = String | ||
| desc_sid = String | | desc_sid = String | ||
| Line 26: | Line 24: | ||
{{HeroSpecializationDef | {{HeroSpecializationDef | ||
| id = String | | id = String | ||
| | | icon = String | ||
<!-- Localization references — display text lives in the Translation table, type='hero_specialization' --> | |||
| name_sid = String | | name_sid = String | ||
| desc_sid = String | | desc_sid = String | ||
| source_path = String | | source_path = String | ||
}} | }} | ||
| Line 37: | Line 34: | ||
== Field notes == | == Field notes == | ||
* '''<code>id</code>''' is the source JSON id (e.g. <code>human_hero_1_specialization</code>, <code>campaign_hero_4_specialization</code>). The <code>_specialization</code> suffix is preserved. | * '''<code>id</code>''' is the source JSON id (e.g. <code>human_hero_1_specialization</code>, <code>campaign_hero_4_specialization</code>). The <code>_specialization</code> suffix is preserved. | ||
* '''<code>name_sid</code> / <code>desc_sid</code>''' point at the L10n entries (e.g. <code>human_hero_1_spec_name</code> / <code>human_hero_1_spec_description</code>). Description text is heavy with <code>{0}</code>/<code>{1}</code> placeholders for stat values; the resolver substitutes via the standard pipeline before storing. | * '''<code>name_sid</code> / <code>desc_sid</code>''' point at the L10n entries (e.g. <code>human_hero_1_spec_name</code> / <code>human_hero_1_spec_description</code>), surfaced for traceability. Description text is heavy with <code>{0}</code>/<code>{1}</code> placeholders for stat values; the resolver substitutes via the standard pipeline before storing the translation. | ||
* ''' | * '''Display name / description''' for every language (English included) live in the [[Template:TranslationDef|Translation]] table, <code>type='hero_specialization'</code>. | ||
* '''No <code>hero_id</code> back-reference.''' The Hero → HeroSpecialization direction is sufficient (forward join via <code>Hero.specialization_id = HeroSpecialization.id</code>). Reverse queries — "which hero has this spec" — work via the same join | * '''No <code>hero_id</code> back-reference.''' The Hero → HeroSpecialization direction is sufficient (forward join via <code>Hero.specialization_id = HeroSpecialization.id</code>). Reverse queries — "which hero has this spec" — work via the same join. | ||
== Related tables == | == Related tables == | ||
* [[Template:HeroDef|Hero]] — joined on <code>id = Hero.specialization_id</code> (1:1 in practice; the schema permits N:1 in case a future patch shares specs across heroes). | * [[Template:HeroDef|Hero]] — joined on <code>id = Hero.specialization_id</code> (1:1 in practice; the schema permits N:1 in case a future patch shares specs across heroes). | ||
* [[HeroSpecializationBonus]] — joined on <code>id = spec_id</code> (1:N). | * [[HeroSpecializationBonus]] — joined on <code>id = spec_id</code> (1:N). | ||
* [[Template:TranslationDef| | * [[Template:TranslationDef|Translation]] — display text in every language (English included), joined on <code>id = Translation.target_id WHERE Translation.type='hero_specialization' AND Translation.language='{{{lang|en}}}'</code> (1:N, one row per language). | ||
== Notes == | == Notes == | ||
| Line 51: | Line 48: | ||
</noinclude><includeonly>{{#cargo_store:_table=HeroSpecialization | </noinclude><includeonly>{{#cargo_store:_table=HeroSpecialization | ||
| id = {{{id|}}} | | id = {{{id|}}} | ||
| name_sid = {{{name_sid|}}} | | name_sid = {{{name_sid|}}} | ||
| desc_sid = {{{desc_sid|}}} | | desc_sid = {{{desc_sid|}}} | ||
Latest revision as of 20:48, 14 May 2026
One row per hero specialization (126 in the 2026-05-03 corpus: 108 faction + 9 campaign + 5 tutorial + 4 test). Each spec is the unique passive that distinguishes one hero mechanically — every Hero record carries specialization_id pointing at one of these.
The specialization carries identity (name, desc, icon) plus a list of structured bonuses[] effects that compose the spec's mechanical impact. Bonuses are emitted as inline
{{HeroSpecializationBonus}} rows on the same wiki page.
Page layout
Data:HeroSpecialization/<id> carries:
{{HeroSpecializationDef | id=… | icon=… | name_sid=… | desc_sid=… | …}}- N ×
{{TranslationDef | type=hero_specialization | target_id=<id> | language=… | …}}— one row per language - N ×
{{HeroSpecializationBonus | spec_id=<id> | ordinal=N | …}}(1367 total bonus rows across all 126 specs)
Schema
This template defines the table "HeroSpecialization". View table.
{{HeroSpecializationDef
| id = String
| icon = String
<!-- Localization references — display text lives in the Translation table, type='hero_specialization' -->
| name_sid = String
| desc_sid = String
| source_path = String
}}
Field notes
idis the source JSON id (e.g.human_hero_1_specialization,campaign_hero_4_specialization). The_specializationsuffix is preserved.name_sid/desc_sidpoint at the L10n entries (e.g.human_hero_1_spec_name/human_hero_1_spec_description), surfaced for traceability. Description text is heavy with{0}/{1}placeholders for stat values; the resolver substitutes via the standard pipeline before storing the translation.- Display name / description for every language (English included) live in the Translation table,
type='hero_specialization'. - No
hero_idback-reference. The Hero → HeroSpecialization direction is sufficient (forward join viaHero.specialization_id = HeroSpecialization.id). Reverse queries — "which hero has this spec" — work via the same join.
Related tables
- Hero — joined on
id = Hero.specialization_id(1:1 in practice; the schema permits N:1 in case a future patch shares specs across heroes). - HeroSpecializationBonus — joined on
id = spec_id(1:N). - Translation — display text in every language (English included), joined on
id = Translation.target_id WHERE Translation.type='hero_specialization' AND Translation.language='en'(1:N, one row per language).


