• 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 Help

TCArknight

Well-known member
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:
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
		   [B][U] foreach pick in gizmo where "component.GearQual"[/U][/B]
			  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?
 
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.
 
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?
 
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>
 
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.
 
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:
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.
 
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.
 
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?
 
Code:
<editthing
compset="Ammunition"
name="Ammunition"
group="EquipHelper"
prefix="am"
defchild="grCustAmmo"
description="Armor, vehicles, and simple equipment all have their own tabs for creating objects of those types."
summary="Defines ammunition, grenades, or missiles that can be selected on the Armory tab.">
 
Back
Top