Template:SubSkillDef: Difference between revisions
obelisk-bot: uploading initial Cargo templates |
obelisk-bot: Pushing translation table rework |
||
| (2 intermediate revisions by the same user not shown) | |||
| 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> | # N × <code><nowiki>{{TranslationDef | type=sub_skill | target_id=<id> | language=… | name=… | description=… }}</nowiki></code> — one row per language | ||
# 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 18: | Line 18: | ||
| variant = String | | variant = String | ||
| parent_skill_id = String | | parent_skill_id = String | ||
| name_sid = String | | name_sid = String | ||
| 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 --> | ||
<!-- Localization references — display text lives in the Translation table, type='sub_skill' --> | |||
| name_sid = String | | name_sid = String | ||
| desc_sid = String <!-- nullable --> | | desc_sid = String <!-- nullable --> | ||
| icon = String <!-- nullable --> | | icon = String <!-- nullable --> | ||
| Line 43: | Line 40: | ||
* '''<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_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| | * [[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_sid = {{{name_sid|}}} | | name_sid = {{{name_sid|}}} | ||
| desc_sid = {{{desc_sid|}}} | | desc_sid = {{{desc_sid|}}} | ||
| icon = {{{icon|}}} | | icon = {{{icon|}}} | ||
| source_path = {{{source_path|}}} | | source_path = {{{source_path|}}} | ||
}}</includeonly> | }} | ||
Created <code>SubSkill</code> entry: <code>{{{id|}}}</code></includeonly> | |||
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:
{{SubSkillDef | id=… | parent_skill_id=… | …}}- N ×
{{TranslationDef | type=sub_skill | target_id=<id> | language=… | name=… | description=… }}— one row per language - 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
idis the source JSON id (e.g.sub_skill_offense,arena_sub_skill_offense_old,sub_skill_marchOfWar).variantdistinguishes production / arena / campaign / test variants. Most analytical queries shouldWHERE variant = 'production'.parent_skill_idis derived: the id of the Skill whose{{SkillLevelDef}}rows include this sub-skill in theiroffered_sub_skillslist. NULL when no skill in the corpus references this sub-skill — those 77 orphans live on theData:Skill/_orphan_sub_skillscatch-all page (test entries + arena legacy*_old).name_sid/desc_sidpoint 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 onparent_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).


