Template:SubSkillDef: 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 10: Line 10:


# <code><nowiki>{{SubSkillDef | id=… | parent_skill_id=… | …}}</nowiki></code>
# <code><nowiki>{{SubSkillDef | id=… | parent_skill_id=… | …}}</nowiki></code>
# <code><nowiki>{{TranslationDef | type=sub_skill | target_id=<id> | …}}</nowiki></code>
# N × <code><nowiki>{{TranslationDef | type=sub_skill | target_id=<id> | language=… | name=… | description=… }}</nowiki></code> — one row per language
# M × <code><nowiki>{{BonusDef | parent_type=sub_skill | parent_id=<id> | … }}</nowiki></code>
# M × <code><nowiki>{{BonusDef | parent_type=sub_skill | parent_id=<id> | … }}</nowiki></code>


Line 18: Line 18:
| variant = String
| variant = String
| parent_skill_id = String
| parent_skill_id = String
| name = String
| name_sid = String
| name_sid = String
| description = Wikitext
| desc_sid = String
| desc_sid = String
| icon = String
| icon = String
Line 31: Line 29:
| variant = String              <!-- production / arena / campaign / test -->
| variant = String              <!-- production / arena / campaign / test -->
| parent_skill_id = String      <!-- nullable; null for orphans -->
| parent_skill_id = String      <!-- nullable; null for orphans -->
| name = String                <!-- resolved English -->
<!-- Localization references — display text lives in the Translation table, type='sub_skill' -->
| name_sid = String
| name_sid = String
| description = Wikitext              <!-- resolved English; nullable -->
| desc_sid = String            <!-- nullable -->
| desc_sid = String            <!-- nullable -->
| icon = String                <!-- nullable -->
| icon = String                <!-- nullable -->
Line 44: Line 41:
* '''<code>variant</code>''' distinguishes production / arena / campaign / test variants. Most analytical queries should <code>WHERE variant = 'production'</code>.
* '''<code>variant</code>''' distinguishes production / arena / campaign / test variants. Most analytical queries should <code>WHERE variant = 'production'</code>.
* '''<code>parent_skill_id</code>''' is derived: the id of the [[Template:SkillDef|Skill]] whose <code><nowiki>{{SkillLevelDef}}</nowiki></code> rows include this sub-skill in their <code>offered_sub_skills</code> list. NULL when no skill in the corpus references this sub-skill — those 77 orphans live on the <code>Data:Skill/_orphan_sub_skills</code> catch-all page (test entries + arena legacy <code>*_old</code>).
* '''<code>parent_skill_id</code>''' is derived: the id of the [[Template:SkillDef|Skill]] whose <code><nowiki>{{SkillLevelDef}}</nowiki></code> rows include this sub-skill in their <code>offered_sub_skills</code> list. NULL when no skill in the corpus references this sub-skill — those 77 orphans live on the <code>Data:Skill/_orphan_sub_skills</code> catch-all page (test entries + arena legacy <code>*_old</code>).
* '''<code>name_sid</code> / <code>desc_sid</code>''' point at the L10n entries; <code>name</code> / <code>desc</code> are the resolved English mirrors.
* '''<code>name_sid</code> / <code>desc_sid</code>''' point at the L10n entries, surfaced for traceability. Display name / description for every language (English included) live in the [[Template:TranslationDef|Translation]] table, <code>type='sub_skill'</code>.


== Related tables ==
== Related tables ==
Line 50: Line 47:
* [[Template:SkillLevelDef|SkillLevel]] — joined on <code>SkillLevel.offered_sub_skills HOLDS SubSkill.id</code> (N:M; a sub-skill is typically offered at exactly one (skill, level) but the relation is general).
* [[Template:SkillLevelDef|SkillLevel]] — joined on <code>SkillLevel.offered_sub_skills HOLDS SubSkill.id</code> (N:M; a sub-skill is typically offered at exactly one (skill, level) but the relation is general).
* [[Template:BonusDef|<code>BonusDef</code>]] — joined on <code>parent_type='sub_skill' AND parent_id = SubSkill.id</code>.
* [[Template:BonusDef|<code>BonusDef</code>]] — joined on <code>parent_type='sub_skill' AND parent_id = SubSkill.id</code>.
* [[Template:TranslationDef|<code>TranslationDef</code>]] — one row per sub-skill with <code>type=sub_skill</code>, <code>target_id=id</code>.
* [[Template:TranslationDef|Translation]] — display text in every language (English included), joined on <code>id = Translation.target_id WHERE Translation.type='sub_skill' AND Translation.language='{{{lang|en}}}'</code> (1:N, one row per language).


[[Category:Cargo Definitions]]
[[Category:Cargo Definitions]]
Line 57: Line 54:
| variant = {{{variant|}}}
| variant = {{{variant|}}}
| parent_skill_id = {{{parent_skill_id|}}}
| parent_skill_id = {{{parent_skill_id|}}}
| name = {{{name|}}}
| name_sid = {{{name_sid|}}}
| name_sid = {{{name_sid|}}}
| description = {{{description|}}}
| desc_sid = {{{desc_sid|}}}
| desc_sid = {{{desc_sid|}}}
| icon = {{{icon|}}}
| icon = {{{icon|}}}

Latest revision as of 20:48, 14 May 2026

Flat per-sub-skill ("perk") record. 617 rows in 2026-05-05: 203 production + 203 arena + 203 campaign + 8 test. Each sub-skill is a discrete pickable perk that the player chooses when their hero gains a skill mastery level — e.g. picking "Offense" vs "Defense" off the skill_assault Basic-mastery offering.

Sub-skills don't have levels of their own; they're flat. They carry identity (id, variant), display fields (name + desc + icon), the parent skill they were offered by (recovered from scanning every skill level's offered_sub_skills list), and the bonuses they grant. Bonuses flow into the unified BonusDef table with parent_type='sub_skill'.

Page layout

Sub-skills are inlined on their parent skill's page (Data:Skill/<parent_skill_id>) — they share the page with the parent's {{SkillDef}}, {{SkillLevelDef}}, and per-skill {{TranslationDef}} rows. The 77 unreferenced sub-skills (8 test + ~69 arena legacy *_old) emit onto the catch-all page Data:Skill/_orphan_sub_skills with parent_skill_id=NULL.

Each sub-skill contributes:

  1. {{SubSkillDef | id=… | parent_skill_id=… | …}}
  2. N × {{TranslationDef | type=sub_skill | target_id=<id> | language=… | name=… | description=… }} — one row per language
  3. M × {{BonusDef | parent_type=sub_skill | parent_id=<id> | … }}

Schema

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

{{SubSkillDef
| id = String
| variant = String              <!-- production / arena / campaign / test -->
| parent_skill_id = String      <!-- nullable; null for orphans -->
<!-- Localization references — display text lives in the Translation table, type='sub_skill' -->
| name_sid = String
| desc_sid = String             <!-- nullable -->
| icon = String                 <!-- nullable -->
| source_path = String
}}

Field notes

  • id is the source JSON id (e.g. sub_skill_offense, arena_sub_skill_offense_old, sub_skill_marchOfWar).
  • variant distinguishes production / arena / campaign / test variants. Most analytical queries should WHERE variant = 'production'.
  • parent_skill_id is derived: the id of the Skill whose {{SkillLevelDef}} rows include this sub-skill in their offered_sub_skills list. NULL when no skill in the corpus references this sub-skill — those 77 orphans live on the Data:Skill/_orphan_sub_skills catch-all page (test entries + arena legacy *_old).
  • name_sid / desc_sid point at the L10n entries, surfaced for traceability. Display name / description for every language (English included) live in the Translation table, type='sub_skill'.

Related tables

  • Skill — joined on parent_skill_id = Skill.id (N:1).
  • SkillLevel — joined on SkillLevel.offered_sub_skills HOLDS SubSkill.id (N:M; a sub-skill is typically offered at exactly one (skill, level) but the relation is general).
  • BonusDef — joined on parent_type='sub_skill' AND parent_id = SubSkill.id.
  • Translation — display text in every language (English included), joined on id = Translation.target_id WHERE Translation.type='sub_skill' AND Translation.language='en' (1:N, one row per language).