Template:HeroStartSquadDef: Difference between revisions

From Heroes of Might and Magic: Olden Era Official Wiki
obelisk-bot: uploading initial Cargo templates
obelisk-bot: Renaming unit_sid -> unit_id in squads
 
(One intermediate revision by the same user not shown)
Line 9: Line 9:
| variant = String (allowed values=primary,alt)
| variant = String (allowed values=primary,alt)
| slot = Integer
| slot = Integer
| unit_sid = String
| unit_id = String
| min = Integer
| min = Integer
| max = Integer
| max = Integer
Line 19: Line 19:
| variant = String (allowed values=primary,alt)
| variant = String (allowed values=primary,alt)
| slot = Integer                  <!-- 1-based position within the variant -->
| slot = Integer                  <!-- 1-based position within the variant -->
| unit_sid = String               <!-- joins Unit.id -->
| unit_id = String               <!-- joins Unit.id -->
| min = Integer
| min = Integer
| max = Integer
| max = Integer
Line 27: Line 27:
== Field notes ==
== Field notes ==
* '''Primary key is <code>(hero_id, variant, slot)</code>'''.
* '''Primary key is <code>(hero_id, variant, slot)</code>'''.
* '''<code>variant</code>''' distinguishes the source's parallel arrays <code>startSquad</code> (primary) and <code>startSquadAlt</code> (alt). Source data has alt as always exactly 1 slot of the form <code>(unit_sid, min=1, max=1)</code> in the 2026-05-03 corpus, but the schema preserves min/max in case future patches diverge.
* '''<code>variant</code>''' distinguishes the source's parallel arrays <code>startSquad</code> (primary) and <code>startSquadAlt</code> (alt). Source data has alt as always exactly 1 slot of the form <code>(unit_id, min=1, max=1)</code> in the 2026-05-03 corpus, but the schema preserves min/max in case future patches diverge.
* '''<code>unit_sid</code>''' references a <code>Unit.id</code> (e.g. <code>esquire</code>, <code>crossbowman</code>, <code>griffin</code>).
* '''<code>unit_id</code>''' references a <code>Unit.id</code> (e.g. <code>esquire</code>, <code>crossbowman</code>, <code>griffin</code>). The source JSON's key is <code>sid</code> but the column name uses <code>_id</code> to match the foreign-key convention used elsewhere — the <code>_sid</code> suffix is reserved for L10n token references.
* '''<code>min</code>/<code>max</code>''' define the random count range for that slot at battle start. Primary slots have meaningful ranges (e.g. 14-20 esquires); alt slots are typically 1-1.
* '''<code>min</code>/<code>max</code>''' define the random count range for that slot at battle start. Primary slots have meaningful ranges (e.g. 14-20 esquires); alt slots are typically 1-1.


== Related tables ==
== Related tables ==
* [[Template:HeroDef|Hero]] — joined on <code>hero_id = id</code> (N:1).
* [[Template:HeroDef|Hero]] — joined on <code>hero_id = id</code> (N:1).
* [[Template:UnitDef|Unit]] — joined on <code>unit_sid = id</code> (N:1).
* [[Template:UnitDef|Unit]] — joined on <code>unit_id = id</code> (N:1).


== Notes ==
== Notes ==
Line 42: Line 42:
| variant = {{{variant|}}}
| variant = {{{variant|}}}
| slot = {{{slot|}}}
| slot = {{{slot|}}}
| unit_sid = {{{unit_sid|}}}
| unit_id = {{{unit_id|}}}
| min = {{{min|}}}
| min = {{{min|}}}
| max = {{{max|}}}
| max = {{{max|}}}
}}</includeonly>
}}
Created <code>HeroStartSquad</code> entry: <code>{{{hero_id|}}} (variant {{{variant|}}}, slot {{{slot|}}})</code></includeonly>

Latest revision as of 00:53, 14 May 2026

One row per slot in a hero's starting army. Each hero has 1-3 primary slots (variant=primary) and 1 alt slot (variant=alt). Across the 108 faction heroes in the 2026-05-03 corpus: 100 have 3 primary slots, 5 have 2, 3 have 1; all 108 have exactly 1 alt slot.

The bot emits these rows on the parent Data:Hero/<id> page, after the {{HeroDef}} and {{TranslationDef}} blocks.

Schema

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

{{HeroStartSquadDef
| hero_id = String                <!-- joins Hero.id -->
| variant = String (allowed values=primary,alt)
| slot = Integer                  <!-- 1-based position within the variant -->
| unit_id = String                <!-- joins Unit.id -->
| min = Integer
| max = Integer
}}

Field notes

  • Primary key is (hero_id, variant, slot).
  • variant distinguishes the source's parallel arrays startSquad (primary) and startSquadAlt (alt). Source data has alt as always exactly 1 slot of the form (unit_id, min=1, max=1) in the 2026-05-03 corpus, but the schema preserves min/max in case future patches diverge.
  • unit_id references a Unit.id (e.g. esquire, crossbowman, griffin). The source JSON's key is sid but the column name uses _id to match the foreign-key convention used elsewhere — the _sid suffix is reserved for L10n token references.
  • min/max define the random count range for that slot at battle start. Primary slots have meaningful ranges (e.g. 14-20 esquires); alt slots are typically 1-1.

Related tables

  • Hero — joined on hero_id = id (N:1).
  • Unit — joined on unit_id = id (N:1).

Notes