• 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

At another loss

ErinRigh

Well-known member
I am trying to disable a class ability unless you are wearing a buckler.

I can figure out how to get it to disable if not wearing a shield, but not specifically a buckler.

Code:
      if (hero.tagis[Hero.EquipShld] <> 1) then
        perform assign[Helper.SpcDisable]
        done
        endif

What do I need to change to make it specific to bucklers (shBuckler)?

Thanks in advance for answering
 
There are at least two ways to find out.

Method 1:
While in the editor, go to the "Equipment" tab.
Under the Equipment tab, go to the "Armor" tab.
Click "New (Copy)"
In the top of that window, where it says "type here to search," type "Buckler".
If the search returns multiple items, find the appropriate item, and look at the name in parentheses.
Once you have the name, you can cancel out of the copy process.

Method 2:
While in Hero Lab, with the Pathfinder system loaded, add a buckler to a character.
On the "Develop" menu, make sure "Enable Data File Debugging" is checked.
Right-click on the buckler, and select "Show Debug Fields for Buckler."
Near the top of that window, you'll see "Fields for Buckler," followed by the unique ID in parentheses.
 
well I know the unique ID for buckler (shBuckler), but I don't know how to script 1) does he have a buckler, and 2) is it equipped?
 
well I know the unique ID for buckler (shBuckler), but I don't know how to script 1) does he have a buckler, and 2) is it equipped?

I don't know if there's a better or an easier way, but one way to do it is to put this eval script on the buckler.

Code:
    	if (field[gUserEquip].value = 1) then

           <whatever code you need in here to disable the desired ability>

	   endif
 
Putting it on the buckler is a bad idea. I would check for Hero.EquipShld then iterate over them and look for gUserEquip. If the equipped item is a buckler then execute your code.
 
All well and good, but you are talking to a 4th grader here

I figured out how to check for shield (see post 1) but I don't have a clue how I would take

Code:
hero.tagis[Hero.EquipShld] = 1

And then tell it to look for shBuckler?
 
I dont have HL handy so I cant look up the tags. But once we know that we have something in the shield slot you can iterate over items with the shBuckler and check if they are equipped.
Code:
 foreach pick in hero where "thingid.shBuckler"
     if eachpick.field[gUserEquip].value = 1
        ~ code here
     endif
 nexteach
 
The reason we do the hero.tagis[Hero.EquipShld] check first is for speed, and ease of checking. If nothing is equipped we dont need to spend the time iterating over all bucklers. If and only if something is equipped in the shield slot do we iterate over the bucklers to see if one of them is equipped.
 
does this seem right?

Code:
foreach pick in hero where "thingid.shBuckler"
     if eachpick.field[gUserEquip].value <> 1
        perform assign[Helper.SpcDisable]
        done
     endif
 nexteach
 
don't worry i figured it out

Code:
foreach pick in hero where "thingid.shBuckler"
     if (eachpick.field[gUserEquip].value <> 1) then
        perform assign[Helper.SpcDisable]
        done
     endif
 nexteach
 
does this seem right?

Code:
foreach pick in hero where "thingid.shBuckler"
     if eachpick.field[gUserEquip].value <> 1
        perform assign[Helper.SpcDisable]
        done
     endif
 nexteach

Close but you might run into issues if the PC has multiple shields. Might want to do the reverse process though. add the disabled tag and then delete it if a buckler is equipped.
 
Sorry to interrupt but several things. :)

If you are using "Thingid.?" as a tag you are most likely heading in the wrong direction. 99% of the time you should never use Thing ID because Thing ID's change. :( In this case what if I made a new buckler up tomorrow or a magic buckler up with a different Unique ID. Then your script logic won't work.

Foreach loops should be avoided when you can. Always look for hero tags to use instead.

If I add a Buckler and equip it I can look at the tags on the hero for "Buckler". Develop->Floating Info Windows->Show Hero Tags. This then shows I have a tag called "ShldClass.Buckler" which tells me I have a buckler equipped.

Meaning to see if a buckler is equipped you just need to do:
Code:
~ If we don't have a buckler disable ourself
If (hero.tagis[ShldClass.Buckler] = 0) Then
  perform assign[Helper.SpcDisable]
Endif
 
Just curious as to why.
Its a "Great" plan if you have full access to the skeleton files or you are making your own game system.

When working within LW game systems you want to avoid doing a "Replace Thing ID" as much as possible. LW makes too many changes in future releases that will cause you issues.

Its best to work from the OUTSIDE looking for tags and field values when working within LW game systems. :)
 
OK, I misunderstood. I was parsing this as being particular to a specific buckler.

The example I provided was for a custom magic item, and certain things are dependent on whether or not this specific magic item is equipped.

Going back and rereading, I now see where this question is about bucklers in general, not just one specific buckler.
 
Back
Top