• Please note: In an effort to ensure that all of our users feel welcome on our forums, we’ve updated our forum rules. You can review the updated rules here: http://forums.wolflair.com/showthread.php?t=5528.

    If a fellow Community member is not following the forum rules, please report the post by clicking the Report button (the red yield sign on the left) located on every post. This will notify the moderators directly. If you have any questions about these new rules, please contact support@wolflair.com.

    - The Lone Wolf Development Team

Gizmo confusion

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:
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?
 
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.
 
I get this error:
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
      
[B][COLOR="Red"]      foreach bootstrap in pick where "component.Ability"
        notify eachthing.idstring
        nexteach [/COLOR][/B]
         
      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>
 
Code:
foreach bootstrap in eachpick.gizmo where "component.Ability"
  notify eachpick.idstring
  nexteach
 
I still get an error:

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
 
Ok, I cleaned the procedure up a bit, and this error is on a new line.
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"
[COLOR="Red"]        notify eachpick.idstring[/COLOR]
        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:
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
 
Oh right - this is the statblock, so there's no need to look at the bootstraps as things - they're picks by now, so find them as picks.

foreach pick in eachpick.gizmo where "component.Ability"
 
That did it, thanks. :)

How would I go about creating an option in the Configure Hero to use to toggle display of the gizmos?
 
That did it, thanks. :)

How would I go about creating an option in the Configure Hero to use to toggle display of the gizmos?

I've gotten to that point in my project too. I set up source elements in control.1st. I made a "sourcebooks" parent with the "selectable" element set to "no":

Code:
  <source
    id="Sourcebks"
    name="Sourcebooks"
    selectable="no"
    description="Collection of rules from Qin supplements that can be turned on and off">
    </source>

Then I added a source element for each sourcebook for the game, such as:

Code:
  <source
    id="qinLegends"
    name="Qin Legends"
    abbrev="Legends"
    parent="Sourcebks"
    default="no"
    reportable="no"
    sortorder="1"
    description="Controls whether material from Qin Legends is available">
    </source>

Finally, I'm creating a new thing_xxxxx.dat file for the source, adding a "usesource" element to the things in it:

Code:
<usesource source="qinLegends"/>

I think you can get more granular than that by making the individual sourcebooks not selectable, then adding sources to represent individual rules options.

Hope that helps.
 
Last edited:
TCArknight, I've been trying to crib your work on skill specialties as per this post, but I'm hitting a brick wall. I don't suppose you have any hardwon wisdom you could share?
 
Back
Top