Revise Summary Panels (Savage)

From HLKitWiki
Revision as of 14:19, 14 January 2009 by Rob (Talk | contribs)

Jump to: navigation, search

Context: HL KitAuthoring Examples … Savage Worlds Walk-Through 

Overview

Everything is finally coming together nicely with our data files. At this point, it's probably a good idea to switch our focus over to the various summary panels that are displayed.

Assess the Contents

When is comes to the summary panels, the first thing we need to do is assess what information needs to be shown within the panels. This is most easily accomplished by simply making a list of the various pieces of information that should be included. A useful approach is to look at each of the main tabs within the interface and identify items that the user will likely want to refer to while looking at other tabs. After giving it some thought, the following list probably makes the most sense.

  • Attributes
  • Derived Attributes
  • Status Info (e.g. Encumbrance)
  • Skills
  • Edges
  • Hindrances
  • Racial Abilities
  • Armor
  • Hand Weapons
  • Ranged Weapons
  • Special Weapons

Organize the Information

The next step is to break the above list into logic groupings that will generally fit into a single summary panel. An important consideration during this step is that you need to create your data files with a small 800x600 display in mind. Even if you are using a huge display and keep the HL application at maximum size, your data files will also be used by some people on a small 800x600 display. So it's important that you keep each summary panel reasonably compact, if at all possible.

After you break things up, you can then decide on the appropriate sequence in which to show each set of information. For example, should hand weapons go above ranged weapons, or vice versa? When looking at the list of contents we identified above, there are a variety of suitable organizations, and the final determination really comes down to what you think works best. For our purposes, we'll settle on three separate summary panels that are organized as shown below.

  • Basics
    • Attributes
    • Derived Attributes
    • Status Info (e.g. Encumbrance)
  • Abilities
    • Edges
    • Hindrances
    • Racial Abilities
    • Skills
  • Armory
    • Armor
    • Hand Weapons
    • Ranged Weapons
    • Special Weapons

The Basics Panel

We can now set about configuring the first summary panel that contains all the basics of the character. We'll use the existing "Basics" panel, which can be found in the file "summ_basics.dat". There is already a table of attributes and another table of derived traits, so we don't need to add those. However, we do need a table in which to display the encumbrance and other status information.

Adding the new table starts with cloning one of the existing two tables. Once we clone it, we can then modify it for showing status information. We can look at the "baStatus" table used on the Basics tab for guidance regarding how to setup the new table. Since the format of the output will be different from standard traits, we'll also need to create a new template, which we'll name appropriately. The new table portal should look similar to the one below.

<portal
  id="smStatus"
  style="tblInvisSm">
  <table_fixed
    component="Resource"
    showtemplate="smResource"
    showsortset="explicit"
    scrollable="no">
    <list>Helper.Status</list>
    </table_fixed>
  </portal>

With the table in place, we now need to define a suitable template. We can clone the "smTrait" template and adapt it for our needs. We need to change the component set reference and the field which shows the value. We also need to give ourselves significantly more space for the value field, which can be done within the Position script. This yields a new template that looks like the following.

<template
  id="smResource"
  name="Summary Resource Pick"
  compset="Resource">

  <portal
    id="value"
    style="lblSummary">
    <label
      field="resShort">
      </label>
    </portal>

  <portal
    id="name"
    style="lblSummary">
    <label
      field="name">
      </label>
    </portal>

  <position><![CDATA[
    ~set up our height based on our tallest portal
    height = portal[name].height

    ~if this is a "sizing" calculation, we're done
    if (issizing <> 0) then
      done
      endif

    ~position the value on the left in a limited span and the name on the right
    portal[value].width = 55
    perform portal[name].alignrel[ltor,value,5]
    ]]></position>
  </template>

The final step is to add the new table portal into the layout. We'll place it beneath the existing two tables, so all we need to do is add the portal reference to the layout and then add an appropriate placement statement to the Position script. The resulting layout should look like the following.

<layout
  id="smBasics">
  <portalref portal="smAttrib"/>
  <portalref portal="smDerived"/>
  <portalref portal="smStatus"/>

  <position><![CDATA[
    ~position and size the tables to span the full layout
    perform portal[smAttrib].autoplace
    perform portal[smDerived].autoplace[20]
    perform portal[smStatus].autoplace[20]
    ]]></position>

  </layout>

We can now reload everything and see the results. The first thing we see is that the list of attributes includes our hidden attribute for super powers. We also see that the list of derived traits include various traits that should be hidden. So we need to add a suitable List tag expression to the two tables that limits the items that are shown. We can refer to the tables used on the Basics tab for how to handle this, at which point we'll determine that the two List tag expressions should be the ones shown below.

<list>!Hide.Attribute</list>

<list>!Hide.Trait</list>

Looking more closely at the lists of attributes and derived traits, we'll also realize that the information being shown is incorrect. The "trtFinal" field is being shown instead of the proper "trtDisplay" field. So we can fix this within the "value" portal of the "smTrait" template.

We should also provide more space for the display of the various trait values. If a trait is something especially wide like "d12+2", it will be cut off. So we can modify the Position script to double the width of the "value" portal to 40.

At this point, it looks like our summary panel is ready to go.

The Abilities Panel

The next summary panel is where we'll show all the various abilities for the character. As we did above, we'll adapt the existing "Abilities" panel, which can be found in the file "summ_abilities.dat".

The current panel contains two tables, one for skills and one for abilities. We want to re-use the skills and we'll adapt the abilities table for showing racial abilities. So that leaves us two tables short, as we need additional tables for showing edges and hindrances. This can be readily handled by copying the existing "smAbility" portal twice and revising each into the tables we need. Since edges and hindrances both derive from the "Ability" component, we can also share the same template across all three tables. This results in two new tables like the ones below.

<portal
  id="smEdge"
  style="tblInvisSm">
  <table_fixed
    component="Edge"
    showtemplate="smAbility"
    scrollable="no">
    </table_fixed>
  </portal>

<portal
  id="smHinder"
  style="tblInvisSm">
  <table_fixed
    component="Hindrance"
    showtemplate="smAbility"
    scrollable="no">
    </table_fixed>
  </portal>

We must now add the two table portals into the layout. We'll position the edges at the top, with the hindrances beneath it. Racial abilities and skills be follow. We'll also shrink the spacing between each grouping for this summary panel. This yields a revised layout that looks like the one below.

<layout
  id="smAbility">
  <portalref portal="smEdge"/>
  <portalref portal="smHinder"/>
  <portalref portal="smAbility"/>
  <portalref portal="smSkill"/>

  <position><![CDATA[
    ~position and size the tables to span the full layout
    perform portal[smEdge].autoplace
    perform portal[smHinder].autoplace[10]
    perform portal[smAbility].autoplace[10]
    perform portal[smSkill].autoplace[10]
    ]]></position>

  </layout>