Character Sheet Phase 2 (Savage)

From HLKitWiki
Revision as of 15:48, 16 January 2009 by Rob (Talk | contribs) (Swapping Sections Around)

Jump to: navigation, search

Context: HL KitAuthoring Examples … Savage Worlds Walk-Through 

Overview

Our character sheet is starting to come together. We've got some of the most basic sections in place and we've got some momentum going, so we'll keep on rolling.

Swapping Sections Around

At this point, we need to make some structural adjustments to the sheet provided with the Skeleton files. We want to use the skills and special abilities sections, but they are currently shown in the righthand column. Similarly, armor and weapons are on the left, but we want to show them on the right. So the next thing we'll do is move these sections around, after which we can resume editing the individual sections.

Armor and weapons are both encapsulated by the "oArmory" layout, so we can move both of those at the same time by moving the layout. There are some interesting wrinkles associated with this layout that we'll need to deal with at some point, but we don't need to worry about them now. The "oArmory" layout is managed directly by the sheet, so we can move it to the right column within the Position script of the sheet. We'll have to fix this later, but for now we'll just move it to the bottom on the right side of the sheet. This is accomplished by moving the code that positions the layout to the end of the script and revising it properly for being at the bottom on the right. The new code should look like below.

~position the armory layout within the remaining space on the right
layout[oArmory].width = colwidth
layout[oArmory].top = layout[oRightSide].bottom + global[sectiongap]
layout[oArmory].left = layout[oLogos].left
layout[oArmory].height = extent - global[sectiongap] - layout[oArmory].top
perform layout[oArmory].render

The next thing we need to do is move the skills and abilities sections from the right side to the left side. Fortunately, doing this is extremely easy. The skills and abilities are both handled via separate table portals. Both of these portals are currently managed within the "oRightSide" layout and positioned via the "autoplace" mechanism. Consequently, all we need to do is move them into the "oLeftSide" layout and place them properly within the new Position script.

Within the "oRightSide" layout, delete the two "portalref" elements for the "oAbility" and "oSkills" portals. Now go to the "oLeftSide" layout and add the elements there. Return to the "oRightSide" layout and delete the two "autoplace" operations on the portals we just removed. Then go to the "oLeftSide" layout and insert the two lines of code into the Position script there. When you're done, the two revised layouts should look like the below.

<layout
  id="oLeftSide">
  <portalref portal="oHeroName"/>
  <portalref portal="oHeroInfo"/>
  <portalref portal="oAttribute"/>
  <portalref portal="oDerived"/>
  <portalref portal="oSkills"/>
  <portalref portal="oAbility"/>
  <position><![CDATA[
    ~position the hero name at the top with the hero details beneath the name
    perform portal[oHeroName].autoplace[0]
    perform portal[oHeroInfo].autoplace[15]

    ~position the tables next
    perform portal[oAttribute].autoplace
    perform portal[oDerived].autoplace
    perform portal[oSkills].autoplace
    perform portal[oAbility].autoplace

    ~our layout height is the extent of the elements within
    height = autotop
    ]]></position>
  </layout>
<layout
  id="oRightSide">
  <portalref portal="oGear"/>
  <templateref template="oPortrait" thing="actor"/>
  <position><![CDATA[
    ~position the character portrait at the top and the various tables beneath
    perform template[oPortrait].autoplace
    perform portal[oGear].autoplace

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

That's all there is to it. Reload the data files and preview the character. Everything has now been swapped the way we intended.

Skills

Racial Abilities

Hindrances

Edges