Template:FactionDef: Difference between revisions
obelisk-bot: uploading initial Cargo templates |
obelisk-bot: Pushing translation table rework |
||
| Line 2: | Line 2: | ||
One row per faction (6 rows total: <code>human</code>, <code>undead</code>, <code>dungeon</code>, | One row per faction (6 rows total: <code>human</code>, <code>undead</code>, <code>dungeon</code>, | ||
<code>nature</code>, <code>demon</code>, <code>unfrozen</code>). Carries the structural data the | <code>nature</code>, <code>demon</code>, <code>unfrozen</code>). Carries the structural data the | ||
in-game faction record holds — | in-game faction record holds — biome, signature resource, asset references — plus the source SIDs. Display name and description (every language, English included) live in the shared [[Template:TranslationDef|Translation]] table. | ||
The bot emits one <code><nowiki>{{FactionDef | …}}</nowiki></code> template invocation at the top of each <code>Data:Faction/<id></code> page, immediately followed by | The bot emits one <code><nowiki>{{FactionDef | …}}</nowiki></code> template invocation at the top of each <code>Data:Faction/<id></code> page, immediately followed by one <code><nowiki>{{TranslationDef | …}}</nowiki></code> row per language. | ||
<code><nowiki>{{ | City-name pool entries are ''not'' on this page — they emit separately as <code>EntryDef</code> rows of <code>type=FactionCityName</code> (one row per city, see [[Template:EntryDef|<code>EntryDef</code>]]). | ||
City-name pool entries are ''not'' on this page — they emit separately as <code>EntryDef</code> rows of <code>type=FactionCityName</code> (one row per city, see [[Template:EntryDef|<code> | |||
Faction laws (the <code>fractionLawsLines</code> skill-tree structure in source JSON) are deferred — that ships when the dedicated FactionLaw work lands. Until then the law tree shape is not surfaced on the wiki. | Faction laws (the <code>fractionLawsLines</code> skill-tree structure in source JSON) are deferred — that ships when the dedicated FactionLaw work lands. Until then the law tree shape is not surfaced on the wiki. | ||
| Line 14: | Line 12: | ||
{{#cargo_declare:_table=Faction | {{#cargo_declare:_table=Faction | ||
| id = String (allowed values=human,undead,dungeon,nature,demon,unfrozen) | | id = String (allowed values=human,undead,dungeon,nature,demon,unfrozen) | ||
| icon = String | | icon = String | ||
| icon_faction_laws = String | | icon_faction_laws = String | ||
| Line 28: | Line 24: | ||
{{FactionDef | {{FactionDef | ||
| id = String (allowed values=human,undead,dungeon,nature,demon,unfrozen) | | id = String (allowed values=human,undead,dungeon,nature,demon,unfrozen) | ||
| icon = String | | icon = String | ||
| Line 37: | Line 31: | ||
| resource = String | | resource = String | ||
<!-- Localization references — display text lives in the Translation table, type='faction' --> | |||
| name_sid = String | | name_sid = String | ||
| desc_sid = String | | desc_sid = String | ||
| Line 46: | Line 41: | ||
== Field notes == | == Field notes == | ||
* '''<code>id</code>''' is the primary key. Six fixed values; <code>neutral</code> is ''not'' a faction here even though <code>FactionDef</code> enum includes it for unit classification — there's no <code>7_neutral.json</code> source file. | * '''<code>id</code>''' is the primary key. Six fixed values; <code>neutral</code> is ''not'' a faction here even though <code>FactionDef</code> enum includes it for unit classification — there's no <code>7_neutral.json</code> source file. | ||
* ''' | * '''Display name / description''' for every language (English included) live in the [[Template:TranslationDef|Translation]] table, <code>type='faction'</code>. Per HoMM tradition the faction's display name is the town-style name: "Temple", "Necropolis", "Dungeon", "Grove", "Hive", "Schism". | ||
* '''<code>icon</code>''' is the asset filename for the standard faction crest (e.g. <code>fraction_human</code>); the source JSON's misspelling is preserved here since it's an asset path, not a normalized concept. | * '''<code>icon</code>''' is the asset filename for the standard faction crest (e.g. <code>fraction_human</code>); the source JSON's misspelling is preserved here since it's an asset path, not a normalized concept. | ||
* '''<code>icon_faction_laws</code>''' is a separate icon used on the faction-laws panel (e.g. <code>Scroll_Faction_Human</code>). Renamed from JSON's <code>iconFractionLaws</code>. | * '''<code>icon_faction_laws</code>''' is a separate icon used on the faction-laws panel (e.g. <code>Scroll_Faction_Human</code>). Renamed from JSON's <code>iconFractionLaws</code>. | ||
| Line 59: | Line 54: | ||
== Related tables == | == Related tables == | ||
* [[ | * [[Template:TranslationDef|Translation]] — display text in every language (English included), joined on <code>id = Translation.target_id WHERE Translation.type='faction' AND Translation.language='{{{lang|en}}}'</code> (1:N, one row per language). | ||
* [[Template:EntryDef|<code>EntryDef</code>]] where <code>type='FactionCityName'</code> — joined via <code>subtype LIKE '<faction>_%'</code> to surface this faction's randomization-pool city names. | * [[Template:EntryDef|<code>EntryDef</code>]] where <code>type='FactionCityName'</code> — joined via <code>subtype LIKE '<faction>_%'</code> to surface this faction's randomization-pool city names. | ||
* [[Template:UnitDef|Unit]] — joined via <code>Unit.faction = Faction.id</code> (1:N). | * [[Template:UnitDef|Unit]] — joined via <code>Unit.faction = Faction.id</code> (1:N). | ||
| Line 68: | Line 63: | ||
</noinclude><includeonly>{{#cargo_store:_table=Faction | </noinclude><includeonly>{{#cargo_store:_table=Faction | ||
| id = {{{id|}}} | | id = {{{id|}}} | ||
| icon = {{{icon|}}} | | icon = {{{icon|}}} | ||
| icon_faction_laws = {{{icon_faction_laws|}}} | | icon_faction_laws = {{{icon_faction_laws|}}} | ||
Latest revision as of 20:48, 14 May 2026
One row per faction (6 rows total: human, undead, dungeon,
nature, demon, unfrozen). Carries the structural data the
in-game faction record holds — biome, signature resource, asset references — plus the source SIDs. Display name and description (every language, English included) live in the shared Translation table.
The bot emits one {{FactionDef | …}} template invocation at the top of each Data:Faction/<id> page, immediately followed by one {{TranslationDef | …}} row per language.
City-name pool entries are not on this page — they emit separately as EntryDef rows of type=FactionCityName (one row per city, see EntryDef).
Faction laws (the fractionLawsLines skill-tree structure in source JSON) are deferred — that ships when the dedicated FactionLaw work lands. Until then the law tree shape is not surfaced on the wiki.
Schema
This template defines the table "Faction". View table.
{{FactionDef
| id = String (allowed values=human,undead,dungeon,nature,demon,unfrozen)
| icon = String
| icon_faction_laws = String
| biome = String
| resource = String
<!-- Localization references — display text lives in the Translation table, type='faction' -->
| name_sid = String
| desc_sid = String
| source_path = String
}}
Field notes
idis the primary key. Six fixed values;neutralis not a faction here even thoughFactionDefenum includes it for unit classification — there's no7_neutral.jsonsource file.- Display name / description for every language (English included) live in the Translation table,
type='faction'. Per HoMM tradition the faction's display name is the town-style name: "Temple", "Necropolis", "Dungeon", "Grove", "Hive", "Schism". iconis the asset filename for the standard faction crest (e.g.fraction_human); the source JSON's misspelling is preserved here since it's an asset path, not a normalized concept.icon_faction_lawsis a separate icon used on the faction-laws panel (e.g.Scroll_Faction_Human). Renamed from JSON'siconFractionLaws.biomeis the faction's signature terrain (Grass,Deathland,Dirt,Autumn,Lava,Snow). One per faction, all distinct in the 2026-05-03 corpus.resourceis the faction's signature resource (gemstones,mercury,crystals). Renamed from JSON'sresourceName. Distribution: gemstones (human, dungeon), mercury (undead, unfrozen), crystals (nature, demon).source_pathis the JSON path relative toCore/, useful for audit / diff traceability.
Dropped from source
The source JSON's narrativeDesc field references SIDs of the form
<id>_narrative_desc that exist in no language file in the
2026-05-03 corpus. Dead pointer; we drop the field entirely. If a future patch populates the SIDs, we'll add the column back.
Related tables
- Translation — display text in every language (English included), joined on
id = Translation.target_id WHERE Translation.type='faction' AND Translation.language='en'(1:N, one row per language). EntryDefwheretype='FactionCityName'— joined viasubtype LIKE '<faction>_%'to surface this faction's randomization-pool city names.- Unit — joined via
Unit.faction = Faction.id(1:N).


