Template:SubSkillDef: Difference between revisions

From Heroes of Might and Magic: Olden Era Official Wiki
obelisk-bot: uploading initial Cargo templates
 
obelisk-bot: uploading initial Cargo templates
Line 5: Line 5:


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


Each sub-skill contributes:
Each sub-skill contributes:


# <code>{{SubSkillDef | id=… | parent_skill_id=… | …}}</code>
# <code><nowiki>{{SubSkillDef | id=… | parent_skill_id=… | …}}</nowiki></code>
# <code>{{TranslationDef | type=sub_skill | target_id=<id> | …}}</code>
# <code><nowiki>{{TranslationDef | type=sub_skill | target_id=<id> | …}}</nowiki></code>
# M × <code>{{BonusDef | parent_type=sub_skill | parent_id=<id> | … }}</code>
# M × <code><nowiki>{{BonusDef | parent_type=sub_skill | parent_id=<id> | … }}</nowiki></code>


== Schema ==
== Schema ==
Line 20: Line 20:
| name = String
| name = String
| name_sid = String
| name_sid = String
| desc = Wikitext
| description = Wikitext
| desc_sid = String
| desc_sid = String
| icon = String
| icon = String
Line 33: Line 33:
| name = String                <!-- resolved English -->
| name = String                <!-- resolved English -->
| name_sid = String
| name_sid = String
| desc = Wikitext              <!-- resolved English; nullable -->
| description = Wikitext              <!-- resolved English; nullable -->
| desc_sid = String            <!-- nullable -->
| desc_sid = String            <!-- nullable -->
| icon = String                <!-- nullable -->
| icon = String                <!-- nullable -->
Line 43: Line 43:
* '''<code>id</code>''' is the source JSON id (e.g. <code>sub_skill_offense</code>, <code>arena_sub_skill_offense_old</code>, <code>sub_skill_marchOfWar</code>).
* '''<code>id</code>''' is the source JSON id (e.g. <code>sub_skill_offense</code>, <code>arena_sub_skill_offense_old</code>, <code>sub_skill_marchOfWar</code>).
* '''<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>{{SkillLevelDef}}</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; <code>name</code> / <code>desc</code> are the resolved English mirrors.


Line 59: Line 59:
| name = {{{name|}}}
| name = {{{name|}}}
| name_sid = {{{name_sid|}}}
| name_sid = {{{name_sid|}}}
| desc = {{{desc|}}}
| description = {{{description|}}}
| desc_sid = {{{desc_sid|}}}
| desc_sid = {{{desc_sid|}}}
| icon = {{{icon|}}}
| icon = {{{icon|}}}
| source_path = {{{source_path|}}}
| source_path = {{{source_path|}}}
}}</includeonly>
}}</includeonly>

Revision as of 00:02, 13 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. {{TranslationDef | type=sub_skill | target_id=<id> | …}}
  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 -->
| name = String                 <!-- resolved English -->
| name_sid = String
| description = Wikitext               <!-- resolved English; nullable -->
| 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; name / desc are the resolved English mirrors.

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.
  • TranslationDef — one row per sub-skill with type=sub_skill, target_id=id.