View Single Post
AndrewD2
Senior Member
 
Join Date: Mar 2007
Location: Muskegon, MI
Posts: 2,975

Old July 20th, 2014, 01:26 PM
Hi I'm Andrew, I usually do work for Pathfinder and am learning Shadow Run 5, but I've also decided to take a dive into the Authoring Kit (after having it for about a year) and learn the inner workings of Hero Lab.

I've started working my way through the example code converting the skeleton files to Savage Worlds (while reading the unofficial documentation file when I'm away from the computer).

I'm just early on in the first trait section. I've gone through adding the limits of 2-6 to the system and those are working fine, but when I go to change the display to dice it isn't changing. I've virtually copied the code from the wiki to the traits file and it just says as numbers.

My code is:
Code:
            <eval index="4" phase="Render" priority="5000" name="Calc trtDisplay">
	    <after name="Calc trtFinal"/><![CDATA[
		  ~if this is a derived trait, let it determine its own value for display
                   doneif (tagis[component.Derived] <> 0)
		  
		  ~bound our final value including in-play adjustments
		  var final as number
		  final = field[trtFinal].value
		  if (final < 2) then
		    final = 2
		  elseif (final > 6) then
		    final = 6
			endif
			
		  ~convert final value for the trait to the proper die type for display
		  var dietype as number
		  var display as string
		  dietype = final * 2
		  display = "d" & dietype
		  
		  ~put the final result in the proper field
		  field[trtDisplay].text = display
		  ]]></eval>
Now I notice when I view the fields on one of the traits and see the trtDisplay field it is shown correct but it doesn't display correcly in the in the interface. Am I missing something or is there a step I'm not accounting for somewhere?

Thanks for any help,
Andrew
AndrewD2 is offline   #1 Reply With Quote