Template:HadezCharData

From BattleMaster Wiki
Revision as of 09:15, 7 February 2021 by Vita` (talk | contribs)
(diff) ← Older revision | Latest revision (diff) | Newer revision → (diff)
Jump to navigation Jump to search
Template-info.svg Semantic Coded Template
This template contains semantic coding. Do not use this template for anything other than its intended purpose.
Template-info.svg Template Documentation
This documentation is transcluded from Template:HadezCharData/doc.

ExamplesSandbox

Summary

This template displays character details, updated in real-time, taken from the game.

This template is to be used only on character pages as it sets some character-specific semantic tags.

There are currently three display formats..

  • box - traditional infobox that sits at the right of the page.
  • plain - basic list of the character's details suitable for putting in a box or at the foot of the page.
  • prose - describes the character details in sentences; suitable for use as a character page introduction.

Nice features include..

  • Easy to use.
  • All details updated in real-time from game data.
  • Box, Plain and Prose formats.
  • Automatically sets some important semantic tags.
  • Automatically adds links to regions, families and characters pages if they exist.
  • Automatically works out character's liege.
  • Automatically works out character's positions in their realm.
  • Gender aware (correctly uses he/she, his/her, duke/duchess).

Author: Wraith0x29a

Examples and Usage

See the examples page.

Parameters

world_id - (required) - The ID of the world the character exists in.
char_name or char_id - (required) - The first name or the ID of the character.
format - (required) - The format to display the output in (current options are 'prose', 'plain' or 'box').
background - (optional) - The HTML color code to use for the box format background.
header - (optional) - The HTML color code to use for the box format header background.
list - (optional) - The HTML color code to use for the box format list background (left hand column).
value - (optional) - The HTML color code to use for the box format values background (right hand column).

If invalid world or character parameters are entered (user error or if a character has died or been deleted) nothing is shown at all.

HTML hexadecimal based color codes (eg. #AA0000 for mid red) should include the # prefix.
The default color-scheme of tasteful greys is used if the color parameters are omitted for the box format.

Semantic Tags

The template adds 'member of:' semantic tags that mark the character as a member of their family and region.

Known Issues

As characters vary there may be cases where this template does not work as expected. Please report these in the discussion page for this template. Particularly I want to test that the feature that works out and displays a character's liege works correctly.

If using multiple instances of this template on a page be aware that errors in the parameters to one instance of the template may cause values from the previous instance of the template to be used. This can cause unexpected results. This appears to be an unavoidable consequence of the way the underlying wiki system works. Thanks to Kag for helping highlight this bug.

There is no way to discover from the game data API whether or not a character gets a tax share from their region and so whether they are a knight or simple noble. They are listed by this template simply as Nobles.

Differentiating between the different types of non-duke local lords (Baron, Count, Viscount, Marques etc) is next to impossible so all are listed as 'Lord'.

As with all templates that use live game data to add semantic properties to a page the semantic properties are only updated when the page containing the template is saved. This is a known issue with the underlying wiki. A fix has been identified and may be implemented in the future.

Bugs

The template currently has problems with undefined data where.. the character's region is not part of a realm or the character's realm has no ruler.
Odd results will be shown for related values these cases.
This is (slowly) being fixed.