Difference between revisions of "Template:HadezCharData/doc"

From BattleMaster Wiki
Jump to navigation Jump to search
m
m
Line 7: Line 7:
 
It is to be used on character pages only as it sets some character-specific semantic tags.
 
It is to be used on character pages only as it sets some character-specific semantic tags.
  
There are currently two display formats, a 'prose' version suitable for use as an introduction at the top of a character's page and a 'plain' list of the character's details suitable for putting in a box or at the foot of the page. There will be a formatted infobox style format with colour and image options coming soon.
+
There are currently three display formats, and infobox style 'box' that sits at the right of the page, a 'plain' list of the character's details suitable for putting in a box or at the foot of the page and a 'prose' version suitable for use as an introduction at the top of a character's page.  
  
 
Author: [[User:Wraith0x29a|Wraith0x29a]]
 
Author: [[User:Wraith0x29a|Wraith0x29a]]
Line 16: Line 16:
 
<b>char_name</b> or <b>char_id</b> - (required)  - The first name or the ID of the character.<br>
 
<b>char_name</b> or <b>char_id</b> - (required)  - The first name or the ID of the character.<br>
 
<b>format</b> - (required) - The format to display the output in (current options are 'prose' or 'plain').
 
<b>format</b> - (required) - The format to display the output in (current options are 'prose' or 'plain').
 +
<b>background</b> - (optional) - The HTML color code to use for the box format background.
 +
<b>header</b> - (optional) - The HTML color code to use for the box format header background.
 +
<b>list</b> - (optional) - The HTML color code to use for the box format list background (left hand column).
 +
<b>value</b> - (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.
 
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.<br>
 +
The default color-scheme of tasteful greys is used if the color parameters are omitted for the box format.
  
 
===Examples===
 
===Examples===
 
(<i>nb. To avoid tagging this page with semantic tags for the character involved the example output below is hard-coded on this page, not  generated from the template</i>)
 
(<i>nb. To avoid tagging this page with semantic tags for the character involved the example output below is hard-coded on this page, not  generated from the template</i>)
 
====Prose Format====
 
<nowiki>{{HadezCharData|world_id=6|char_name=Erisha|format=prose}}</nowiki>
 
 
<b>Erisha</b> [[Da Hadez Family|Da Hadez]] is a [[warrior]]-[[hero]] in the realm of [[Oritolon]] on the [[Colonies]] continent. She is 57 years old, is [[Lord]] of [[Iglavik]] and has 173 honour and 45 prestige. Her liege is Cleatus  Maggot, [[Duke]] of [[Oritolon]].
 
  
 
====Plain Format====
 
====Plain Format====
 
<nowiki>{{HadezCharData|world_id=6|char_id=977|format=plain}}</nowiki>
 
<nowiki>{{HadezCharData|world_id=6|char_id=977|format=plain}}</nowiki>
  
<b>Erisha</b> [[Da Hadez Family|Da Hadez]]<br>
+
Erisha [[Da Hadez Family|Da Hadez]]<br>
 
Class: [[Warrior]] / [[Hero]]<br>
 
Class: [[Warrior]] / [[Hero]]<br>
 
Age: 57<br>
 
Age: 57<br>
Line 36: Line 38:
 
Prestige: 45<br>
 
Prestige: 45<br>
 
Positions: [[Lord]] of [[Iglavik]]<br>
 
Positions: [[Lord]] of [[Iglavik]]<br>
Region: Iglavik ( lord: <b>Erisha</b> [[Da Hadez Family|Da Hadez]] )<br>
+
Region: Iglavik ( lord: Erisha [[Da Hadez Family|Da Hadez]] )<br>
 
Duchy: [[Oritolon]] ( duke: Cleatus Maggot)<br>
 
Duchy: [[Oritolon]] ( duke: Cleatus Maggot)<br>
 
Realm: [[Oritolon]] ( ruler: [[Octavius Family/Antonine|Antonine]] [[Octavius Family|Octavius]] )<br>
 
Realm: [[Oritolon]] ( ruler: [[Octavius Family/Antonine|Antonine]] [[Octavius Family|Octavius]] )<br>
 
Continent: [[Colonies]]<br>
 
Continent: [[Colonies]]<br>
 
Liege: Cleatus Maggot
 
Liege: Cleatus Maggot
 +
 +
====Prose Format====
 +
<nowiki>{{HadezCharData|world_id=6|char_name=Erisha|format=prose}}</nowiki>
 +
 +
<b>Erisha</b> [[Da Hadez Family|Da Hadez]] is a [[warrior]]-[[hero]] in the realm of [[Oritolon]] on the [[Colonies]] continent. She is 57 years old, is [[Lord]] of [[Iglavik]] and has 173 honour and 45 prestige. Her liege is Cleatus  Maggot, [[Duke]] of [[Oritolon]].
 +
 +
====Box Format====
 +
 +
<table width="250" style="float: right; font-size: 95%; text-align: left; border-collapse: collapse; margin-left: 1em; background: #555555;">
 +
<tr>
 +
<td colspan="2" style="background: #FF00FF; text-align:center; font-weight:bold;">
 +
Erisha  [[Da Hadez Family|Da Hadez]]</td>
 +
</tr><tr>
 +
<td align="left" valign="top" style="padding: 5px; background: #00FFFF; font-weight:bold;">Class</td>
 +
<td align="left" valign="top" style="padding: 5px; background: #FFFF00; font-weight:bold;">[[Warrior]] / [[Hero]]</td>
 +
 +
</tr><tr>
 +
<td align="left" valign="top" style="padding: 5px; background: #00FFFF; font-weight:bold;">Age<br />Honour<br />Prestige</td>
 +
<td align="left" valign="top" style="padding: 5px; background: #FFFF00; font-weight:bold;">57<br />173<br />45</td>
 +
</tr><tr>
 +
<td align="left" valign="top" style="padding: 5px; background: #00FFFF; font-weight:bold;">Liege</td>
 +
<td align="left" valign="top" style="padding: 5px; background: #FFFF00; font-weight:bold;">Cleatus Maggot</td>
 +
</tr><tr>
 +
<td align="left" valign="top" style="padding: 5px; background: #00FFFF; font-weight:bold;">Positions</td>
 +
 +
<td align="left" valign="top" style="padding: 5px; background: #FFFF00;">[[Lord]] of [[Iglavik]]</td>
 +
</tr><tr>
 +
<td align="left" valign="top" style="padding: 5px; background: #00FFFF;"><b>Region</b><br />lord</td>
 +
<td align="left" valign="top" style="padding: 5px; background: #FFFF00;"><b>[[Iglavik]]</b><br />
 +
Erisha  [[Da_Hadez_Family|Da Hadez]]</td>
 +
</tr><tr>
 +
<td align="left" valign="top" style="padding: 5px; background: #00FFFF;"><b>Duchy</b><br />duke</td>
 +
 +
<td align="left" valign="top" style="padding: 5px; background: #FFFF00;"><b>[[Oritolon]]</b><br />
 +
Cleatus Maggot</td>
 +
</tr><tr>
 +
<td align="left" valign="top" style="padding: 5px; background: #00FFFF;"><b>Realm</b><br />ruler</td>
 +
<td align="left" valign="top" style="padding: 5px; background: #FFFF00;"><b>[[Oritolon]]</b><br />
 +
[[Octavius Family/Antonine|Antonine]] [[Octavius Family|Octavius]]</td>
 +
</tr><tr>
 +
<td align="left" valign="top" style="padding: 5px; background: #00FFFF; font-weight:bold;">Continent</td>
 +
 +
<td align="left" valign="top" style="padding: 5px; background: #FFFF00;"><b>[[Colonies]]</b></td>
 +
</tr>
 +
</table>
 +
 +
(approximate example shown to the right of page)
 +
 +
<nowiki>{{HadezCharData</nowiki><br>
 +
<nowiki>|world_id=6</nowiki><br>
 +
<nowiki>|char_name=Erisha</nowiki><br>
 +
<nowiki>|format=box</nowiki><br>
 +
<nowiki>|background=#555555</nowiki><br>
 +
<nowiki>|header=#FF00FF</nowiki><br>
 +
<nowiki>|list=#00FFFF</nowiki><br>
 +
<nowiki>|value=#FFFF00</nowiki><br>
 +
<nowiki>}}</nowiki>
  
 
===Semantic Tags===
 
===Semantic Tags===
Line 52: Line 111:
 
Particularly I want to test that the feature that works out and displays a character's liege works correctly.
 
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 an 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 system works. Thanks to [[User:Kagurati|Kag]] for helping discover this bug.
+
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 [[User:Kagurati|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.
 
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'.
 
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'.
 
Links to the page on which the template is used (which should always be a character page) are bolded to show there are links back to the same page.
 

Revision as of 01:18, 4 December 2009

Summary

This is a work in progress and my first attempt at serious wiki-fiddling so be gentle :)

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

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

There are currently three display formats, and infobox style 'box' that sits at the right of the page, a 'plain' list of the character's details suitable for putting in a box or at the foot of the page and a 'prose' version suitable for use as an introduction at the top of a character's page.

Author: Wraith0x29a

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' or 'plain'). 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.

Examples

(nb. To avoid tagging this page with semantic tags for the character involved the example output below is hard-coded on this page, not generated from the template)

Plain Format

{{HadezCharData|world_id=6|char_id=977|format=plain}}

Erisha Da Hadez
Class: Warrior / Hero
Age: 57
Honour: 173
Prestige: 45
Positions: Lord of Iglavik
Region: Iglavik ( lord: Erisha Da Hadez )
Duchy: Oritolon ( duke: Cleatus Maggot)
Realm: Oritolon ( ruler: Antonine Octavius )
Continent: Colonies
Liege: Cleatus Maggot

Prose Format

{{HadezCharData|world_id=6|char_name=Erisha|format=prose}}

Erisha Da Hadez is a warrior-hero in the realm of Oritolon on the Colonies continent. She is 57 years old, is Lord of Iglavik and has 173 honour and 45 prestige. Her liege is Cleatus Maggot, Duke of Oritolon.

Box Format

Erisha Da Hadez
Class Warrior / Hero
Age
Honour
Prestige
57
173
45
Liege Cleatus Maggot
Positions Lord of Iglavik
Region
lord
Iglavik
Erisha Da Hadez
Duchy
duke
Oritolon
Cleatus Maggot
Realm
ruler
Oritolon
Antonine Octavius
Continent Colonies

(approximate example shown to the right of page)

{{HadezCharData
|world_id=6
|char_name=Erisha
|format=box
|background=#555555
|header=#FF00FF
|list=#00FFFF
|value=#FFFF00
}}

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'.