Revamp the "Static" Form (Savage): Difference between revisions
No edit summary |
|||
(2 intermediate revisions by the same user not shown) | |||
Line 3: | Line 3: | ||
===Overview=== | ===Overview=== | ||
The area across the top of the main | The area across the top of the main HL window is referred to as the "static" form (or sometimes panel), and now is an excellent time to re-work its contents for Savage Worlds. The form contents are defined within the file "form_static.dat". | ||
===Replace Content === | ===Replace Content === | ||
The Skeleton data files provide a "static" | The Skeleton data files provide a "static" form with some standard, basic elements that we'll revise and adapt. The character name should almost never need to be changed, and we can definitely leave it untouched for Savage Worlds. Since Savage Worlds also supports multiple races, we can also leave the race chooser in place. For the remaining elements, we need to determine what users will find most helpful to have visible for Savage Worlds. While there is no "right" answer, we're going to settle on showing the character's health, power points, and Bennies. | ||
Looking at the contents of the "static" | Looking at the contents of the "static" form within the data files, there are three visual elements (portals and templates) that comprise the layout. All of the information that we're going to be replacing is found within the "stActor" template, so we'll focus our attention there. For each piece of information, there in one portal involved: a dynamic label that incorporates both a identifying prefix and the character data. We'll follow the same logic, resulting in three portals. For the health and power points, we can display the summary fields that are already being synthesized on the "Actor" component. For the Bennies, we'll need to directly access the value we want to display. The net result is the following three portals. | ||
<pre> | <pre> | ||
<portal | <portal | ||
id="health" | id="health" | ||
style="lblStatic"> | style="lblStatic"> | ||
<label | <label> | ||
<labeltext><![CDATA[ | |||
< | @text = "Health: " & herofield[acDmgSumm].text | ||
]]></labeltext> | |||
</label> | </label> | ||
</portal> | </portal> | ||
Line 39: | Line 25: | ||
id="power" | id="power" | ||
style="lblStatic"> | style="lblStatic"> | ||
<label | <label> | ||
<labeltext><![CDATA[ | |||
< | @text = "Power: " & herofield[acPPSumm].text | ||
]]></labeltext> | |||
</label> | </label> | ||
</portal> | </portal> | ||
Line 57: | Line 37: | ||
<label> | <label> | ||
<labeltext><![CDATA[ | <labeltext><![CDATA[ | ||
@text = hero.child[trkBennies].field[trkUser]. | @text = "Bennies: " & hero.child[trkBennies].field[trkUser].text | ||
]]></labeltext> | ]]></labeltext> | ||
</label> | </label> | ||
</portal> | </portal> | ||
</pre> | </pre> | ||
===Positioning Everything=== | ===Positioning Everything=== | ||
The positioning of the various portals within the template is quick and painless. All of the portals use the same style, so they all have the same height characteristics. Consequently, we can ignore vertical alignment altogether. Along the horizontal | The positioning of the various portals within the template is quick and painless. All of the portals use the same style, so they all have the same height characteristics. Consequently, we can ignore vertical alignment altogether. Along the horizontal axis, the portals simply line up, left to right, with suitable gaps between them. The final task we need to do is determine the dimensions of the template based on the contents within, so we simply determine the extent of the rightmost and bottommost portals. The only thing special we need to accommodate is that a character without an arcane background should not show any power points, so we need to hide it when necessary. This yields a Position script that looks something like the one below. | ||
<pre> | <pre> | ||
~position the health | ~position the health portal on the left | ||
portal[ | portal[health].left = 0 | ||
~position the power point | ~position the power point portal horizontally or hide it if not applicable | ||
var x as number | var x as number | ||
if (hero.tagis[Arcane.?] <> 0) then | if (hero.tagis[Arcane.?] <> 0) then | ||
perform portal[ | perform portal[power].alignrel[ltor,health,15] | ||
x = portal[power].right | x = portal[power].right | ||
else | else | ||
portal[power].visible = 0 | portal[power].visible = 0 | ||
x = portal[health].right | x = portal[health].right | ||
endif | endif | ||
~position the Bennies | |||
portal[ | ~position the Bennies portal horizontally | ||
portal[bennies].left = x + 15 | |||
~our | |||
~hide any portals that don't fully fit within the visible horizontal space | |||
if (portal[power].right > width) then | |||
portal[power].visible = 0 | |||
endif | |||
if (portal[bennies].right > width) then | |||
portal[bennies].visible = 0 | |||
endif | |||
~our height is the bottommost extent of our portals | |||
height = portal[bennies].bottom | height = portal[bennies].bottom | ||
</pre> | </pre> |
Latest revision as of 09:35, 18 December 2008
Context: HL Kit … Authoring Examples … Savage Worlds Walk-Through
Overview
The area across the top of the main HL window is referred to as the "static" form (or sometimes panel), and now is an excellent time to re-work its contents for Savage Worlds. The form contents are defined within the file "form_static.dat".
Replace Content
The Skeleton data files provide a "static" form with some standard, basic elements that we'll revise and adapt. The character name should almost never need to be changed, and we can definitely leave it untouched for Savage Worlds. Since Savage Worlds also supports multiple races, we can also leave the race chooser in place. For the remaining elements, we need to determine what users will find most helpful to have visible for Savage Worlds. While there is no "right" answer, we're going to settle on showing the character's health, power points, and Bennies.
Looking at the contents of the "static" form within the data files, there are three visual elements (portals and templates) that comprise the layout. All of the information that we're going to be replacing is found within the "stActor" template, so we'll focus our attention there. For each piece of information, there in one portal involved: a dynamic label that incorporates both a identifying prefix and the character data. We'll follow the same logic, resulting in three portals. For the health and power points, we can display the summary fields that are already being synthesized on the "Actor" component. For the Bennies, we'll need to directly access the value we want to display. The net result is the following three portals.
<portal id="health" style="lblStatic"> <label> <labeltext><![CDATA[ @text = "Health: " & herofield[acDmgSumm].text ]]></labeltext> </label> </portal> <portal id="power" style="lblStatic"> <label> <labeltext><![CDATA[ @text = "Power: " & herofield[acPPSumm].text ]]></labeltext> </label> </portal> <portal id="bennies" style="lblStatic"> <label> <labeltext><![CDATA[ @text = "Bennies: " & hero.child[trkBennies].field[trkUser].text ]]></labeltext> </label> </portal>
Positioning Everything
The positioning of the various portals within the template is quick and painless. All of the portals use the same style, so they all have the same height characteristics. Consequently, we can ignore vertical alignment altogether. Along the horizontal axis, the portals simply line up, left to right, with suitable gaps between them. The final task we need to do is determine the dimensions of the template based on the contents within, so we simply determine the extent of the rightmost and bottommost portals. The only thing special we need to accommodate is that a character without an arcane background should not show any power points, so we need to hide it when necessary. This yields a Position script that looks something like the one below.
~position the health portal on the left portal[health].left = 0 ~position the power point portal horizontally or hide it if not applicable var x as number if (hero.tagis[Arcane.?] <> 0) then perform portal[power].alignrel[ltor,health,15] x = portal[power].right else portal[power].visible = 0 x = portal[health].right endif ~position the Bennies portal horizontally portal[bennies].left = x + 15 ~hide any portals that don't fully fit within the visible horizontal space if (portal[power].right > width) then portal[power].visible = 0 endif if (portal[bennies].right > width) then portal[bennies].visible = 0 endif ~our height is the bottommost extent of our portals height = portal[bennies].bottom