Lone Wolf Development Forums

Lone Wolf Development Forums (http://forums.wolflair.com/index.php)
-   HL - Authoring Kit (http://forums.wolflair.com/forumdisplay.php?f=58)
-   -   Gizmo Help (http://forums.wolflair.com/showthread.php?t=59937)

TCArknight January 14th, 2018 08:24 AM

Gizmo Help
 
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?

Mathias 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.

TCArknight January 14th, 2018 09:42 AM

Thank you Mathias! Worked like a charm. :)

I appreciate the help!

Duggan 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?

Mathias 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>


cryptoknight 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.

Mathias 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.

cryptoknight 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.

Mathias 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.

TCArknight 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?


All times are GMT -8. The time now is 09:44 AM.

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