This article is an introduction to the rather complex system of infoboxes used on the wiki. Fear not, it's actually somewhat less complicated than it appears.
Overview[]
In order to match the complexity of the Total War system and avoid hardcoding data into pages (which is a bit of a bad idea come every patch), the wiki breaks down the information into a system of templates. Let's use Spearmen (Shields) as an example.[1] The markup is as follows:
{{Infobox unit |image =wh_main_emp_spearmen_shield.png |faction =[[Empire]] |type =[[File:infantry_spear.png|right|30px]] Empire spear infantry |general ={{wh_main_emp_inf_spearmen_1 general}} |main ={{wh_main_emp_inf_spearmen_1 main}} |melee ={{wh_main_emp_spear}} |ranged = |armor ={{wh_main_emp_light}} |shield ={{wh_missile_block_30_metal}} |attributes ={{wh_chargeReflectorVsL_hideForest}} |unit size = 120 |unit speed =31 }}
Several fields are self-explanatory. The image is either the in-game shot or the army bar portrait of the unit in question. Faction, type, unit size, and speed are also easy to follow. But what in Sigmar's name is the rest of those?
Breakdown[]
Each template belongs to a specific category and defines a portion of the unit's properties. The following table breaks these relationships down. First comes the base infobox, then the constituent templates from top to bottom.
{{Infobox unit |image =wh_main_emp_spearmen_shield.png |faction =[[Empire]] |type =[[File:infantry_spear.png|right|30px]] Empire spear infantry |main ={{wh_main_emp_inf_spearmen_1 main}} |general ={{wh_main_emp_inf_spearmen_1 general}} |melee ={{wh_main_emp_spear}} |ranged = |armor ={{wh_main_emp_light}} |shield ={{wh_missile_block_30_metal}} |attributes ={{wh_chargeReflectorVsL_hideForest}} |unit size = 120 |unit speed =31 }}
|
|
Bulletpoints[]
- The bulletpoints in the main body of the article are based on db/ui_unit_bullet_point_unit_overrides_tables. The localizations are contained within text/db/ui_unit_bullet_point_enums.loc.
Total War: Warhammer III updates[]
- With the release of the final Total War game set in the Warhammer Fantasy universe, our infoboxes did change somewhat. The most important element is the inclusion of the id variable (
id =
), which uses the unit's internal name (eg.wh_main_emp_inf_spearmen_0
) to pull data directly from templates. Most of these use the #switch parser function. - The ID is used by the Infobox template to set a variable (
unit_id
), which is then passed to the different Switch templates automatically:- Template:Melee weapons wh3 and Template:Ranged weapons wh3 will display the weapons used by the unit.
- Template:Unit sizes lists all unit sizes.
- Template:Unit armor wh3 lists the corresponding armor templates.
- To update the infoboxes with new units, be sure to set the right unit id, then add entries to the above templates as necessary.
- Note: The above behavior only happens when corresponding infobox fields are left empty, otherwise, whatever's in the article overrides it.
- Other functions
- Notably, the next infobox comes with separate fields for races (
race =
) and factions (faction =
). Race should be input without brackets and will be parsed as-is. Furthermore, the infobox autocategorizes the unit based on the race field and the type input. For the sake of consistency, top-level categories should only use the top categories found in the army builder menu accessible in the game.
Notes[]
It's a bit on the complex side. Here are some more notes:
- The basic convention is to retain the internal configuration name (wh_main_emp_inf_spearmen_1 in this case) where possible, for consistency. Main and general templates are distinguished by the suffix.
- It's best to use the base templates mentioned above to add new units, otherwise you're going to get a headache.
- Seriously, this is very complex. Scream at Tagaziel very loud if something's unclear.
References[]
- ↑ Also check out the strategy section, it's brilliant.