Lone Wolf Development Forums  

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

Notices

Reply
 
Thread Tools Display Modes
TCArknight
Senior Member
 
Join Date: Jan 2007
Location: NW Arkansas
Posts: 1,088

Old January 14th, 2018, 08:24 AM
Howdy!

Working on a dataset where each piece of gear can have a number of Qualities. These qualities are contained in a grCustom child on the item.

When I display the Weapon for example on the armory tab, the qualities display without issue. But, when buying a new weapon, the Qualities do not display and I'm getting an error:
Quote:
This has a gizmo attached.
- - -
Attempt to access non-existent containing entity from script
Location: 'finalize' script for Field 'grQualSumm' near line 11
This is the field and the finalize script:
Code:
    <field
      id="grQualSumm"
      name="Qualities"
      type="derived"
      maxfinal="50">
	  <!-- Final value for display is a blending of the various range values -->
      <finalize><![CDATA[
        var txt as string
		var tags as string
		var ismore as number
		
	~if this is a thing, we have to pull the tags from any attached gizmo
        if (ispick = 0) then
          if (isgizmo = 1) then
		    notify "This has a gizmo attached."
		    ismore = 0
		    foreach pick in gizmo where "component.GearQual"
			  if (ismore <> 0) then
			    tags &= ", "
				endif
				
			  tags = eachpick.tagnames[ItemQual.?,", "]
			  
			  ismore = 1
			  nexteach
            endif
		else
		  tags = tagnames[ItemQual.?,", "] 
		endif
		  
		if (empty(tags) = 0) then
		  txt &= " " & tags
		else
		  txt &= "-"
		  endif
		  
	    @text = txt
		
        ]]></finalize>
      </field>
Anyone have any idea what I'm missing when trying to step through the gizmo?

Working on -
TCArknight is online now   #1 Reply With Quote
Mathias
Senior Member
Lone Wolf Staff
 
Join Date: May 2005
Posts: 12,587

Old January 14th, 2018, 09:22 AM
If this is a thing, you can't use "foreach pick" - you can only use a "pick" foreach if you're running on a pick.

Try
foreach bootstrap in entity from GearQual

A gizmo that has not yet been added to the character is called an entity (same kind of change in terminology as thing/pick).

And then inside that foreach, you'll use eachthing transitions, not eachpick.
Mathias is online now   #2 Reply With Quote
TCArknight
Senior Member
 
Join Date: Jan 2007
Location: NW Arkansas
Posts: 1,088

Old January 14th, 2018, 09:42 AM
Thank you Mathias! Worked like a charm.

I appreciate the help!

Working on -
TCArknight is online now   #3 Reply With Quote
Duggan
Senior Member
Volunteer Data File Contributor
 
Join Date: Nov 2009
Posts: 1,307

Old December 7th, 2018, 07:18 PM
TCArkKnight: I've got a similar situation, where all weapons and armor have certain qualities. I know how to add the <child> element to a Thing. How did you attach it to the general Component or Componentset?
Duggan is online now   #4 Reply With Quote
Mathias
Senior Member
Lone Wolf Staff
 
Join Date: May 2005
Posts: 12,587

Old December 8th, 2018, 11:30 AM
Where you've defined the <entity> itself, you set up the bootstraps within the entity. Here's an example from Pathfinder of the entity used in the -Custom/Magic Weapon-:
Code:
  <entity
    id="gMagWeapon"
    form="MagWeapon">
    <bootstrap thing="gCustMagic">
      <autotag group="Helper" tag="MgMult2000"/>
      </bootstrap>
    <bootstrap thing="LegItemHlp"/>
    </entity>
Mathias is online now   #5 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:06 AM.


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