![]() |
Senior Member
Join Date: Jan 2007
Location: NW Arkansas
Posts: 1,240
|
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:
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> Working on - |
|
![]() |
![]() |
Senior Member
Lone Wolf Staff
Join Date: May 2005
Posts: 12,852
|
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. |
![]() |
![]() |
Senior Member
Volunteer Data File Contributor
Join Date: Nov 2009
Posts: 1,444
|
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?
|
![]() |
![]() |
Senior Member
Lone Wolf Staff
Join Date: May 2005
Posts: 12,852
|
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> |
![]() |
![]() |
![]() |
Thread Tools | |
Display Modes | |
|
|