Lone Wolf Development Forums

Lone Wolf Development Forums (http://forums.wolflair.com/index.php)
-   HL - Authoring Kit (http://forums.wolflair.com/forumdisplay.php?f=58)
-   -   Gizmo confusion (http://forums.wolflair.com/showthread.php?t=43348)

Mathias 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"

Kairos 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].

TCArknight 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?

Mathias 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.

TCArknight April 11th, 2013 07:58 AM

Ok, thanks. :) I'll post it this evening when I get off work...

TCArknight 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>


Mathias April 11th, 2013 04:40 PM

Code:


foreach bootstrap in eachpick.gizmo where "component.Ability"
  notify eachpick.idstring
  nexteach


TCArknight 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

Mathias April 12th, 2013 07:09 AM

I need to see line 17, please - that's the line it says this error is on.

TCArknight 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


All times are GMT -8. The time now is 09:18 AM.

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