Lone Wolf Development Forums  

Go Back   Lone Wolf Development Forums > Hero Lab Forums > HL - Authoring Kit
Register FAQ Community Today's Posts Search

Notices

Reply
 
Thread Tools Display Modes
Vampyre
Member
 
Join Date: Sep 2013
Posts: 78

Old June 18th, 2014, 07:02 AM
Hello again,

So, I basically almost done it with the inches and feet to cm value. The only problem I have now with the code, is that it uses rounded value. When I apply to the right arrow, or left arrow, the value is not going up by one step increment, but by 3 (2.54 rounded). Do you guys have a better code for bringing the height of a character to cm instead of the imperial system ? I will change the weight as well for my character, but if those two values (height and weight) are both stored in imperial, it's ok, as long as I can enter them and read them as being metric ?

Many thanks for the help !

Quote:
<!-- Height of the actor (in cm) -->
<field
id="perHeight"
name="Height"
type="user"
maxfinal="20"
defvalue="68">
<!-- Bound the age to within the limits specified for the actor -->
<bound phase="Render" priority="10000"><![CDATA[
@minimum = field[perHtMin].value
@maximum = field[perHtMax].value
]]></bound>
<!-- Final value for display is converted from inches to feet and inches -->
<finalize><![CDATA[
~calculate the height in terms of feet and inches
var feet as number
var inches as number
feet = @value * 2.54
feet = round(feet,0,-1)
inches = @value - (feet * 12)

~synthesize appropriate text to display the height properly
@text = feet & " cm"
if (inches <> 0) then
@text = @text & " " & inches & chr(34)
endif
]]></finalize>
</field>

Last edited by Vampyre; June 18th, 2014 at 07:12 AM.
Vampyre is offline   #1 Reply With Quote
Mathias
Senior Member
Lone Wolf Staff
 
Join Date: May 2005
Posts: 13,213

Old June 18th, 2014, 08:20 AM
It sounds like you simply want to delete the imperial calculations and store the value as cm. That won't allow for direct import of characters - the data in one version will be stored as a number of inches and in the other version as a number of cm, but it will mean that each click of the arrows increases or decreases the value by 1cm.
Mathias is offline   #2 Reply With Quote
Vampyre
Member
 
Join Date: Sep 2013
Posts: 78

Old June 18th, 2014, 09:32 AM
Thank you Matthias, I wasn't sure there wouldn't be other implications if I didn't made a calculation there. Thanks for the confirmation, I will modify the code then
Vampyre is offline   #3 Reply With Quote
Reply


Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off

Forum Jump


All times are GMT -8. The time now is 04:20 AM.


Powered by vBulletin® - Copyright ©2000 - 2024, vBulletin Solutions, Inc.
wolflair.com copyright ©1998-2016 Lone Wolf Development, Inc. View our Privacy Policy here.