![]() |
Senior Member
Join Date: Jan 2007
Location: NW Arkansas
Posts: 1,311
|
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: 13,137
|
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,500
|
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: 13,137
|
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> |
![]() |
![]() |
Senior Member
Volunteer Data File Contributor
Join Date: Dec 2008
Posts: 523
|
I see that... but components aren't entitites. We created an Ammo Gizmo to load ammo. I wanted to ensure that gizmo is on all the ranged weapons for the system.
Code:
<entity id="Ammo" form="ammogiz"> <bootstrap thing="AmmoHelper"/> </entity> Code:
<bootstrap component="WeapRange"/> Working on Twilight 2000 4e HL System |
![]() |
![]() |
Senior Member
Lone Wolf Staff
Join Date: May 2005
Posts: 13,137
|
You'll need to add the entity to each <thing> that gets that entity. So add it to your first weapon, and then always copy-paste to create new weapons so they all have it.
And I wouldn't call the gizmo "ammo". In our games that need entities on ranged weapons, the gizmo handles ammo in addition to several modification/rune/accessory/etc. systems (the exact details vary by game), but I'm guessing your system has scopes and silencers and such. "WeaponCustomize" or "FirearmCustomize" or "RangedCustomize" would be what I'd set as the entity Id if I were setting up a new game system. Last edited by Mathias; September 10th, 2021 at 07:07 AM. |
![]() |
![]() |
Senior Member
Volunteer Data File Contributor
Join Date: Dec 2008
Posts: 523
|
Ok to just confirm. You can't add a gizmo to the component that things are built from. It has to be added when you create instances of the component as a thing.
i.e. I can't make the component for ranges weapons have the gizmo, I have to specify the gizmo for each ranged weapon when I make it. Working on Twilight 2000 4e HL System |
![]() |
![]() |
Senior Member
Lone Wolf Staff
Join Date: May 2005
Posts: 13,137
|
Yes, they're set on things, not components or compsets. This way, different items can have different entities with different behaviors - for example, in PF2, staves are a special type of weapon, but they don't have the same entity as regular weapons. The staff entity contains everything the weapon entity does, plus handling for the staff mechanics.
|
![]() |
![]() |
Senior Member
Join Date: Jan 2007
Location: NW Arkansas
Posts: 1,311
|
If I recall, there is a way when setting up the editor tab for a component to add the entity by default, isn’t there?
Working on - |
![]() |
![]() |
![]() |
Thread Tools | |
Display Modes | |
|
|