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,283

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 -
  • (SWADE) WIP Savage Rifts
  • Savage Rifts (Deluxe): Update link in This post
  • Star Trek Adventures: Update link in This post
TCArknight is offline   #1 Reply With Quote
Mathias
Senior Member
Lone Wolf Staff
 
Join Date: May 2005
Posts: 13,019

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,283

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

I appreciate the help!

Working on -
  • (SWADE) WIP Savage Rifts
  • Savage Rifts (Deluxe): Update link in This post
  • Star Trek Adventures: Update link in This post
TCArknight is offline   #3 Reply With Quote
Duggan
Senior Member
Volunteer Data File Contributor
 
Join Date: Nov 2009
Posts: 1,485

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 offline   #4 Reply With Quote
Mathias
Senior Member
Lone Wolf Staff
 
Join Date: May 2005
Posts: 13,019

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
cryptoknight
Senior Member
Volunteer Data File Contributor
 
Join Date: Dec 2008
Posts: 523

Old September 10th, 2021, 05:38 AM
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>
Adding
Code:
    <bootstrap component="WeapRange"/>
Gives me an error that it doesn't recognize what a component is, and if I use thing it tells me that WeapRange isn't a thing. Because it's a component.

Working on Twilight 2000 4e HL System
cryptoknight is offline   #6 Reply With Quote
Mathias
Senior Member
Lone Wolf Staff
 
Join Date: May 2005
Posts: 13,019

Old September 10th, 2021, 07:03 AM
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.
Mathias is online now   #7 Reply With Quote
cryptoknight
Senior Member
Volunteer Data File Contributor
 
Join Date: Dec 2008
Posts: 523

Old September 10th, 2021, 07:50 AM
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
cryptoknight is offline   #8 Reply With Quote
Mathias
Senior Member
Lone Wolf Staff
 
Join Date: May 2005
Posts: 13,019

Old September 10th, 2021, 08:02 AM
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.
Mathias is online now   #9 Reply With Quote
TCArknight
Senior Member
 
Join Date: Jan 2007
Location: NW Arkansas
Posts: 1,283

Old September 12th, 2021, 12:13 PM
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 -
  • (SWADE) WIP Savage Rifts
  • Savage Rifts (Deluxe): Update link in This post
  • Star Trek Adventures: Update link in This post
TCArknight is offline   #10 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 09:22 AM.


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