Character Sheet Refinement (Savage)

From HLKitWiki
Revision as of 23:22, 19 February 2009 by Rob (talk | contribs)
(diff) ← Older revision | Latest revision (diff) | Newer revision → (diff)
Jump to navigationJump to search

Context: HL Kit … Authoring Examples … Savage Worlds Walk-Through 

Overview

Our basic character sheet is complete. Now we need to take a look at it and determine what is missing and/or needs to be refined.

Gap on Right

One mildly annoying facet of our character sheet is the gap that appears on the right side beneath the gear table. We need to position the adjustments and condition layout at the bottom in order to determine how much space we have left for everything else. However, if everything else doesn't need all that space, we're left with a gap that looks rather odd. It would probably look better if the layout at the bottom we positioned directly beneath the gear.

Fortunately, we can accomplish this very easily. After the gear layout is rendered within the Position script of the sheet, we can check to see if there is any open space beneath it. If there is open space, we can move the adjustments layout upwards so that it is placed immediately beneath the gear layout. This is achieved by adding the following lines of code to the very end of the Position script.

~if there is open space beneath the gear layout, move the adjustments upward
if (layout[oAdjust].top > layout[oGear].bottom + scenevalue[sectiongap]) then
  layout[oAdjust].top = layout[oGear].bottom + scenevalue[sectiongap]
  endif

Wait a minute. That's not going to work all the time. What if the gear layout doesn't fit? Looking back at all the special handling we've got for possibly omitting the gear and maybe the armory layouts, we have to handle all those cases for closing the gap. This entails extending our logic to the three different cases: gear layout present, gear layout omitted but armory layout present, and neither layout present. The revised script code should look like the following.

~if the gear layout is visible and there is open space beneath it, move the
~adjustments layout upward
if (layout[oGear].visible <> 0) then
  if (layout[oAdjust].top > layout[oGear].bottom + scenevalue[sectiongap]) then
    layout[oAdjust].top = layout[oGear].bottom + scenevalue[sectiongap]
    endif

~otherwise, do the same check with respect to the armory layout
elseif (layout[oArmory].visible <> 0) then
  if (layout[oAdjust].top > layout[oArmory].bottom + scenevalue[sectiongap]) then
    layout[oAdjust].top = layout[oArmory].bottom + scenevalue[sectiongap]
    endif

~otherwise, position relative to the right-side layout
else
  if (layout[oAdjust].top > layout[oRightSide].bottom + scenevalue[sectiongap]) then
    layout[oAdjust].top = layout[oRightSide].bottom + scenevalue[sectiongap]
    endif
  endif

Weapon Attacks

One thing we overlooked was the way we present the attack values for weapons. For attributes and skills, we actually show the proper die-type bitmap. However, weapon attacks simply show a text version. It would be perfectly reasonable to change the weapon attacks to show the proper die-type bitmaps instead, but it's also reasonable to use the text version. There's no "right" answer here, and switch to the die-type bitmaps will result in each weapon entry requiring a bit more space, both horizontally and vertically. Since we already have a limited amount of space for the weapon names and our vertical space is somewhat constrained as well, we're probably better off sticking with the text version. So that's what we'll go with for our finished character sheet.

Spillover Sheet

The question remains regarding what happens when material doesn't fit on the first page of the character sheet. The Skeleton files provide us with a spillover sheet for this purpose, but we haven't done anything with it yet. Now is an excellent time to review it, and we'll find it in the file "sheet_standard2.dat".

Looking at the existing sheet, it already includes armor, weapons, and gear. It simply re-uses that same table portals that are used on the first sheet, so any excess items that don't fit on the first page will be output in the same way on the second page.

We need to assess if there is anything else that might be dropped from the first page and need to spill onto the second page. While it is highly unlikely, there is one thing that could be spilled over: arcane powers. If a character has a huge number of powers, or if a character has lots of edges that wrapped to the right side and then there isn't room for all the powers, we could end up with powers needing to spill over. So we need to properly handle that within the second sheet.

This is easy to do. All that's required is to add a "portalref" element to the "oStandard2" layout that is used for the second page. Once that's done, we simply insert an appropriate automatic placement statement in the Position script for the new portal. The revised layout should look like the one below.

<layout
  id="oStandard2">
  <portalref portal="oPower"/>
  <portalref portal="oArmor"/>
  <portalref portal="oWeapon"/>
  <portalref portal="oGear"/>
  <position><![CDATA[
    ~position the various tables in the desired sequence
    perform portal[oPower].autoplace
    perform portal[oArmor].autoplace
    perform portal[oWeapon].autoplace
    perform portal[oGear].autoplace

    ~the height of the layout is the bottommost extent of the elements within
    height = autotop
    ]]></position>
  </layout>

That's all there is to it. We've now got full handling in place for anything that might not fit on the first page of the character sheet.