Lone Wolf Development Forums  

Go Back   Lone Wolf Development Forums > Hero Lab Forums > HL - Authoring Kit

Notices

Reply
 
Thread Tools Display Modes
Mathias
Senior Member
Lone Wolf Staff
 
Join Date: May 2005
Posts: 13,207

Old April 10th, 2013, 08:23 AM
TCArknight, here's the wiki page about dynamic tables: http://hlkitwiki.wolflair.com/index....Element_(Data)

The answer you're looking for is in the section labeled "headerpick"
Mathias is offline   #21 Reply With Quote
Kairos
Senior Member
Volunteer Data File Author
 
Join Date: Feb 2009
Posts: 173

Old April 10th, 2013, 09:06 AM
Just ran into this problem myself. Add this attribute:

headerpick="some_thing"

to the dynamic_table element.

[Sorry. Posted this before I refreshed the thread].

Last edited by Kairos; April 10th, 2013 at 09:17 AM. Reason: Oops.
Kairos is offline   #22 Reply With Quote
TCArknight
Senior Member
 
Join Date: Jan 2007
Location: NW Arkansas
Posts: 1,321

Old April 11th, 2013, 07:03 AM
I appreciate the help! That's now working.

I don't have the code in front of me as I'm at work, but I'm running into an issue for displaying the gadget output.

I have a foreach loop stepping through each gadget on the hero. I'm able to output the name field with no issue. However, when I try to use another foreach loop to step through the children on the gadget, I get an error message. Is there a trick to using nested foreach loops in this kind of case? Or would it be better to count the number of children and then do a simple for loop using gizmo.child to step through each on and get the name values of the children traits?
TCArknight is offline   #23 Reply With Quote
Mathias
Senior Member
Lone Wolf Staff
 
Join Date: May 2005
Posts: 13,207

Old April 11th, 2013, 07:37 AM
I'll need to see the code, and you'll need to right-click and copy the error message, so that you can paste it here. What you've described is too vague to figure out what's going on.
Mathias is offline   #24 Reply With Quote
TCArknight
Senior Member
 
Join Date: Jan 2007
Location: NW Arkansas
Posts: 1,321

Old April 11th, 2013, 07:58 AM
Ok, thanks. I'll post it this evening when I get off work...
TCArknight is offline   #25 Reply With Quote
TCArknight
Senior Member
 
Join Date: Jan 2007
Location: NW Arkansas
Posts: 1,321

Old April 11th, 2013, 04:27 PM
I get this error:
Quote:
Hero Lab was forced to stop compilation after the following errors were detected:

Syntax error in script for Procedure 'sbgadgets' on line 17
-> Script reference is invalid under the circumstances
The code in red is where I am trying to get to the bootstrapped children on the gadget.

Code:
<procedure id="sbgadgets" scripttype="synthesize"><![CDATA[

    var ismore as number
    var i as number
    var gadgetid as string
    
    append @boldon & "Gadgets: " & @boldoff & @newline
    
    ~output the details of all resources
    ismore = 0
    foreach pick in hero where "HasGadget.?"
      ismore = 1
      gadgetid = "thingid." & eachpick.idstring
      
      append @indent & eachpick.field[name].text
      
      foreach bootstrap in pick where "component.Ability"
        notify eachthing.idstring
        nexteach 
         
      if (ismore = 0) then
        append @indent & "-none-" & @newline
        endif
        
      append @newline
      nexteach
    
    ~if we have no resources, output that fact
    if (ismore = 0) then
      append @indent & "-none-" & @newline
      endif
    ]]></procedure>
TCArknight is offline   #26 Reply With Quote
Mathias
Senior Member
Lone Wolf Staff
 
Join Date: May 2005
Posts: 13,207

Old April 11th, 2013, 04:40 PM
Code:
 
foreach bootstrap in eachpick.gizmo where "component.Ability"
  notify eachpick.idstring
  nexteach
Mathias is offline   #27 Reply With Quote
TCArknight
Senior Member
 
Join Date: Jan 2007
Location: NW Arkansas
Posts: 1,321

Old April 11th, 2013, 04:51 PM
I still get an error:

Quote:
Hero Lab was forced to stop compilation after the following errors were detected:

Syntax error in script for Procedure 'sbgadgets' on line 17
-> Use of 'eachpick.' transition is only valid within a 'foreach' context that iterates picks
TCArknight is offline   #28 Reply With Quote
Mathias
Senior Member
Lone Wolf Staff
 
Join Date: May 2005
Posts: 13,207

Old April 12th, 2013, 07:09 AM
I need to see line 17, please - that's the line it says this error is on.
Mathias is offline   #29 Reply With Quote
TCArknight
Senior Member
 
Join Date: Jan 2007
Location: NW Arkansas
Posts: 1,321

Old April 12th, 2013, 05:18 PM
Ok, I cleaned the procedure up a bit, and this error is on a new line.
Quote:
Hero Lab was forced to stop compilation after the following errors were detected:

Syntax error in script for Procedure 'sbgadgets' on line 19
-> Use of 'eachpick.' transition is only valid within a 'foreach' context that iterates picks
Highlighted is line 9.
Code:
<procedure id="sbgadgets" scripttype="synthesize"><![CDATA[

    var ismore as number
    var i as number
    var gadgetid as string
    
    append @boldon & "Gadgets: " & @boldoff & @newline
  
    ~output the details of all resources
    ismore = 0
    
    foreach pick in hero where "HasGadget.?"
      ismore = 1
      gadgetid = "thingid." & eachpick.idstring
      
      append @indent & eachpick.field[name].text & "(" & gadgetid & ")"
      
          
      foreach bootstrap in eachpick.gizmo where "component.Ability"
        notify eachpick.idstring
        nexteach
      
      if (ismore = 0) then
        append @indent & "-none-" & @newline
        endif
        
      append @newline
      nexteach
    
    ~if we have no resources, output that fact
    if (ismore = 0) then
      append @indent & "-none-" & @newline
      endif
    ]]></procedure>
Looking at the wiki, it looks like 'foreach bootstrap' uses eachthing. IfI try this:
Code:
notify eachthing.idstring
I get this:
Quote:
Hero Lab was forced to stop compilation after the following errors were detected:

Syntax error in script for Procedure 'sbgadgets' on line 19
-> Use of 'eachpick.' transition is only valid within a 'foreach' context that iterates picks
TCArknight is offline   #30 Reply With Quote
Reply

Thread Tools
Display Modes

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 10:36 PM.


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