Junior Member
Join Date: Sep 2010
Posts: 7
|
I'm attempting to reproduce the Bladesinger prestige class, specifically the Bladesong Style ability, but I cannot find the correct field value to reference whether or not a given weapon is wielded/equipped. If I use the script below, it returns a valid condition whenever the character possesses the weapon, whether or not it is wielded. Any help would be greatly appreciated!
Quote:
Last edited by Kaelryk; October 16th, 2010 at 06:22 PM. Reason: added more info |
|
#1 |
Junior Member
Join Date: Sep 2010
Posts: 7
|
Anyone know the tag I'm looking for? Devs, anyone? I've tried variations on this:
if (hero.tag[IsEquip.wLongsword] <> 0) then but I keep getting errors, so I'm obviously not guessing correctly. I know there has to be some tag that indicates whether or not a given item is equipped; I just can't find it. I would greatly appreciate any help or input anyone could provide. Thanks in advance! |
#2 |
Senior Member
Volunteer Data File Contributor
Join Date: Mar 2007
Posts: 1,245
|
You should look for the field[gIsEquip] instead.
foreach pick in hero from BaseWep where "IsWeapon.wLongsword" if (each.field[gIsEquip].value <> 0) then whatever you want to happen when equipped endif nexteach |
#3 |
Senior Member
Volunteer Data File Contributor
Join Date: Mar 2007
Posts: 1,245
|
Hope that helps. Sleep time in Korea now.
|
#4 |
Junior Member
Join Date: Sep 2010
Posts: 7
|
Awesome!! That's exactly what I was looking for! I really appreciate your help--I've been trying to figure this out for days, and it's been driving me nuts! Thank you for helping me retain my sanity (what little of it remains...)
|
#5 |
Senior Member
Lone Wolf Staff
Join Date: May 2005
Posts: 13,207
|
A revision:
Code:
var hasweapon as number foreach pick in hero from BaseWep where "IsWeapon.wLongsword" if (eachpick.field[gIsEquip].value + eachpick.field[wIs2nd].value <> 0) then hasweapon = 1 endif nexteach if (hasweapon <> 0) then ~whatever you want to happen if it's equipped endif |
#6 |
Junior Member
Join Date: Sep 2010
Posts: 7
|
I didn't know about the 'wIs2nd' field, but then I'm sure there are quite a few fields I don't know about. I assume it indicates a second copy of the referenced item in inventory? Since I don't have open access to the source code, I just sorta make this stuff up as I go along...
I used this: Quote:
|
|
#7 |
Senior Member
Lone Wolf Staff
Join Date: May 2005
Posts: 13,207
|
If your ability is already requiring that nothing's equipped in the off-hand, then you don't need to test for whether the longsword's equipped in the off-hand, and can go with Lawful_g's version of the script.
|
#8 |
Junior Member
Join Date: Sep 2010
Posts: 7
|
So what exactly does the [wIs2nd] field represent? I thought at first it was to indicate a second copy of the item in the inventory, but since you referenced it in your code, I thought it must refer to a second copy of the item being equipped, but then wouldn't it be called [gIs2nd], to keep the naming conventions consistent?
|
#9 |
Senior Member
Volunteer Data File Contributor
Join Date: Jan 2010
Location: Chicago, IL (USA)
Posts: 10,729
|
[wIs2nd] tells you if the weapon is equipped in the off-hand or 2nd hand. The primary hand being considered the 1st hand.
So the following is basically saying that IF equipped in the primary hand or off-hand then do something: Code:
if (eachpick.field[gIsEquip].value + eachpick.field[wIs2nd].value <> 0) then Hero Lab Resources: Pathfinder - d20pfsrd and Pathfinder Pack Setup 3.5 D&D (d20) - Community Server Setup 5E D&D - Community Server Setup Hero Lab Help - Hero Lab FAQ, Editor Tutorials and Videos, Editor & Scripting Resources. Created by the community for the community - Realm Works kickstarter backer (Alpha Wolf) and Beta tester.- d20 HL package volunteer editor. |
#10 |
Thread Tools | |
Display Modes | |
|
|